I searched google and unable to find the correct way to achieve this. I have to add two google maps activity to my application. Already merged the manifest. Here is the tricky part, I want one map with direction api enabled, and the other without. Now if I click on the marker, a button shows up in the map where I want the direction api and that's fine. But it is the same with the other one. What is the solution here? Any suggestions will work! Do I need to get another key for thr map?
You have to override onMarkerClick method.
See documentation:
https://developers.google.com/maps/documentation/android-sdk/marker#marker_click_events
Related
I'm looking to create a circle menu for markers in my app that uses Google maps.
I've found this online example of what I am trying to do:http://demo-ee.com/index.php/examples/view/circle-menu-for-marker-with-mx-google-maps-for-expressionengine#
The problem is that this is for google maps in a webview, I'm looking to do this on Android.
Does anyone know if this is possible to achieve with google maps for Android and if it is, how much work would be involved to do it?
Is it possible to rebuild this example code in java to use in an Android app?
thanks
I put this as an answer and not as a comment, but I don't think you can achieve the same.
First of all, on android you don't have the "hover" callback for maps, you can only use the onMarkerClick listener.
You could try to build a custom infowindow (there are a few tutorial online but never followed, so I can't give you a trusted one, you have to try :( ) and check if the iw can be placed around your item. Unfortunately on android there is a limited set of functionalities, but to be honest, I would explore a different UX for that (cards, dialogfragment or other).
Check how google maps behaves when clicking on a place (a view scrollable from bottom with details).
You can also think about using a toolbar/expandingtoolbar
I have searched for hours on the web for an example of implementing the direccions service on my android app.
I am using the google maps android api 2.
Basically I want the directions from the actual position and a marker position selected by the user.
I want to make clear that I donĀ“t want to launch a web browser or the google maps aplication, I want to implement the service on my own app.
Till now I found some examples about drawing the route on tha map, which are ok
http://wptrafficanalyzer.in/blog/gps-and-google-map-in-android-applications-series/
Get driving directions using Google Maps API v2
so I just miss the indications part of the service so y can show on my own listview with arrows (turn to left , to right , etc).
Thanks for reading my question
I'm not sure what you want. In your second link about Google Map API v2, the data for drawing maps comes from maps.googleapis.com .You can see https://developers.google.com/maps/documentation/directions/ for more documentation about that.
The xml returned from maps.googleapis.com include <html_instructions> tag which contains instruction like turn left or turn right. So you just need to parse that xml and use <html_instructions> tag for information you need on your listview.
I hope this helps.
I just want to touch the screen, use a listener to detect and add a marker at the location touched and allow the user to add written information to the marker. I done this a while back using the now deprecated API, after a long time searching SO, all I see on markers and V2 API is how to animate, add custom markers, or shadows, all beyond what I need to know. I read through the documentation at Google for a good while and got lost.
It seems that basic stuff is hard to find. I would just like to know if this is possible, and a few pointers on how it is different in V2.
Thank you!
I would just like to know if this is possible
I don't see why not.
and a few pointers on how it is different in V2
Implement an OnMapClickListener and attach it to your GoogleMap via setOnMapClickListener(). Your onMapClick() method will be called when the user taps on the map. There, add a new marker. AFAIK, this should work just fine.
I am wondering about the correct approach or maybe the difference between the following if my intention is to put 2 markers on the map and maybe remove them after a while.
Should I use the overlays to put them, or should I use the canvas.draw (or just draw) to put them or simply add the two images as a view and using the layout param I can set the location. I found the last one being the easiest but I need your input
Thank you.
Don't be surprised, this is a terrible question. Other than your two tags, you don't explain anything about the platform you're building on.
If you're building an Android app, you'd probably want to use the maps Overlay.
http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/Overlay.html
If you're building a web app, I would use the Google Maps Javascript API Marker.
http://code.google.com/apis/maps/documentation/javascript/overlays.html#Markers
If you're not using either, or are not using Google Maps, I have no clue how you expect people to read your mind over the internet.
Is this possible in Android, when i will say a name of place google map pointer will zoom to that place. i.e. I want to search Map by voice
if possible then how to do this? Though i have done so many apps in Google map, but din't try this before! Can any body help?
this should be useful to start off.then you can go through these APIs.If you want to include the voice recoginition part , now APIs are available from level 8.check this out. RecognizerIntent.you can even use the Voice recoginition example
Check out the animateTo method of the MapController class. I think this will do what you're looking for.