var gwp_infoWnd=null;var gwp_map=null;var gwp_panorama=null;var gwp_streetClient=null;var gwp_markerArray=new Array();var gwp_strMapFailMsg="";var gwp_strStreetVFailMsg="";function wpGMapLoad(map_div,dLat,dLong,nZoom,nMapType,nMapCtrl,nNavCtrl,nStreetCtrl,nScroll,nNumMarkers,markerArray,strMapFailMsg,strStreetFailMsg){try{gwp_strMapFailMsg=strMapFailMsg;gwp_strStreetVFailMsg="<span style='font-family:Arial,sans-serif; font-size:12.0px; line-height:1.15em;'>"+strStreetFailMsg+"</span>";var mapDiv=document.getElementById(map_div);var dMapLatitude=wpGMapIfNullRtn(dLat,51.478);var dMapLongitude=wpGMapIfNullRtn(dLong,0);var ptMapCenter=new google.maps.LatLng(dMapLatitude,dMapLongitude);var nMapZoom=wpGMapIfNullRtn(nZoom,15);var bMapScrollWheel=(nScroll>0);var bMapStreetViewCtrl=(nStreetCtrl>0);var nMapTypeID=google.maps.MapTypeId.ROADMAP;switch(nMapType){case 1:nMapTypeID=google.maps.MapTypeId.SATELLITE;break;case 2:nMapTypeID=google.maps.MapTypeId.HYBRID;break;case 3:nMapTypeID=google.maps.MapTypeId.TERRAIN;break};var nMapTypeCtrl=google.maps.MapTypeControlStyle.HORIZONTAL_BAR;var bMapTypeCtrl=false;switch(nMapCtrl){case 1:nMapTypeCtrl=google.maps.MapTypeControlStyle.HORIZONTAL_BAR;bMapTypeCtrl=true;break;case 2:nMapTypeCtrl=google.maps.MapTypeControlStyle.DROPDOWN_MENU;bMapTypeCtrl=true;break};var nNavTypeCtrl=google.maps.NavigationControlStyle.ZOOM_PAN;var bNavTypeCtrl=false;switch(nNavCtrl){case 1:nNavTypeCtrl=google.maps.NavigationControlStyle.ZOOM_PAN;bNavTypeCtrl=true;break;case 2:nNavTypeCtrl=google.maps.NavigationControlStyle.SMALL;bNavTypeCtrl=true;break};var mapOptions={zoom:nMapZoom,center:ptMapCenter,mapTypeId:nMapTypeID,scrollwheel:bMapScrollWheel,streetViewControl:bMapStreetViewCtrl,mapTypeControl:bMapTypeCtrl,mapTypeControlOptions:{style:nMapTypeCtrl},navigationControl:bNavTypeCtrl,navigationControlOptions:{style:nNavTypeCtrl},draggableCursor:'default',draggingCursor:'pointer'};gwp_map=new google.maps.Map(mapDiv,mapOptions);gwp_streetClient=new google.maps.StreetViewService();gwp_panorama=new google.maps.StreetViewPanorama(mapDiv,{enableCloseButton:true,visible:false,scrollwheel:bMapScrollWheel});gwp_map.setStreetView(gwp_panorama);gwp_infoWnd=new google.maps.InfoWindow({});if(nNumMarkers>0&&markerArray!=null){for(var i=0;i<nNumMarkers;++i){var marker=new google.maps.Marker({position:markerArray[i].ptPos,map:gwp_map,title:markerArray[i].strName});marker.dLat=markerArray[i].dLat;marker.dLong=markerArray[i].dLong;marker.ptPos=markerArray[i].ptPos;marker.bLabel=markerArray[i].bLabel;marker.strName=markerArray[i].strName;marker.strLabel=markerArray[i].strLabel;marker.nDir=markerArray[i].nDir;marker.nPitch=markerArray[i].nPitch;marker.nZoom=markerArray[i].nZoom;marker.oMap=gwp_map;marker.oPanorama=gwp_panorama;marker.oInfoWnd=gwp_infoWnd;if(marker.bLabel)google.maps.event.addListener(marker,'click',wpGMapShowInfoWnd);else google.maps.event.addListener(marker,'click',wpGMapShowStreetView);gwp_markerArray[marker.strName]=marker}}}catch(e){alert(gwp_strMapFailMsg)}};function wpGMapIfNullRtn(newVal,defaultVal){if(newVal==null)return defaultVal;return newVal};function wpGMapShowInfoWnd(){var marker=gwp_markerArray[this.strName];if(!this.strLabel.length){gwp_infoWnd.close()}else{marker.oInfoWnd.setContent(this.strLabel);marker.oInfoWnd.open(marker.oMap,this);gwp_infoWnd=marker.oInfoWnd}}function wpGMapShowStreetView(){gwp_infoWnd.close();var marker=gwp_markerArray[this.strName];gwp_streetClient.getPanoramaByLocation(this.ptPos,50,function(result,status){if(status==google.maps.StreetViewStatus.OK){marker.oPanorama.setPosition(result.location.latLng);var xPov={heading:marker.nDir,pitch:marker.nPitch,zoom:marker.nZoom};marker.oPanorama.setPov(xPov);marker.oPanorama.setVisible(true)}else{marker.oPanorama.setVisible(false);gwp_infoWnd.setPosition(marker.ptPos);gwp_infoWnd.setContent(gwp_strStreetVFailMsg);gwp_infoWnd.open(marker.oMap)}})}function wpGMapMarker(dLat,dLong,nLabel,strName,strLabel,nDir,nPitch,nZoom){try{this.dLat=dLat;this.dLong=dLong;this.ptPos=new google.maps.LatLng(dLat,dLong);this.bLabel=(nLabel<2);this.strName=strName;this.nDir=parseInt(nDir);this.nPitch=parseInt(nPitch);this.nZoom=parseInt(nZoom);this.strLabel="";if(this.bLabel&&strLabel.length){if(nLabel<1)this.strLabel="<span style='font-family:Arial,sans-serif; font-size:12.0px; line-height:1.15em;'>"+strLabel+"</span>";else this.strLabel=strLabel}}catch(e){}}
