$('#collapseMap').on('shown.bs.collapse', function(e){ (function(A) { if (!Array.prototype.forEach) A.forEach = A.forEach || function(action, that) { for (var i = 0, l = this.length; i < l; i++) if (i in this) action.call(that, this[i], i, this); }; })(Array.prototype); var mapObject, markers = [], markersData = { /* 'Single_hotel': [ { name: 'Hotel Mariott', location_latitude: 48.873792, location_longitude: 2.295028, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Hotel Mariott', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_hotel.html' } ], 'Sightseeing': [ { name: 'Open Bus', location_latitude: 48.865633, location_longitude: 2.321236, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Open Bus', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' }, { name: 'Senna River Tour', location_latitude: 48.854183, location_longitude: 2.354808, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Senna River Tour', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' } ], 'Museums': [ { name: 'Louvre', location_latitude: 48.863893, location_longitude: 2.342348, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Louvre', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' }, { name: 'Pompidou ', location_latitude: 48.860642, location_longitude: 2.352245, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Pompidou', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' } ], 'Skyline': [ { name: 'Tour Eiffel', location_latitude: 48.858370, location_longitude: 2.294481, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Tour Eiffel', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' }, { name: 'Montparnasse', location_latitude: 48.837273, location_longitude: 2.335387, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Montparnasse', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' } ], 'Eat_drink': [ { name: 'Beaubourg', location_latitude: 48.860819, location_longitude: 2.354507, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Beaubourg', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' }, { name: 'St. Germain des Prés', location_latitude: 48.853798, location_longitude: 2.333328, map_image_url: 'img/thumb_map_1.jpg', name_point: 'St. Germain des Prés', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' } ],*/ 'experience': [ { name: 'Adventure Park on Mount Etna', location_latitude: 37.730998, location_longitude: 15.111749, map_image_url: 'js/temp/thumb_mappa_suntripsicily_experience_Adventure Park on Mount Etna.jpg', name_point: 'Adventure Park on Mount Etna', description_point: 'Built in the “Pineta dello Sca', phone: '+393927661318', url_point: '21-experience-adventure-park-on-mount-etna.php' }, { name: 'Cooking class with Piero D'Agostino, Michelin starred chef of exquisite Restaurant ', location_latitude: 37.864203, location_longitude: 15.296088, map_image_url: 'js/temp/thumb_mappa_suntripsicily_experience_Cooking class with Piero D'Agostino, Michelin starred chef of exquisite Restaurant .jpg', name_point: 'Cooking class with Piero D'Agostino, Michelin starred chef of exquisite Restaurant ', description_point: 'Pietro is the patron chef of one of ', phone: '+393927661318', url_point: '11-experience-cooking-class-with-piero-dagostino-michelin-starred-chef-of-exquisite-restaurant.php' }, { name: 'Etna 4x4 excursion. Deep into the wild Nature', location_latitude: 37.700134, location_longitude: 14.998231, map_image_url: 'js/temp/thumb_mappa_suntripsicily_experience_Etna 4x4 excursion. Deep into the wild Nature.jpg', name_point: 'Etna 4x4 excursion. Deep into the wild Nature', description_point: 'FOR A TRAVELER, THE PLEASURES OF THE', phone: '+393927661318', url_point: '1-experience-etna-x-excursion-deep-into-the-wild-nature.php' }, { name: 'Etna Quad Adventure', location_latitude: 37.80819, location_longitude: 15.07476, map_image_url: 'js/temp/thumb_mappa_suntripsicily_experience_Etna Quad Adventure.jpg', name_point: 'Etna Quad Adventure', description_point: 'Do you want to discover the secrets ', phone: '+393927661318', url_point: '26-experience-etna-quad-adventure.php' }, { name: 'Excursion to Etna Summit', location_latitude: 37.700661, location_longitude: 14.999111, map_image_url: 'js/temp/thumb_mappa_suntripsicily_experience_Excursion to Etna Summit.jpg', name_point: 'Excursion to Etna Summit', description_point: 'Excursion to Etna Summit Craters let', phone: '+393927661318', url_point: '24-experience-excursion-to-etna-summit.php' }, ], 'events': [ { name: '', location_latitude: 37.509505, location_longitude: 15.088230, map_image_url: 'js/temp/thumb_mappa_suntripsicily_event_.jpg', name_point: '', description_point: '', phone: '+393927661318', url_point: '92-events_in_sicily-.php' }, { name: '', location_latitude: 37.612887, location_longitude: 15.165696, map_image_url: 'js/temp/thumb_mappa_suntripsicily_event_.jpg', name_point: '', description_point: '', phone: '+393927661318', url_point: '25-events_in_sicily-.php' }, { name: '', location_latitude: 37.501902, location_longitude: 15.087124, map_image_url: 'js/temp/thumb_mappa_suntripsicily_event_.jpg', name_point: '', description_point: '', phone: '+393927661318', url_point: '97-events_in_sicily-.php' }, { name: '', location_latitude: 37.6369577, location_longitude: 14.9478757, map_image_url: 'js/temp/thumb_mappa_suntripsicily_event_.jpg', name_point: '', description_point: '', phone: '+393927661318', url_point: '77-events_in_sicily-.php' }, ], 'Walking': [ { name: 'Suite Apartment Rubino', location_latitude: 37.713445, location_longitude: 15.172274, map_image_url: 'js/temp/thumb_mappa_suntripsicily_location_Suite Apartment Rubino.jpg', name_point: 'Suite Apartment Rubino', description_point: 'Suite Apartment Zaffiro, together with Suite Apartment Rubino just next door and Suite Apartment Sme', get_directions_start_address: '', phone: '+393927661318', url_point: '32-location-suite-apartment-rubino.php' }/*, { name: 'Madeleine', location_latitude: 37.713445, location_longitude: 15.172274, map_image_url: 'img/thumb_map_1.jpg', name_point: 'Madeleine', description_point: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', get_directions_start_address: '', phone: '+3934245255', url_point: 'single_tour.html' }*/ ] }; var mapOptions = { zoom: 10, center: new google.maps.LatLng(37.713445, 15.172274), /*center: new google.maps.LatLng(48.865633, 2.321236),*/ mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.LEFT_CENTER }, panControl: false, panControlOptions: { position: google.maps.ControlPosition.TOP_RIGHT }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE, position: google.maps.ControlPosition.TOP_LEFT }, scrollwheel: false, scaleControl: false, scaleControlOptions: { position: google.maps.ControlPosition.TOP_LEFT }, streetViewControl: true, streetViewControlOptions: { position: google.maps.ControlPosition.LEFT_TOP }, styles: [ { "featureType": "landscape", "stylers": [ { "hue": "#FFBB00" }, { "saturation": 43.400000000000006 }, { "lightness": 37.599999999999994 }, { "gamma": 1 } ] }, { "featureType": "road.highway", "stylers": [ { "hue": "#FFC200" }, { "saturation": -61.8 }, { "lightness": 45.599999999999994 }, { "gamma": 1 } ] }, { "featureType": "road.arterial", "stylers": [ { "hue": "#FF0300" }, { "saturation": -100 }, { "lightness": 51.19999999999999 }, { "gamma": 1 } ] }, { "featureType": "road.local", "stylers": [ { "hue": "#FF0300" }, { "saturation": -100 }, { "lightness": 52 }, { "gamma": 1 } ] }, { "featureType": "water", "stylers": [ { "hue": "#0078FF" }, { "saturation": -13.200000000000003 }, { "lightness": 2.4000000000000057 }, { "gamma": 1 } ] }, { "featureType": "poi", "stylers": [ { "hue": "#00FF6A" }, { "saturation": -1.0989010989011234 }, { "lightness": 11.200000000000017 }, { "gamma": 1 } ] } ] }; var marker; mapObject = new google.maps.Map(document.getElementById('map'), mapOptions); for (var key in markersData) markersData[key].forEach(function (item) { marker = new google.maps.Marker({ position: new google.maps.LatLng(item.location_latitude, item.location_longitude), map: mapObject, icon: 'img/pins/' + key + '.png', }); if ('undefined' === typeof markers[key]) markers[key] = []; markers[key].push(marker); google.maps.event.addListener(marker, 'click', (function () { closeInfoBox(); getInfoBox(item).open(mapObject, this); mapObject.setCenter(new google.maps.LatLng(item.location_latitude, item.location_longitude)); })); }); function hideAllMarkers () { for (var key in markers) markers[key].forEach(function (marker) { marker.setMap(null); }); }; function closeInfoBox() { $('div.infoBox').remove(); }; function getInfoBox(item) { return new InfoBox({ content: '
' + 'Image' + '

'+ item.name_point +'

' + ''+ item.description_point +'' + '
' + '
' + ''+ item.phone +'' + '
' + 'Details' + '
', disableAutoPan: false, maxWidth: 0, pixelOffset: new google.maps.Size(10, 125), closeBoxMargin: '5px -20px 2px 2px', closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif", isHidden: false, alignBottom: true, pane: 'floatPane', enableEventPropagation: true }); }; });