hello,
i am using following google map code, it shows two marker bcs i pass 2 address in hidden field.
List<string> addresses = new List<string>();
addresses.Add("Highcombe Cl, London SE9 4QH, UK");
addresses.Add("Chislehurst BR7 5QP, UK");
hfAddresses.Value = string.Join(":", addresses);
how can i add custom marker in like address 1 shows Point A and address 2 shows point Point B instead of orange pin
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&key=AIzaSyCEe5-E20uazeOIHsuQUOJKBM4-ZQ_ETEs"></script>
<script type="text/javascript">
window.onload = function () {
var addresses = document.getElementById("<%=hfAddresses.ClientID %>").value.split(':');
var mumbai = new google.maps.LatLng(18.9750, 72.8258);
var mapOptions = {
center: mumbai,
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true
};
var infoWindow = new google.maps.InfoWindow();
var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
var latlngbounds = new google.maps.LatLngBounds();
var markers = new Array();
for (i = 0; i < addresses.length; i++) {
var address = addresses[i];
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var Latlng = new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng());
var marker = new google.maps.Marker({
position: Latlng,
map: map,
title: results[0].formatted_address
});
markers.push(marker);
latlngbounds.extend(marker.position);
google.maps.event.addListener(marker, "click", function (e) {
infoWindow.setContent(marker.title);
infoWindow.open(map, marker);
});
if (markers.length == addresses.length) {
map.setCenter(latlngbounds.getCenter());
map.fitBounds(latlngbounds);
}
} else {
alert("Request failed.")
}
});
}
}
</script>
when google map load it shows two pin see the screen shot
https://snag.gy/rvmbw9.jpg
i want to replace this two pins with custom images
addresses.Add("Highcombe Cl, London SE9 4QH, UK"); this should have this image
<a href="http://www.cityvan.co.uk/wp-content/uploads/2017/10/84864C79-E08C-4BA6-9881-D41369CC353E.png">http://www.cityvan.co.uk/wp-content/uploads/2017/10/84864C79-E08C-4BA6-9881-D41369CC353E.png</a><a href="http://www.cityvan.co.uk/wp-content/uploads/2017/10/84864C79-E08C-4BA6-9881-D41369CC353E.png" target="blank"></a>
addresses.Add("Chislehurst BR7 5QP, UK"); this should show this image instead of red pin
<a href="http://www.cityvan.co.uk/wp-content/uploads/2017/10/DC315521-78CE-492A-BB3A-E158B98FE1D9.png" target="blank">http://www.cityvan.co.uk/wp-content/uploads/2017/10/DC315521-78CE-492A-BB3A-E158B98FE1D9.png</a>