在Google地图上显示OpenStreetMap边界(使用v3 API)

相关问题:您需要获取从Open Street Maps检索到的数据,并将其放入GeoJson解析器期望的Feature/FeatureCollection JSON中的位置:

You need to take the data you retrieve from Open Street Maps and put it into the place in the Feature/FeatureCollection JSON that the GeoJson parser is expecting:

var geoJson = {
  "type": "FeatureCollection",
  "features": [{
    "type": "Feature",
    "geometry": {},
    "properties": {}
  }];
// where "geoJsonData" is the data you retrieved
geoJson.features[0].geometry = geoJsonData;

示例小提琴(带有来自发布链接的数据)