Google Map API从KML层反向地理编码

问题描述:

我在Google地图上有一个KML地图层,其中包含一个称为块"的管理单元的管理边界.每个块都有不同的ID.如果使用手机获取位置的经度和纬度,如何获取街区的ID?

I have a KML Map Layer on google map which contains the Administrative boundaries of an administrative unit called "BLOCKS".Each Block has different ID. How can i get the ID of the Block if i get the Longitude and Latitude of the Location using my mobile?

该信息当前无法通过KmlLayer访问.如果您将KML导入Fusion Tables,则可以查询该表并确定纬度/经度点位于哪个多边形中(使用ST_INTERSECT和一个较小的CIRCLE)

That information is not currently accessible with KmlLayer. If you import your KML into Fusion Tables, you can query the table and determine which polygon a Lat/Lng point is in (using ST_INTERSECT with a small CIRCLE)

另一种选择是使用第三方解析器,例如 geoxml3 ,但是如果您的KML很复杂,会带来性能问题.

Another option would be to use a third party parser like geoxml3, but if your KML is complex, that will have performance issues.