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