/** * Javascript to handle open street map for property single page. */ jQuery( function( $ ) { 'use strict'; if( typeof contactMapData !== "undefined" ) { if( contactMapData.latitude && contactMapData.longitude ) { var tileLayer = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution : '© OpenStreetMap contributors' } ); var mapCenter = L.latLng( contactMapData.latitude, contactMapData.longitude ); var mapZoom = 14; if( contactMapData.mapZoom ) { mapZoom = contactMapData.mapZoom } var mapOptions = { center : mapCenter, zoom : mapZoom }; var contactMap = L.map( 'map-canvas', mapOptions ); contactMap.scrollWheelZoom.disable(); contactMap.addLayer( tileLayer ); L.marker( mapCenter ).addTo( contactMap ); } } } );