function HideElements() { if($(document).find('#map .gm-style a').length > 0) { $(document).find('#map div div.gmnoprint').remove(); $(document).find('#map .gm-style-cc').remove(); //alert($(document).find('#map .gm-style > div').last().html()); $(document).find('#map .gm-style>div').last().remove(); $(document).find('#map .gm-style a').remove(); } else { setTimeout(HideElements, 100); } } function initializeMap() { zoom=14; var styles = [ { 'featureType': 'administrative', 'elementType': 'labels.text.fill', 'stylers': [ { 'color': '#444444' } ] }, { 'featureType': 'landscape', 'elementType': 'all', 'stylers': [ { 'color': '#f2f2f2' } ] }, { 'featureType': 'poi', 'elementType': 'all', 'stylers': [ { 'visibility': 'off' } ] }, { 'featureType': 'road', 'elementType': 'all', 'stylers': [ { 'saturation': -100 }, { 'lightness': 45 } ] }, { 'featureType': 'road', 'elementType': 'geometry.fill', 'stylers': [ { 'visibility': 'on' }, { 'color': '#cccccc' } ] }, { 'featureType': 'road', 'elementType': 'geometry.stroke', 'stylers': [ { 'visibility': 'off' } ] }, { 'featureType': 'road', 'elementType': 'labels.text', 'stylers': [ { 'color': '#656565' } ] }, { 'featureType': 'road', 'elementType': 'labels.text.fill', 'stylers': [ { 'color': '#0f0f0f' } ] }, { 'featureType': 'road', 'elementType': 'labels.text.stroke', 'stylers': [ { 'visibility': 'off' } ] }, { 'featureType': 'road.highway', 'elementType': 'all', 'stylers': [ { 'visibility': 'simplified' } ] }, { 'featureType': 'road.arterial', 'elementType': 'labels.icon', 'stylers': [ { 'visibility': 'off' } ] }, { 'featureType': 'transit', 'elementType': 'all', 'stylers': [ { 'visibility': 'off' } ] }, { 'featureType': 'water', 'elementType': 'all', 'stylers': [ { 'color': '#d0d0d0' }, { 'visibility': 'on' } ] } ]; //var styles = [ { 'stylers': [ { 'saturation': -100 } ] } ]; var latLngMaps = new google.maps.LatLng(45.1590571,1.486775); var bounds = new google.maps.LatLngBounds(); map = new google.maps.Map(document.getElementById('map'), { center: latLngMaps, zoom: zoom, minZoom: 6, maxZoom: 20, disableDefaultUI: true, panControl: false, zoomControl: false, mapTypeId: 'roadmap' }); map.setOptions({styles: styles}); var markers = [ ['Agence de Malemort (19)
Direction', 45.177080042951886, 1.585280942073743],['Agence de Saint-Céré (46)', 44.85965180122964, 1.8813765397513338],['Agence de Tulle (19)', 45.277564711949935, 1.7912942839465806],['Agence de Naucelles (15)', 44.96975042834538, 2.41810844215392],['Agence d’Albi (81)', 43.914884653506626, 2.1298756537398384],['Agence de Cournon d’Auvergne (63) ', 45.74541343587574, 3.167902368624716] ]; var infoWindowContent = [ ['
' + '

Agence de Malemort (19)
Direction

' + '
75 Avenue de la Libération
19360 - Malemort

05 55 92 80 10' + '
'],['
' + '

Agence de Saint-Céré (46)

' + '
Avenue Robert Destic
46400 - Saint-Céré

05 65 38 13 70' + '
'],['
' + '

Agence de Tulle (19)

' + '
18 avenue du Dr Albert Schweitzer
19000 - Tulle

05 55 26 14 48' + '
'],['
' + '

Agence de Naucelles (15)

' + '
11 place de la Halle
15250 - Naucelles

04 71 43 64 35' + '
'],['
' + '

Agence d’Albi (81)

' + '
Rue de Cap Long
81990 - Le Sequestre

05 63 76 21 00' + '
'],['
' + '

Agence de Cournon d’Auvergne (63)

' + '
8 rue Dieudonné Costes
63800 - Cournon d\'Auvergne

04 63 22 40 06' + '
'] ]; var myicon = new google.maps.MarkerImage('img/googlemarker.png'); // Display multiple markersLuminaire on a map var infoWindow = new google.maps.InfoWindow(), marker, i; // Loop through our array of markers & place each one on the map for( i = 0; i < markers.length; i++ ) { var position = new google.maps.LatLng(markers[i][1], markers[i][2]); bounds.extend(position); myicon = new google.maps.MarkerImage('img/googlemarker0.png'); marker = new google.maps.Marker({ icon: myicon, position: position, map: map, title: markers[i][0] }); // Allow each marker to have an info window google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infoWindow.setContent(infoWindowContent[i][0]); infoWindow.open(map, marker); } })(marker, i)); // Automatically center the map fitting all markers on the screen map.fitBounds(bounds); } // Override our map zoom level once our fitBounds function runs (Make sure it only runs once) var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) { //this.setZoom(2); google.maps.event.removeListener(boundsListener); }); setTimeout(HideElements, 100); }