To be more precise, what I try to accomplish is that while I Drag a Google Map there\'s a Google Maps Marker that stays fixed
A different approach, that did not use a real google.maps.Marker
:
after the map has been initialized, inject a div into the map-container, give it a className(e.g. centerMarker
), the further things will be done via CSS:
.centerMarker{
position:absolute;
/*url of the marker*/
background:url(http://maps.gstatic.com/mapfiles/markers2/marker.png) no-repeat;
/*center the marker*/
top:50%;left:50%;
z-index:1;
/*fix offset when needed*/
margin-left:-10px;
margin-top:-34px;
/*size of the image*/
height:34px;
width:20px;
cursor:pointer;
}
Demo: http://jsfiddle.net/doktormolle/jcHqt/