Buon giorno,

Uso questo codice per importare dati in una mappa di google.Il problema è che con questo script , per problemi che non ho ancora capito con alcuni script che uso nell'header contenuto in tutte le pagine, ho un conflitto con
<body onload="load()" onunload="GUnload()">
e ricaricando la pagina IEXPLORER mi da un errore =Impossibile aprire la pagina richiesta.

Nella altre pagine in cui uso google maps con script piu semplici, ho risolto sostituendo
<body onload="load()" onunload="GUnload()">
con alla fine dello script
window.onload = load;
window.onunload = GUnload;

ora , non riesco a modificare lo script in quanto manca la function load() {
e io non so dove inserirla .

Potete aiutarmi ?


<script type="text/javascript">
//<![CDATA[

if (GBrowserIsCompatible()) {
var gmarkers = [];
var gicons = [];

gicons["10019"] = new GIcon(G_DEFAULT_ICON,"images/attivita.png");
gicons["10018"] = new GIcon(G_DEFAULT_ICON,"images/immobili.png");
gicons["10025"] = new GIcon(G_DEFAULT_ICON,"images/motor.png");
gicons["10023"] = new GIcon(G_DEFAULT_ICON,"images/motor.png");

gicons["10019"].iconSize = new GSize(32, 32);
gicons["10025"].iconSize = new GSize(32, 32);
gicons.iconSize = new GSize(32, 32);
gicons.shadowSize = new GSize(56, 32);
gicons.iconAnchor = new GPoint(16, 32);
gicons.infoWindowAnchor = new GPoint(16, 0);



// A function to create the marker and set up the event window
function createMarker(point,name,html,category) {
var marker = new GMarker(point,gicons[category]);
// === Store the category and name info as a marker properties ===
marker.mycategory = category;
marker.myname = name;
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
gmarkers.push(marker);
return marker;
}

// == shows all markers of a particular category, and ensures the checkbox is checked ==
function show(category) {
for (var i=0; i<gmarkers.length; i++) {
if (gmarkers[i].mycategory == category) {
gmarkers[i].show();
}
}
// == check the checkbox ==
document.getElementById(category+"box").checked = true;
}

// == hides all markers of a particular category, and ensures the checkbox is cleared ==
function hide(category) {
for (var i=0; i<gmarkers.length; i++) {
if (gmarkers[i].mycategory == category) {
gmarkers[i].hide();
}
}
// == clear the checkbox ==
document.getElementById(category+"box").checked = false;
// == close the info window, in case its open on a marker that we just hid
map.closeInfoWindow();
}

// == a checkbox has been clicked ==
function boxclick(box,category) {
if (box.checked) {
show(category);
} else {
hide(category);
}
// == rebuild the side bar
makeSidebar();
}

function myclick(i) {
GEvent.trigger(gmarkers[i],"click");
}


// == rebuilds the sidebar to match the markers currently displayed ==
function makeSidebar() {
var html = "";
for (var i=0; i<gmarkers.length; i++) {
if (!gmarkers[i].isHidden()) {
html += '' + gmarkers[i].myname + '
';
}
}
document.getElementById("side_bar").innerHTML = html;
}


// create the map
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(41.91633, 12.482185), 5);


// Read the data
GDownloadUrl("rssfeed.asp", function(doc) {
var xmlDoc = GXml.parse(doc);
var markers = xmlDoc.documentElement.getElementsByTagName("marke r");

for (var i = 0; i < markers.length; i++) {
// obtain the attribues of each marker
var lat = parseFloat(markers[i].getAttribute("lat"));
var lng = parseFloat(markers[i].getAttribute("lng"));
var point = new GLatLng(lat,lng);
var address = markers[i].getAttribute("address");
var name = markers[i].getAttribute("name");
var label = markers[i].getAttribute("label");
var ind = markers[i].getAttribute("ind");
var html = ""+name+"

"+address+"

"+label+"

"+ind;
var category = markers[i].getAttribute("category");
// create the marker
var marker = createMarker(point,name,html,category,label);
map.addOverlay(marker);
}

// == show or hide the categories initially ==
show("10019");
hide("10018");
hide("10025");
hide("10023");
hide("10021");
hide("10031");
hide("10032");
hide("10022");
hide("10028");
hide("10017");
hide("10024");
hide("10020");
hide("10033");
hide("10030");
hide("10027");
hide("10029");
hide("10026");
// == create the initial sidebar ==
makeSidebar();
});
}

else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}

//]]>
</script>
</body>