I'm a newbie in android. All I can do is to put a marker in the user current location.
But what I need to do is put a marker in the user current location and to a specific places that near the user location. For an example a marker in the user and a marker in all the KFC that near the user location. But I don't have any idea yet how to make this work.
any thoughts will be accepted.
what you might need to do is an annotation, or itemizedOverlay. This is covered in Part 2 of this tutorial, which is step by step.
https://developers.google.com/maps/documentation/android/hello-mapview
Otherwise if you are just firing an intent to the map app. Then just sending the location of KFC would suffice since the user location will appear in the native app anyway
http://developer.android.com/guide/appendix/g-app-intents.html
geo:latitude,longitude
geo:latitude,longitude?z=zoom
geo:0,0?q=my+street+address
geo:0,0?q=business+near+city
Related
I need to show google map to user and then resolve the address on that map.
I wonder what's the recommended approach for best user experience in Android?
The ways I was thinking of is:
Show current location (or default if not permitted). Put a pin at the place where user taps on the map. If tapped again, then just move the pin. Resolve the address where last pin was dropped
Another approach is same to what uber has: show the map with a pin in the center of the viewport pointing to current location. That pin is still in the center and consumes new position when map is moved against it. Address is resolved when map movement stop event received
Disadvantages of #1 is that it might be not obvious for user that pin needs to be placed on the map
Is there a best practice for this? Or a more intuitive way to do this?
Any suggestions?
These tasks need Google Cloud Api And That is paid.
Reference Links:- https://developers.google.com/maps/documentation/android-sdk/overview
https://console.cloud.google.com/apis/library/places-backend.googleapis.com?project=my-application-359006
I want to show the current location of the user only on road(not beside of the road) while moving. I have used the LocationManager to get the current location. But sometimes I am getting the location beside the road, with this, the location point on map is showing beside the road. Actually, I have to show his location on Road(if he is beside the road) only. I searched lot for this but didn't get any idea.
Example: How I am getting the current locations on map.
m
A---n-------B
here, A is start point
B is end point
n is on road(current location for sometime)
m is beside road(current location)
But I would need the m also should be on road.
Please help me on this..
The google directions service will calculate from nearest road so calculate directions from current location to current location - returned starting location will be on a road.
But what if user genuinely is off-road in a shopping mall carpark for instance?
For that you need to use road API which will give you the path upon the road otherwise you will not get the accurate path.
Snap to Roads
The Google Maps Roads API takes up to 100 GPS points collected along a route, and returns a similar set of data, with the points snapped to the most likely roads the vehicle was traveling along. Optionally, you can request that the points be interpolated, resulting in a path that smoothly follows the geometry of the road.
Check Details Here
You need to call like this
https://roads.googleapis.com/v1/snapToRoads?path=-35.27801,149.12958|-35.28032,149.12907|-35.28099,149.12929|-35.28144,149.12984|-35.28194,149.13003|-35.28282,149.12956|-35.28302,149.12881|-35.28473,149.12836&interpolate=true&key=YOUR_API_KEY
My app is totally based on maps. The requirement is user need to enter the source and destination in words then i need to draw the route on map with those values with markers. Later on the displayed map with route drawn, the user able to change/modify the source or destination by dragging the marker which are displayed. Simultaneously the route drawn should also change dynamically with user's action.
I can get the lat & long from the map using onTouchEvent. But in the same map not able to set both source and destination.
And i tried reverse geocoding to get the lat & lon from given location names. But i get IOException:Service not Available. I was searching for solution, then i found this link which started in jun 2010, still no fix for this bug till now.
Please help.Also provide sample code.
Thanks.
My application requires that a user select a location on a MapView. I will be using Google Places API to place location markers on the map. There will be times however when a user might select a location, for example a fountain in a park, that IS NOT listed in the Places API. One option is to offer users a choice of selecting a location with a touch on a map, OR selecting map markers of known locations using two different maps for each activity. I think the perfect solution however would be to use one MapView that contains the mapmarkers but also allow the user to select a location that does not have an associated marker.
My thoughts were to apply a reticle in it's own Overlay that stays centered in the middle of the MapView despite scrolling and a select button to make the selection.
If the reticle is over a marker, for example, Sams Cafe', then the button would read "Select Sam's Cafe'", if the reticle isn't over any Map Markers, then the button would read "Select this location".
I am having trouble figuring out a way to verify the reticle is over a marker. Since the marker is limited to a single GeoPoint, it's going to be very difficult, frustrating and time consuming for the user to try and match the reticle center to the exact GeoPoint.
What would be optimal is a check to see if the reticle is over the Map Marker graphic. I presume this will utilize projections and bounds??
Two questions, How to do this if possible?
or, is there a better UI that I am overlooking that is much easier to achieve?
Thank you for your consideration.
If you use the way you saying is better than anyone, but why dont you keep away any user from any kind of geocoding. Like user selects the location through marker, on the basis of that user will confirm the location, if it has got any place then it will show the address or it will show the nearby location. e.g. let the user select the location from marker get the longs. and lats. , If user confirms that location then put it onto geocoding and get the location address, it will surely return an address maybe exact or nearby and if user likes it, user will confirm it, simple. Please notify if its not feasible way.
In my app I ask user to enter his location(text) and call Google web service to find out geocodes and then display on map.
Now I also want the user to fine tune his location by moving the marker on the map.
How can this be done?
Rgds,
Sapan
Please take a look at this source http://bazaar.launchpad.net/~financisto-dev/financisto/trunk/view/head:/src/ru/orangesoftware/financisto/activity/LocationActivity.java at LocationOverlay inner class in particular