I want to put labels with information (or a div with a label) on polygons which are drawn by the below code fragment. Style attributes were applied successfully to the features (of type Polygon). Does anybody know how add text to this features which will be shown on the centre of the polygons?
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);
}