Hi I am using richmarker for custom image markers on google map in ASP.net MVC web app.
It’s working fine for normal markers. But I have some scenarios in which there are two markers at same location . Using default marker I am handling this by using Roadside LHS or RHS and specifying different anchors for LHS and RHS.And it works fine. But for rich marker, how to specify anchor so that I can see 2 separate LHS and RHS customized marker?
This is my code for rich marker.
var marker = new RichMarker({
position: myLatlng,
label: data.RoadSide,
map: map,
title: data.title,
content: '' +
'<div class="customMarker"style="float:left"><img class="" src="' + image+ '"/></div>'
});
Default marker for LHS and RHS:
if (data.RoadSide == 'LHS') {
var marker = new google.maps.Marker({
position: myLatlng,
label: data.RoadSide,
map: map,
title: data.title,
icon: {
url: 'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
size: new google.maps.Size(39, 40),
scaledSize: new google.maps.Size(39, 40),
anchor: new google.maps.Point(15, 0),
labelOrigin: new google.maps.Point(-20, 20)
}
});
}
else {
var marker = new google.maps.Marker({
position: myLatlng,
label: data.RoadSide,
map: map,
title: data.title,
icon: {
url: 'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
size: new google.maps.Size(39, 40),
scaledSize: new google.maps.Size(39, 40),
anchor: new google.maps.Point(-20, 0),
labelOrigin: new google.maps.Point(60, 20)
}
});
}