Reputation: 689
I have opened "Google Map"
Application from my App.
What I want is I want to add my app button for navigating to my app, over only google map not on other apps.
Using this link ,I have added overlayservice to my app but it will overdraw over every other application on device window.
I only want to draw over google map app Like this.
Upvotes: 2
Views: 54
Reputation: 522817
This started off as a comment, and then morphed into something of an answer. One option would be to draw a custom marker on your Google Map for the taxi icon. Whenever there is a zoom, drag, etc., you might have to do a re-render to get it in the same place again. I can verify that it is possible to capture click events on a custom marker in Android. Here is what your setup might look like:
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
mMap.setOnMarkerClickListener(this);
mMap.setOnCameraMoveListener(this);
// ...
}
Then, override the marker click listener:
@Override
public void onCameraMove() {
// remove the old marker, and redraw it again on the left of the screen
}
You also probably would want to capture click events on your custom marker:
@Override
public boolean onMarkerClick(final Marker marker) {
// ...
}
The above onMarkerClick()
method receives a reference to the marker which was clicked. You may keep an activity-scoped marker, and then check if it matches what was clicked to decide whether or not your custom marker were clicked.
Upvotes: 1