(Flutter) How can I use Google Map's distance matrix API to calculate the distance between 2 locations using the names of the places - flutter

I'm trying to find the distance in meters between 2 places using the google maps API in flutter. I was asked to use names of cities or places and I have no idea on how that works except using longitudes and latitudes. Please how do I go about it.

Related

Leaflet finding distance to nearest markers on all 4 directions

I have a leaflet map with several thousand markers that are clustered. I show an icon for the users current location on the map and I need to show the distance to the nearest marker in all four directions. So for example, North:100M, South:1KM, East:.... and so on.
I dont see an inbuilt way in leaflet to do this. Any ideas on I can go about accomplishing this ?

Get elevation of an area

I need to get the elevation in meters, of specific points within in a 1km square of ground.
Each point will be 5 meters apart, meaning a total of 40,000 specific points.
The elevation for each of these points will be stored in a 200x200 matrix.
I have tried to use the Google Maps Elevation API, but I think the amount of data I need to request will exceed the terms of service.
I also need to use the elevation data on Matlab, but reading the terms of service for the Google API, I believe I would be limited to using the data within Google Maps itself.
Please could you suggest a solution for me?
After reading all the Terms and Conditions for Google's elevation API, I believe you would be fine in using it for PERSONAL use in Metlab.
However, if you intend to publish the results or anything derived from the data, you will need to include a google map with it... but that could be in the form of a link to a map with just the 200x200 points plotted - a fifteen minute job to knock up ;)
Go for it :)

how can i get distance bettween two place?

hello i want distance between two place ... means i have two places latitude and longitude then i want distance between that two place
i want something like this...
http://maps.google.com/maps?saddr=23.029772,72.527871&daddr=23.1901748,72.0127743
not like php or .net or java function that give calculate distance ...
if i search result by function it give me 55.61 output for this latitude and logitude and in map it give me 65.5 output. how can i get this in json ot xml or any other formate ?
...there's an in-built function in iOS that will do this for you. Check out the CLLocation documentation. Particularly distanceFromLocation:, which as the name suggests returns the difference between two locations in meters. You can create a CLLocation object using lat and lon.
If you don't want a straight line distance, you need to use the Google Directions API, which is well documented here: http://code.google.com/apis/maps/documentation/directions/

MKMapKit true distance between two annotations

I want to make a application that calculates the distance between the user's current location and the nearest something (store, whatnot). Is there any way to obtain the real distance (following public roads ) instead of a direct distance (line from point A to B) ??
Thank you
Use google API to get the route and distance:
http://code.google.com/apis/maps/documentation/directions/
I don't think you can get the route (following roads) from MKMapKit.
The google maps API will return the route (following roads) as a set of latitude and longitude coordinates. It will also return the calculated distance.

Why does a pin placed at the same latitude and longitude in MKMapView differ from one in Google Maps?

I drop a pin in an MKMapView with longitude and latitude. When I place same longitude and latitude on google map the pin on both are slightly different.
I have a web/iPhone app that renders a map for positions sourced from the same database and haven't seen this issue. I would check your assumptions:
Are you truncating your values over the wire?
Are you rounding the position values differently on the two platforms?
Check the values you are passing into Google Maps and MapKit by logging them and comparing.
You can see from the following screenshots that the same latitude/longitude are rendered on the same position on the map:
Update
I tried the coordinates you mentioned in the comments and got the same position for both. You need to check your assumptions. The values that you are using on the web or on the device are not the values you think they are: