I would like to plot route between 2 points using lat long coordinates using Google maps direction service. I have to plot many routes in a single map. I have heard some where that it takes time for reverse geocoding and also there is a limit for it. Is it possible to do it without reverse geocoding the coordinates?
If you already got the coordinates then you can just use LeafLet or OpenLayers to display them on a map. This doesn't involve Google Maps at all and you can also directy display a GPX file if you like to.
Related
One of my Application's features need to show the track history of a vehicle on map. In order to implement this feature I am using Google Road API. I am passing 100 lat lng points to it but the resulting response is not on road. it contains many jumps.
Is there any other API which gives the better response? And is it it possible to plot those points on google map?Help required.
Thanks.
I have created a custom map via http://www.google.com/mymaps/ and have added a few locations.
Is there a way for me to retrieve these locations (in lat and lng format) via Google Map Javascript API?
First you will need to export your map as a KML layer. To see how to do that, you can read about it here.
After that, you will need to import your KML layer to Google Maps. Here is an example.
Then you can use KML Feature Details and use position to get lat/long
Problem
I have two coordinates: A B
Solution?
Can I see if coordinate A is within 50 meters of coordinate B using Google Maps API?
Other Solution?
If not, is there a way to do this without using google API?
computeDistanceBetween() from the Google Maps API v3 geometry library returns the straight line distance between two google.maps.LatLng objects (the default units are meters).
Be sure to include the geometry library
Each phone, amd many other geo apis have a function to calculate the distance between two lat,lon coordinates.
If you dont have one, then use the haversine distance formula.
Really quick/simple question that will determine which map API i use for my project.
I dont need an example- ill figure that out, i just need to know if the capabilities are there.
If i have store geocode (latitude, longitude) coordinates in a database, can i put one of those little red markers on a google map without having to actually make a geocoding request from google?
Additional question:
Also, would it count towards any quotas every time i display one of their maps, even if i give them the geocoded coordinates? Because i mean technically their map still has to find those coordinates...
Q1: Yes — you tell the API the coordinates of where to put the marker, rather than get Google to find those coordinates.
Q2: The usage limits are published by Google. You can have up to 25000 map loads per day. If you don't use the geocoder because you provide the coordinates yourself, then you don't use a geocoder access.
I want to draw Polylines with the Google Maps JavaScript API. Is there a tool that will help me get the latitude and longitude points by just clicking on the map, then exporting an array of lat-long pairs?
I imagine something like the personalized maps service (My Places) in Google Maps where you can click-snap on the roads to specify your own driving directions. I'd like to take that one step further. That is, to export an array of lat-long pairs that specify the roads traveled.
I know this answer might be a little late but today I was trying to figure out what I believe to be the same issue as this question. So, you can draw the points on the map then get that encoded polyline with Google's Interactive Polyline Encoder Utility then I recommend using Mapbox polyline utility to convert the overview_polyline to latitude and longitude pairs values. The latitude and longitude pairs are also on Googles Utility but it is a bit of a hassle to continuously copy each coordinate.
For more information about the Mapbox Polyline Utility process:
http://zevross.com/blog/2014/09/23/convert-google-directions-to-geojson-points-or-polylines/
And here is Google's Encoder Utility:
https://developers.google.com/maps/documentation/utilities/polylineutility
You can use the Drawing Tools library:
http://code.google.com/apis/maps/documentation/javascript/overlays.html#drawing_tools
which will give you an encoded polyline. You can use that to draw a line, or you can decode it to get the specific points using the geometry library:
http://code.google.com/apis/maps/documentation/javascript/geometry.html