var icone; var map; var Points = new Array; var Marqueurs = new Array; var bounds = new google.maps.LatLngBounds(); function initialize(strGeoloc) { var centreCarte = new google.maps.LatLng(48.4462549,0.11554956); var kmlorne = new google.maps.KmlLayer('http://www.normandy-tourism.co.uk/Portal_Upload/Files/kml/61.kml',{preserveViewport:true}); loisirs = new google.maps.MarkerImage( 'http://www.normandy-tourism.co.uk/portal_upload/googlemap/blue.png', new google.maps.Size(12, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20) ); var myOptions = { zoom:9, mapTypeId: google.maps.MapTypeId.ROADMAP, center: centreCarte }; map = new google.maps.Map(document.getElementById("gmap"), myOptions); kmlorne.setMap(map); console.log("chargement de la carte"); } function destroy(){if(map){map.destroy();}} function openGM(strGeoloc){ $("#gmap").show(); $("#gm_main #carte").html('
Close the map
').click(function(){closeGM();}).addClass("move"); initialize(strGeoloc); } function closeGM(){$('#gmap').hide();$("#gm_main #carte").removeClass("move").html('
See the card
').click(function(){openGM();});} function GoToPoint(strid){var pt = eval('marqueur' + strid);if (pt){map.setZoom(16);map.panTo(pt.getPosition());}} function gencarte(strid){ if(!map){openGM();setTimeout('GoToPoint("'+strid+'")',2000);} else {GoToPoint(strid)} openGM(strid); //GoToPoint(strid); } $(document).ready(function(){ if($("#gm_main").hasClass("load")){if(!map){$("#gmap").show();initialize('');}} });