如何在我的网页上使用谷歌地图集成位置搜索?

时间:2021-12-02 10:11:46

I currently have Google Maps integrated into my webpage. It is being used to tell the user where an event is (generally, it's a user submitted event). The previous programmer put it the functionality to center the map on a latitude and longitude, if you knew it. However, most people don't know the latitude and longitude of locations (sometimes they do but...), and the users want to be able to enter just a street address like you do when you go to maps.google.com. How can I get it to do this?

我目前已将Google地图集成到我的网页中。它用于告诉用户事件的位置(通常是用户提交的事件)。如果你知道的话,之前的程序员会把它的功能放在纬度和经度上。但是,大多数人不知道位置的纬度和经度(有时他们会这样做但是......),并且用户希望能够像去往maps.google.com时那样只输入街道地址。我怎么能这样做呢?

2 个解决方案

#1


With the Google Maps Geocoding API.

使用Google Maps Geocoding API。

#2


It's called Geocoding and Google exposes public Geocoding services.

它被称为地理编码,Google公开了公共地理编码服务。

Here's a link to the Google Geocoding Developer service
Here's a link to Yahoo's Geocoding API.

这是Google Geocoding Developer服务的链接。这是Yahoo的Geocoding API的链接。

Read the docs. You'll send the address and receive back the Latitude and Longitude.

阅读文档。您将发送地址并收回纬度和经度。

#1


With the Google Maps Geocoding API.

使用Google Maps Geocoding API。

#2


It's called Geocoding and Google exposes public Geocoding services.

它被称为地理编码,Google公开了公共地理编码服务。

Here's a link to the Google Geocoding Developer service
Here's a link to Yahoo's Geocoding API.

这是Google Geocoding Developer服务的链接。这是Yahoo的Geocoding API的链接。

Read the docs. You'll send the address and receive back the Latitude and Longitude.

阅读文档。您将发送地址并收回纬度和经度。