/************************************************* * Created with GoogleMapAPI3.0beta * Author: Brad Wedell * Link http://code.google.com/p/phpgooglemapapiv3/ * Copyright 2010 Brad Wedell * Original Author: Monte Ohrt * Original Copyright 2005-2006 New Digital Group * Originial Link http://www.phpinsider.com/php/code/GoogleMapAPI/ *************************************************/ var markerClusterermap_recherche=null;var to_htmlsmap_recherche=[];var from_htmlsmap_recherche=[];var iconmap_recherche=[];iconmap_recherche['httpswwwgitedegroupefrimglogo_carte_23png']={};iconmap_recherche['httpswwwgitedegroupefrimglogo_carte_23png'].image=new google.maps.MarkerImage('https://www.gitedegroupe.fr/img/logo_carte_23.png',new google.maps.Size(22,25),new google.maps.Point(0,0),new google.maps.Point(11,12));var mapmap_recherche=null;function onLoadmap_recherche(){var mapObjmap_recherche=document.getElementById("map_recherche");if(mapObjmap_recherche!='undefined'&&mapObjmap_recherche!=null){var mapOptionsmap_recherche={scrollwheel:false,zoom:10,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:true,mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DEFAULT}};mapmap_recherche=new google.maps.Map(mapObjmap_recherche,mapOptionsmap_recherche);markerClusterermap_recherche=new MarkerClusterer(mapmap_recherche,markersmap_recherche,{maxZoom:null,gridSize:30,styles:null});}} function isArray(a){return isObject(a)&&a.constructor==Array;} function isObject(a){return(a&&typeof a=='object')||isFunction(a);} function isFunction(a){return typeof a=='function';} function isEmpty(obj){for(var i in obj){return false;}return true;} window.initmap = false; window.onLoadmap = onLoadmap_recherche; $(document).ready(function() { window.$map = $("#map_recherche"); // onglets bootstrap var tab = $('a[data-toggle="tab"]'); if(tab.length) tab.on('shown.bs.tab', function (e) { if(!window.initmap) window.onLoadmap(); window.initmap = true; }); else onLoadmap_recherche(); google.maps.event.addDomListener(window, "resize", function() { google.maps.event.trigger($map[0], "resize"); }); }); $(function() { /* attach a submit handler to the form */ $("#searchForm").submit(function(event) { /* stop form from submitting normally */ event.preventDefault(); /* get some values from elements on the page: */ var $form = $( this ); /* Send the data using post and put the results in a div */ $.post( "recherche_results.php", $form.serialize(), function( data ) { var content = $( data ); $( "#results" ).fadeOut('slow').empty().append( content ).fadeIn("slow"); } ); /* Send the data using post and put the results in a div */ $.post( "recherche_map.php", $form.serialize(), function( data ) { $( "#map" ).fadeOut('slow').empty().append( '
' ).fadeIn("slow"); var content = $( data ); eval(content.text()); window.$map = $("#map_recherche"); window.onLoadmap = onLoadmap_recherche; if($map.is(":visible")) onLoadmap_recherche(); else window.initmap = false; } ); $("#various3").attr('href','map.php?'+$("#searchForm").serialize()); }); });