/** * ----------------------------------------------------------------------------- * file: gmapsPicture.js * file version: 1.1.0 * date: 2010-10-20 */ var viewportInitialized = { icon:false, meta:false }; var markerImgProp = [ null, { w:32, h:32, x:15, y:31 }, // s01 { w:32, h:32, x:15, y:31 }, // s02 { w:32, h:32, x:10, y:31 }, // s03 { w:30, h:40, x:4, y:39 }, // s04 ]; function applyMap(properties) { var latlng=new google.maps.LatLng(gmaps.coords.latitude, gmaps.coords.longitude), map = new google.maps.Map($("#"+properties.id).get(0), { mapTypeId: properties.mapType, zoom: properties.zoomLevel, center:latlng, navigationControl: (properties.navigationControl==-1)?false:true, scrollwheel: (properties.navigationControl==-1)?false:true, scaleControl: (properties.scaleControl=='n')?false:true, streetViewControl: (properties.streetViewControl=='n')?false:true, mapTypeControl:(properties.mapTypeControl==-1)?false:true, mapTypeControlOptions: { style:properties.mapTypeControl }, markerTitle:'', } ), marker = new google.maps.Marker( { position:latlng, map: map, title:properties.markerTitle } ); re=/^mS(\d\d)_.*/i; iM=re.exec(properties.markerImg); if(iM!=null) iM=new Number(iM[1]); if(iM!=null) { var markerImg = new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg, new google.maps.Size(markerImgProp[iM].w, markerImgProp[iM].h), new google.maps.Point(0,0), new google.maps.Point(markerImgProp[iM].x, markerImgProp[iM].y)); marker.setIcon(markerImg); } if(properties.kmlFileUrl!='') { kmlFile = new google.maps.KmlLayer(properties.kmlFileUrl, { preserveViewport:true } ); } else { kmlFile=null; } map.kmlFile=kmlFile; properties.gMap=map; properties.gMapCenter=latlng; } $(window).load(function () { gmaps.currentMapLoadIndex=-1; for(i=0;i>> */ if($('#iGMapContent').length>0) { tabId=$('#iGMapContent').get(0).parentNode.parentNode.id; tabId='tab'+tabId.toUpperCase().substring(0,1)+tabId.substr(1); $("#"+tabId+" a").bind('click', function () { if(viewportInitialized.meta==false) { for(i=0;i0) { $('#iGMapsIconContent').dialog( { autoOpen:false, width:'auto', height:'auto', modal: true, closeText:'X', dialogClass: 'gmapsPopup', title: gmaps.maps[gmaps.currentMapLoadIndex].title, open: function () { if(viewportInitialized.icon==false && gmaps.currentMapLoadIndex!=-1) { google.maps.event.trigger(gmaps.maps[gmaps.currentMapLoadIndex].gMap, 'resize'); gmaps.maps[gmaps.currentMapLoadIndex].gMap.setCenter(gmaps.maps[gmaps.currentMapLoadIndex].gMapCenter); $('#iGMapsIcon span, #iGMapsIcon a').css('font-size', '55.0%'); if(gmaps.maps[gmaps.currentMapLoadIndex].gMap.kmlFile!=null) gmaps.maps[gmaps.currentMapLoadIndex].gMap.kmlFile.setMap(gmaps.maps[gmaps.currentMapLoadIndex].gMap); viewportInitialized.icon=true; } google.maps.event.addListener( gmaps.maps[gmaps.currentMapLoadIndex].gMap, 'dragend', function() { $('#gmapsCenterMap').css('display', 'inline'); $('#gmapsBoundKml').css('display', 'inline'); } ); google.maps.event.addListener( gmaps.maps[gmaps.currentMapLoadIndex].gMap, 'zoom_changed', function() { $('#gmapsCenterMap').css('display', 'inline'); $('#gmapsBoundKml').css('display', 'inline'); } ); } } ); $('div.gmapsPopup div.ui-dialog-titlebar') .append(''); $('#gmapsCenterMap').attr('title', gmaps.lang.centermap); if(gmaps.maps[gmaps.currentMapLoadIndex].gMap.kmlFile!=null) { $('div.gmapsPopup div.ui-dialog-titlebar') .append(''+ ''); $('#gmapsBoundKml').attr('title', gmaps.lang.boundkml); } } } );