var oMarkers = new Object; //var aMarkers = []; //var aMarkerHtml = []; //var iMarkerIndex = 0; var oMap; var LastInfoBox; var iCurrentRegionId = 5; var iCurrentCatId = 0; var sIconBase = '/imagebank/map_icons'; var oIconMap = new Object; var oRegionLocations = new Object; var sLinkBase = 'http://www.virtualnorthwest.org.uk/imagebank/imagedetail'; var sThumbImgBase = 'http://www.virtualnorthwest.org.uk/imagebank-images'; oIconMap.cat6 = "icon-bridges-buildings.png";oIconMap.cat30 = "icon-gardens-flowers.png";oIconMap.cat22 = "icon-scenery-nature.png";oIconMap.cat17 = "icon-leisure.png";oIconMap.cat4 = "icon-people.png";oIconMap.cat9 = "icon-science.png";oIconMap.cat14 = "icon-transport.png"; oRegionLocations.region5 = new Array(53.18299586008718000000, -2.80700683593750000000);oRegionLocations.region1 = new Array(54.43650500000000000000, -3.09402500000000000000);oRegionLocations.region3 = new Array(53.46352600000000000000, -2.22473144531250000000);oRegionLocations.region2 = new Array(53.96335700000000000000, -2.55706800000000000000);oRegionLocations.region4 = new Array(53.45616700000000000000, -2.78503400000000000000);oRegionLocations.region6 = new Array(0.00000000000000000000, 0.00000000000000000000); function InitMap() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("googlemap-container")); map.setCenter(new GLatLng(53.343173, -2.441711), 9); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); oMap = map; GetImages(5, 0); //GetImages(0, 0); } } function InitMiniMap(iMapInitLong, iMapInitLat, iCatId) { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("google-mini-map")); map.setCenter(new GLatLng(iMapInitLat, iMapInitLong), 12); var icon = new GIcon(); icon.image = sIconBase + '/' + oIconMap['cat'+iCatId]; icon.iconSize = new GSize(21, 21); icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(5, 1); var marker = new GMarker(new GLatLng(iMapInitLat, iMapInitLong), icon); map.addOverlay(marker); } } function PanToLocation(lat, lng) { oMap.panTo(new GLatLng(parseFloat(lat), parseFloat(lng))); } function ChangeLocation(iRegionId) { //iCurrentRegionId = iRegionId; //oMap.clearOverlays(); //GetImages(iCurrentRegionId, iCurrentCatId); PanToLocation(oRegionLocations['region'+iRegionId][0], oRegionLocations['region'+iRegionId][1]); } function ChangeCat(iCatId) { document.getElementById('mapkey'+iCurrentCatId).className = document.getElementById('mapkey'+iCurrentCatId).className.replace(/active/, "inactive"); iCurrentCatId = iCatId; oMap.clearOverlays(); GetImages(iCurrentRegionId, iCurrentCatId); document.getElementById('mapkey'+iCurrentCatId).className = document.getElementById('mapkey'+iCurrentCatId).className.replace(/inactive/, "active"); } function GetImages(iRegionId, iCatId) { //alert("/imagebank/services/GetImages.xml.php?iRegionId="+iRegionId+"&iCatId="+iCatId); GDownloadUrl("/imagebank/map/GetImages.xml.php?iRegionId="+iRegionId+"&iCatId="+iCatId, function(data, responseCode) { var xml = GXml.parse(data); var results = document.getElementById('results'); try { if (xml.documentElement == null) throw "Error obtaining XML"; var images = xml.documentElement.getElementsByTagName("image"); if (images == null) throw "Error obtaining XML"; if (images == null || images.length == 0) throw "No Results"; //clear previous if any oMarkers = new Object; //aMarkerHtml = []; //iMarkerIndex = 0; for (var i = 0; i < images.length; i++) { //if (i > 3) break; var point = new GLatLng( parseFloat(images[i].getAttribute("lat")), parseFloat(images[i].getAttribute("lng")) ); oMarkerData = new MarkerData(images[i].getAttribute("image_id"), images[i].getAttribute("cat_id"), images[i].getAttribute("name"), images[i].getAttribute("thumb"), images[i].getAttribute("thumb_width"), images[i].getAttribute("thumb_height"), images[i].getAttribute("caption")); oMap.addOverlay(CreateMarker(point, oMarkerData)); //iMarkerIndex++; } } catch (e) { alert(e); return false; } } ); return true; } function CreateMarker(point, oMarkerData) { var icon = new GIcon(); //alert('here2'); //alert(iCatId); icon.image = sIconBase + '/' + oIconMap['cat'+oMarkerData.iCatId]; //icon.shadow = "/assets/shared/images/services/mm_20_shadow.png"; //if (sName == 'Jodrell Bank') alert(icon.image); icon.iconSize = new GSize(21, 21); icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(5, 1); var marker = new GMarker(point, icon); var sImgThumb = sThumbImgBase+"/"+oMarkerData.iImgId+"/thumb/"+oMarkerData.sThumb; var sHtml = "
"+oMarkerData.sName+"
"+oMarkerData.sName+"
test
";*/ //insertContent+= ""+this.oMarkerObj.oMarkerData.sName+"
"; /*insertContent+=""; insertContent+="";*/ return insertContent; } function GetImage(oMarkerData) { var sImgThumb = sThumbImgBase+"/"+oMarkerData.iImgId+"/thumb/"+oMarkerData.sThumb; sImgContent = "