I'm working with a template that has a nice embeded Google map with coordinate set in javascript. This is the code for that one marker;
//Google Map
var latlng = new google.maps.LatLng(44.761128,21.227395);
var settings = {
zoom: 5,
center: new google.maps.LatLng(44.761128,21.227395), mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
scrollwheel: false,
draggable: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: false,
navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
mapTypeId: google.maps.MapTypeId.ROADMAP};
var map = new google.maps.Map(document.getElementById("map_canvas"), settings);
google.maps.event.addDomListener(window, "resize", function() {
var center = map.getCenter();
google.maps.event.trigger(map, "resize");
map.setCenter(center);
});
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h3 id="firstHeading" class="firstHeading">TITLE</h3>'+
'<div id="bodyContent">'+
'<p>Here we are.</p>'+
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var companyImage = new google.maps.MarkerImage('images/marker.png',
new google.maps.Size(58,63),<!-- Width and height of the marker -->
new google.maps.Point(0,0),
new google.maps.Point(35,20)<!-- Position of the marker -->
);
var companyPos = new google.maps.LatLng(44.761128,21.227395);
var companyMarker = new google.maps.Marker({
position: companyPos,
map: map,
icon: companyImage,
title:"Creative News",
zIndex: 3});
google.maps.event.addListener(companyMarker, 'click', function() {
infowindow.open(map,companyMarker);
});
});
I wish to add few more markers on this same map because of multiple locations. Can anyone tell me how do I go about doing that?