Markers not displaying
Hi,
I am having the problem with no marker showing on my map.
I am in a local environment at the moment and my map looks fine apart from the fact there is no marker showing.
I have copied the images locally and refer to them in my code to see if that made any difference but so far no joy.
My created js file reads as below:
function wagt_map_2() {
if(GBrowserIsCompatible()) {
if(!document.getElementById('wagt_map_2')) return false;
var map = new GMap2(document.getElementById('wagt_map_2'));
map.enableContinuousZoom();
map.enableDoubleClickZoom();
map.addControl(new GSmallZoomControl());
var geocoder = new GClientGeocoder();
var icon = new GIcon();
var markerStyle = 'Flag';
var markerColor = 'Pacifica';
icon.image = '_img/pacifica.png';
icon.shadow = '../_img/shadow.png';
icon.iconSize = new GSize(31,35);
icon.shadowSize = new GSize(31,35);
icon.iconAnchor = new GPoint(4,27);
icon.infoWindowAnchor = new GPoint(8,3);
icon.printImage = '_img/pacifica.gif';
icon.mozPrintImage = '_img/pacifica_mozprint.png';
icon.printShadow = '../_img/shadow.gif';
icon.transparent = '../_img/pacifica_transparent.png';
var address_0 = {
street: 'XXXX',
city: 'XXXXX',
state: 'XXXX',
zip: 'CH5 2UA',
country: 'United Kingdom',
infowindow: 'default',
infowindowtext: '<span style="font: 12px Verdana, Arial, Helvetica, sans-serif; color: #000;"><strong>Address:</strong><br />CH52UA United Kingdom</span>',
full: 'CH52UA, United Kingdom',
isdefault: true
};
geocoder.getLatLng (
address_0.full,
function(point) {
if(point) {
map.setCenter(point, 13);
var marker = new GMarker(point, icon);
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(address_0.infowindowtext );
});
map.addOverlay(marker);
marker.openInfoWindowHtml(address_0.infowindowtext );
}
else {
map.setCenter(new GLatLng(53.23486238365943, -3.022785186767578), 13);
}
}
);
}
}