I would like to add 2 circles(red and green) instead of the default marker on the google maps. I need the color of the circles to change(increase/decrease of intensity) based on the values in the database. Is it possible to do so?
Create a circle as a marker icon, for example:
var oMarker = new google.maps.Marker({
position: latLng,
sName: "Marker Name",
map: map,
icon: {
path: google.maps.SymbolPath.CIRCLE,
scale: 8.5,
fillColor: "#F00",
fillOpacity: 0.4,
strokeWeight: 0.4
},
});
and then, if you want to change the marker dynamically (like on mouseover), you can, for example:
oMarker.setIcon({
path: google.maps.SymbolPath.CIRCLE,
scale: 10,
fillColor: "#0F0",
fillOpacity: 0.8,
strokeWeight: 1
})
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加