1
我想在每个多边形上设置样式,特别是填充颜色。 我知道我能做到这一点:谷歌地图GeoJson造型
map.data.loadGeoJson('http://localhost:8080/my.json');
map.data.setStyle({
fillColor: 'red'
});
但我想设置单独填补多边形的颜色。我尝试以下this answer on GIS Stack设置,但它不工作:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-80.4545,
43.5061
]
]
]
},
"style":{
"fill":"red",
"stroke-weight": "1",
"stroke-width":"3",
"fill-opacity":"0.6"
}
}
]
}
我希望它可以设置个人多边形的造型,而不是整个数据。
这帮助我,谢谢。 – mapr 2015-03-26 21:10:14