i am making an app in which i have to draw path on map as my devices moves. I searched my tutorials but all show to draw path b/w two points but i want to draw path as my device moves.
Any help regarding this will be appreciated.
what do you mean as your device move? either way you have to get location updates using location listener and on every new update create a Polyline between the coordinates of the new update and the previous one.
UPDATE: Here are some post that show you how to draw a polyline with direction:
Is there a way to show road directions in Google Map API v2?
Get driving directions using Google Maps API v2
I could use the concepts there to draw you the line you want.
Related
I'm about to learn more on how to draw route between two points using Google Directions in Google Map Android API V2. My question is can i get informations about the drawed road like witch streets are passed by this road .Or can i get this information without drawing the route ? can i get it with the two points only(start- end).
thanks.
something like this is that you need?
https://developers.google.com/maps/documentation/javascript/examples/directions-travel-modes?hl=es-419
after #honeyyy comment I suggest this link
https://developers.google.com/maps/documentation/javascript/examples/directions-complex?hl=es-419
that get all checkpoint in the middle of two points an get information about them
Does anybody know how to draw circle route (path)? I can't find any solution in the documentation of google maps for android. Yes, I know, that I can draw path with polyline but I want to differ CAR and WALK path. You can see, that it is possible in google maps, when you choose WALKING direction.
Does anybody tried to solve this problem?
I want to create indoor map for a mall. I am using Beacons for getting positions and navigating for shortest paths. I dont need gps or any other wifi. What i need is:
I need to know how to create maps which can zoom in and zoom out like google maps.
I want to draw paths dyanamically when the user searches for it, so i need to keep in mind this functionality while creating maps.
Any body helps, Thanks in advance.
[Note: I studied google maps , but i cant use google map indoor functionality for some reasons. I also dont want to use any API which needs to be subscribed]
I want to create indoor map for a mall.
For creating an indoor map for any specific place (your example: mall store), you can draw your map and include it as a background image. Then using beacons you have to calculate your distance from them and draw your path based on x and y coordinates.
I need to know how to create maps which can zoom in and zoom out like google maps.
You can implement zoom on pinch on your image (map image)
I want to draw paths dyanamically when the user searches for it, so i need to keep in mind this functionality while creating maps.
As i mentioned above, you have to draw your path based on x and y coordinates. You can suppose that image's top-left corner is the intial coordinate(0,0) and assign that to x=0, y=0. While you are moving, you make a calculation based on those coordinates and update UI
One alternative to Google's tools for drawing and rendering maps (indoor or otherwise) would be Mapbox, who just recently updated their mobile SDK offering. https://www.mapbox.com/developers/
I don't want to show the route as there is no destination point in our app, so what we want is to show the active path of the user over the map from the starting point to the current point.
Problem: As some time or most of the time the location shown outside the road on which user is traveling, which draws the path outside the roads.
Help me to draw the path on the road as user is driving on the road.
How Google do the same? or is there a way to do so which i am missing or
any algo to correct the path.
That is a very common problem that all GPS devices need to solve.
See http://econym.org.uk/gmap/snap.htm for some examples to snap your location coordinates to a street.
Hi With the help of LocationManager I managed to find current location in android.
For showing routes between two geo- co-ordinates what should I use so that I wont plot air distance instead will show ground routes or is it with help of json can I plot routes.
I have tried polyLine() but it gives straight line.
To work out the line between two points you need to know what map projection type you are using. Some map projections preserve shape (and therefore angles) others do not. Take a look at http://www.progonos.com/furuti/MapProj/Dither/CartProp/ShapePres/shapePres.html it might help.
If you're using a Mercator projection then I found this page that claims an algorithm in C# that should point you on your way: http://conceptdev.blogspot.co.uk/2009/01/great-circles.html
As for the line segments, ployline will give stright lines between the points. You'll need to use Path and use the Bézier curve methods Path.cubicTo() and Path.rCubicTo() from memory.
Do you have all permission set in the Manifest? Also, you have to enable the location service (is the gps icon in the status bar showing?). It'll take some time for the device to get the location, so see if onLocationChanged is called.
Here you can find the answer for your qustion:
Is there a way to show road directions in Google Map API v2?
and here:
Get driving directions using Google Maps API v2
basically what you should do is make a call to Google Directions API receive the road direction coordinates (many Latlng points), and then draw a polyline between each one of them.