regex - 谷歌地图的地址格式

标签 regex google-maps

我正在尝试做一些东西来解析可能地址的文本并将它们转换为谷歌地图链接。谷歌地图将接受作为查询的最通用地址格式是否有任何引用?似乎是他们想要公开的东西,但我在文档中找不到任何东西。

最佳答案

你应该看看Google Static Maps API .

Addresses

Most people don't speak in latitudes and longitudes; they denote locations using addresses. The process of turning an address into a geographic point is known as geocoding and the Static Maps service can perform geocoding for you if you provide valid addresses.

In any parameter where you may provide a latitude/longitude, you may instead specify a string indicating an address. Google will geocode the address and provide the Static Map service with a latitude/longitude value to use in placing markers or specifying locations. The string should be URL-escaped, so addresses such as "City Hall, New York, NY" should be converted to "City+Hall,New+York,NY", for example.

Note that addresses may reflect either precise locations, such as street addresses, polylines such as named routes, or polygonal areas such as cities, countries, or national parks. For polylinear and polygonal results, the Static Map server will use the center point of the line/area as the address center. If you have doubt about how an address may geocode, you can test out the address using this Geocoding Utility.

The following example generates a static map for Berkeley, CA:

http://maps.google.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&sensor=false


资源:
  • Google Static Maps API - Addresses
  • 关于regex - 谷歌地图的地址格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3647582/

    相关文章:

    java - 将 List<> 传递给片段

    android - 当用户在 Google Maps v2 for Android API 上按下“我的位置中心”按钮时如何收到通知

    javascript - 多个 Google map 无法与 Bootstrap 3 选项卡配合使用

    javascript - 未捕获类型错误 : n is not a function d3. js。尝试在谷歌地图上覆盖 us_map 时

    regex - R-使用通配符替换字符串的一部分

    java - 通过模式组织文本的最佳方式?

    regex - unix下隐藏文件的正则表达式

    Python - 使用正则表达式解析 apache 配置

    java - 如何在管道分隔文件中找到未被管道包围的字符串?

    javascript - Google Maps API - 使用 "search nearby"功能?