4
我想在由以下代码片段绘制的多边形上放置带有信息(或带有标签的div)的标签。样式属性已成功应用于特征(类型为Polygon)。有人知道如何将文字添加到这些要显示在多边形中心的特征吗?在Google地图上放置GeoJson数据的多边形标签
function handleGeoJson(data) {
map.data.addGeoJson(data);
map.data.setStyle(function(feature) {
if (feature.getProperty('isColorful')) {
color = feature.getProperty('color');
}
return /** @type {google.maps.Data.StyleOptions} */({
fillColor : color,
strokeColor : color,
strokeWeight : 1,
});
});
map.data.setStyle(featureStyle);
}
相关问题[Google Maps JavaScript API v3 Map Label and Polygons](http://stackoverflow.com/questions/12714031/google-maps-javascript-api-v3-map-label-and-polygons/12716168#12716168 ) – geocodezip 2014-09-19 12:33:30
相关问题[Google地图获取坐标中心](http://stackoverflow.com/questions/19956691/google-maps-get-the-center-of-coordinates/19957258#19957258) – geocodezip 2014-09-19 12:33:54