I try to print on google map(v3) multiply markers. I'm using clusters and blue markers for the general records. And red markers for the stores position. My code is as following:
function initialize(){
//some code here
//....
//....
var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
var markers = [];
for (var i = 0; i < <?= $total_records ?>; i++) {
var latLng = new google.maps.LatLng(geo_data.records[i].lat, geo_data.records[i].lng);
var marker = new google.maps.Marker({
position: latLng,
draggable: true,
icon: markerImage
});
markers.push(marker);
}
var imageUrl2 = 'http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=AAAAA,008CFF,000000&ext=.png';
var markerImage2 = new google.maps.MarkerImage(imageUrl2,new google.maps.Size(24, 32));
for (var i = 0; i < <?= $store_records ?>; i++) {
var latLng = new google.maps.LatLng(store_data.storeRecords[i].lat, store_data.storeRecords[i].lng);
var marker = new google.maps.Marker({
position: latLng,
draggable: true,
icon: markerImage2
});
markers.push(marker);
}
var zoom = 14;
var size = 60;
var markerClusterer = new MarkerClusterer(map, markers, {
maxZoom: zoom,
gridSize: size
});
}
However now I take two wired errors:
Uncaught SyntaxError: Unexpected identifier jquery-1.5.1.min.js:16
Uncaught ReferenceError: initialize is not defined
I think that the problem is that I can't use the function the Marker class twice but I'm not sure. Can anyone tell me how can I solve this problem?