Answer the question
In order to leave comments, you need to log in
Round custom marker icon for Google Maps?
It is not possible to make a round icon-picture on Google maps. Icon in jpeg format, photo.
I'm already thinking about converting icons to png format for GM.
My icon is now formed by the following code:
var ic = { //icon
url: icon, // url
scaledSize: new google.maps.Size(30, 30), // scaled size
origin: new google.maps.Point(0,0), // origin
anchor: new google.maps.Point(0, 0), // anchor
//define the shape
//define the shape
shape:{coords:[17,17,18],type:'circle'},
//set optimized to false otherwise the marker will be rendered via canvas
//and is not accessible via CSS
optimized:false
};
var marker = new google.maps.Marker({
map: map, title: name , position: latlngset, icon: ic
});
Answer the question
In order to leave comments, you need to log in
Answer:
Initially, I made a mistake by trying to add a class to the icon, and not to the marker.
var ic = { //icon
url: icon, // url
scaledSize: new google.maps.Size(30, 30), // scaled size
origin: new google.maps.Point(0,0), // origin
anchor: new google.maps.Point(0, 0), // anchor
//define the shape
shape:{coords:[17,17,18],type:'circle'},
//set optimized to false otherwise the marker will be rendered via canvas
//and is not accessible via CSS
optimized:false,
};
var marker = new google.maps.Marker({
map: map, title: name , position: latlngset, icon: ic,
optimized: false
});
var myoverlay = new google.maps.OverlayView();
myoverlay.draw = function () {
this.getPanes().markerLayer.id='markerLayer';
};
myoverlay.setMap(map);
#markerLayer img {
border-radius:50%!important;
border: 0px solid black!important;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question