How do I disable a new pin being dropped when a user touches the map? This seems like this should be obvious, but I can't find it anywhere! Basically map comes up with my custom pins, user touches anywhere on the screen, a dummy pin appears and mine disappear.
You might want to change the draggable(boolean) function in markerOptions, you can set the draggable to be false.
For more information about a draggable market, you can visit this documentation.
I'm dumb. I got a little copy and paste happy and had that as part of a listener.
Related
Basically, my app will function a bit like Pokemon Go. I'm using mapsforge and offline maps. At the moment the app allows auto rotate(fine), tapping(fine) and map movement, like dragging or scrolling(not sure which event does that).
I just need the app to not allow dragging/scrolling of the map. Everything else should be allowed.
Any insight would help.
You can have a view on the top of your map.
That View can handle all touch events and do not give it to the map.
I am working on android tracking application.
I need to show Connected friends on MapView. Each Friends marker contains image(Person image) and two buttons(Make Call and message) .
Note : The two buttons should show after image pressed.
I try this sample http://www.nasc.fr/android/android-using-layout-as-custom-marker-on-google-map-api/. It shows only TextView.
Is there any way to add custom marker with button or any other ideas to achieve this?
Below image shows the map-view that i want to add live views.
Thanks in Advance
If I'm not wrong, you're looking for infowindowadapter. Did you try infowindowadapter ? If not please implement it .
Here is the link
Visit Here
Thanks. Let me know if it helps.
Finally i ended up with my result with the below link
Google Maps Android API v2 - Interactive InfoWindow (like in original android google maps)
Its quiet interesting to hack layouts.
Thanks,
From the Google Maps V2 documentation:
Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (e.g., after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.
Therefore, you can't add buttons to the markers. An idea could be have that buttons somewhere in your layout and show/hide them when the user selects a marker.
I am doing a little project on Android with Google maps. And I have one question - it is possible to make marker draggable with single click on it, not after long press. For example: I click marker, it changes icon and I can drag it anywhere in map, and then after another tap he will not be draggable again and changes its icon back? (Marker must be draggable all the time from first tap to second even if you release it)
#user2595870:
Hello,
I know it should be in comment but due to less reputations i am suggesting you in answer.
You want to drag and drop facility for marker kind of thing ?
if so there is good example provided here. Please check it.
Recently I show the ubicabs taxi booking app. I found very nice functionality inside it. In this app they have google maps for showing markers, but they have used very good UI component for that. Also I found one more uniqueness is that whenever user moves or change the position of marker through touch it will fetch the current location. One thing that I know is that it is using the onTouchEvent of Overlay but how to create that marker balloon and how to get updated location on the basis of that marker.
I am attaching a preview of that marker here. Also would like to know that how can we scroll the text inside that balloon?
The best overlay open project I have found so far is this one, link. But it is nothing compared to the picture above. Would also like to know how they created this! Great Question and picture ;)
move the pin to front when we click on pin in map please suggest any solution to do this
Best answer: Write your own Overlay to have this capability.
Possible answer: Play around with the order of the OverlayItems in your ItemizedOverlay. That may control which is "on top", but I am not completely certain. And, since that behavior is not documented, it might change in the future.