Google map custom marker with css rounded corner -
i have managed use , apply own marker on google map below.
var marker = new google.maps.marker({ position: point, map: map, icon: picon, optimized:false });
i add round corner background below css
#orangeicon { width: 50px; height: 50px; overflow: hidden; border-top-left-radius:5px 5px; border-top-right-radius:5px 5px; border-bottom-left-radius:5px 5px; border-bottom-right-radius:5px 5px; -moz-box-shadow: 0 1px 3px #ffbf00; -webkit-box-shadow: 0 1px 3px #ffbf00; background-color: #ffbf00; position: relative; border: 5px solid #ffbf00; }
how achieve google map ?
as of version 3.17, google.maps.marker objects exists in markerlayer
pane fancy name div.
to reference markerlayer need create overlayview object. now, object bit abstract. need implement draw function work. example, open basic example in new tab , paste console
var overlay = new google.maps.overlayview(); overlay.draw=function() {}; overlay.setmap(map); overlay.getpanes();
it returns:
{ floatpane: div floatshadow: div mappane: div markerlayer: div overlayimage: div overlaylayer: div overlaymousetarget: div overlayshadow: div }
thay markerlayer div contains markers. if create marker using given icon image,
var marker = new google.maps.marker({ position: map.getcenter(), map: map, icon: 'http://ruralshores.com/assets/marker-icon.png', optimized:false });
my markerlayer be:
where selected div (the 1 z-index 103) markerlayer.
if wanted access markerlayer programatically, add "markerlayer" class after getting reference getpanes
method. guess every image inside markerlayer marker, style @ will.
tl/dr : can style it, provided went through trouble of finding dom reference marker.
edit: i made bl.ocks check
Comments
Post a Comment