Google Maps API - Getting Street Coordinates

后端 未结 3 2001
Happy的楠姐
Happy的楠姐 2020-11-30 07:48

Google Maps API has any way to get the street coordinates of an location?

Is simple: I just want to get the nearest street coordinate. To got this i nee

3条回答
  •  情深已故
    2020-11-30 08:42

    These answers are all old, and Google has rearranged the maps API significantly since the answers. In 2018, the best way to turn a location (long, lat) into a "point on road," is to use the snap-to-road or nearest-road service: https://developers.google.com/maps/documentation/roads/snap

    Note that this API charges a cent per API call, and can take up to 100 distinct points per call. If latency and complexity aren't problems, if you need to answer this question on a client, you could build a server that collects up to 100 requests from different clients, makes one request to Google, and then returns the request data back to the appropriate clients. (For this use, make sure to use nearest-road, not snap-to-road.)

    Also, currently, Google Maps has a $200 per-month statement credit available, which may make smaller uses of this API not actually end up costing much (or anything at all.)

提交回复
热议问题