var MapTitle = document.getElementById('fullMapAddressId').value; $(document).ready(function () { var locationToSet = document.getElementById('locationToSet').value;; var zipToSet = document.getElementById('zipToSet').value;; //if (ContactMapLocation != undefined && ContactMapLocation!='') { // locationToSet = ContactMapLocation; // if (ContactMapLocationZip != undefined && ContactMapLocationZip != '') { // zipToSet = ContactMapLocationZip; // } // if (ContactMapTitle != undefined && ContactMapLocation != '') { // MapTitle = ContactMapTitle; // } //} $.ajax({ url: "https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyDuOi1F2BTcTGb0odguF2PKfE5MYHQXR4o&address=" + encodeURI(locationToSet) + "&components=postal_code:"+zipToSet+"&sensor=false", method: "POST", success: function (data) { latitude = data.results[0].geometry.location.lat; longitude = data.results[0].geometry.location.lng; google.maps.event.addDomListener(window, 'load', initialize(latitude, longitude)); } }); if ($('body').hasClass('possite')) { $('.conbanimg').imagefill(); } (function ($) { fakewaffle.responsiveTabs(['xs', 'sm']); $('#myTab a, #myTab2 a').click(function (e) { e.preventDefault(); $(this).tab('show'); }); })(jQuery); $('.lcclick').click(function(e){ $('html, body').animate({scrollTop: $("#coordinators").offset().top-120}, 2000); e.preventDefault(); var lcid = $(this).attr('href'); if ($(lcid).is(':visible')) { $(lcid).slideUp('slow'); $(this).children().text('View'); } else { $(lcid).slideDown('slow'); $(this).children().text('Hide'); } }); }); function initialize(latitude, longitude) { var myLatlng = new google.maps.LatLng(latitude, longitude); //var mapOptions = { // zoom: 16, // //lat: latitude, // //lng: longitude // center: myLatlng //} //var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var map = new google.maps.Map(document.getElementById('map-canvas'), { center: { lat: latitude, lng: longitude }, zoom: 16 }); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: MapTitle, icon: JsGlobalS3SiteURL+'/Content/smilestream/img/contact_map_marker.png' }); }