File manager - Edit - /home/asiatechinc/public_html/asiatechinc-websites/vanviharresorts.com/js/map.js
Back
"use strict"; function initialize() { if($('#map').length){ var latlng, map, marker, infobox; var icon_url = 'img/map-marker.png'; var address = 'Rạp Galaxy Cinema, Nguyễn Trãi, Nguyễn Cư Trinh, Hồ Chí Minh, Việt Nam'; var map_type = 'ROADMAP'; var places = [ ['Carytown Street', 40.651373, 14.612991, 4], ['Arthur Ashe Center', -33.923036, 151.259052, 5], ['Carytown Park', -34.028249, 151.157507, 3], ['Kings Dominion', -33.80010128657071, 151.28747820854187, 2], ['Maymond Foundation', -33.950198, 151.259302, 1] ]; var geocoder = new google.maps.Geocoder(); geocoder.geocode({'address' : address}, function(results, status) { if(status == google.maps.GeocoderStatus.OK){ var lat = results[0].geometry.location.lat(); var lng = results[0].geometry.location.lng(); } else { var lat = '40.651373'; var lng = '14.612991'; } latlng = new google.maps.LatLng(lat, lng); // Map Option var mapOptions = { zoom: 17, center: latlng, scrollwheel: false, mapTypeId: google.maps.MapTypeId[map_type] }; /* Create Map*/ map = new google.maps.Map(document.getElementById('map'), mapOptions); /* Create Marker */ marker = new google.maps.Marker({ position: latlng, map: map, draggable: false, animation: google.maps.Animation.DROP, icon: { url: icon_url, size: new google.maps.Size(23, 37), origin: new google.maps.Point(0,0), anchor: new google.maps.Point(15,40) } }); /**********/ /* Create Infobox */ if($('#map').find('#map-infobox')){ infobox = new InfoBox({ content: document.getElementById("map-infobox"), disableAutoPan: false, pixelOffset: new google.maps.Size(-113, -165), boxStyle: { width: "220px" }, closeBoxMargin: "0px -15px 0 0", closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif", infoBoxClearance: new google.maps.Size(1, 1) }); infobox.open(map, marker); google.maps.event.addListener(marker, 'click', function() { infobox.open(map, this); map.panTo(latlng); //Give it a little time to set up the infobox. This time may need to be increased, especially for mobile devices. setTimeout(function() { document.getElementById("bodyContent").className = ""; }, 75); }); google.maps.event.addListener(infobox, 'closeclick', function(e) { document.getElementById("bodyContent").className = "hidden"; }); }// end if /*********/ /* Add Markers at multiple place in list */ for (var i = 0; i < places.length; i++) { var place = places[i]; marker = new google.maps.Marker({ position: {lat: place[1], lng: place[2]}, map: map, title: place[0], draggable: false, icon: { url: icon_url, size: new google.maps.Size(23, 37), origin: new google.maps.Point(0,0), anchor: new google.maps.Point(15,40) } }); } /* Click to move Latlng */ $('#content a.getLatlgn').each(function(){ $(this).on("click", function(){ var $getlatlng = $(this).data('latlng'); var split = $getlatlng.split(','); var customlat = split[0]; var customlng = split[1]; if ($getlatlng.length != 0){ latlng = new google.maps.LatLng(customlat,customlng); map.setCenter(latlng); } }); }); });// END geocode } } google.maps.event.addDomListener(window, 'load', initialize);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings