【发布时间】:2014-11-07 14:48:11
【问题描述】:
我在我的 Web 应用程序中有一个在地理上划分为社区的城市。我使用 geojson 文件描述为以下数组:
"type": "FeatureCollection",
"features": [
{
"geometry": {
"type": "Polygon",
"color" : "red",
"coordinates": [
[
[
2.38317,
48.867111
],
[
2.363713,
48.867554
],
[
2.364399,
48.867126
],
[
2.39839,
48.85133
],
[
2.39432,
48.856541
],
[
2.39223,
48.857571
],
[
2.38965,
48.85844
],
[
2.38746,
48.86282
],
[
2.38377,
48.86607
],
[
2.38317,
48.867111
]
]
]
},
"properties": {
"id" : "11",
"name": "11ème : arr",
"description": "this is 11",
"arr": "11e"
}
}, ...
我的目标是查看用户地址在我的多边形中的位置。我从HTML5 get my location 获取地址,或者通过在自动完成搜索栏中输入自己的地址,它返回 => google.maps.LatLng 对象。
知道 containsLocation 需要 LatLng 格式的多边形,如何探索淹没的多边形对象
【问题讨论】:
标签: javascript android google-maps google-maps-api-3