/** * Theme: Crovex - Responsive Bootstrap 4 Admin Dashboard * Author: Mannatthemes * Gmaps Js */ !function($) { "use strict"; var GoogleMap = function() {}; //creates basic map GoogleMap.prototype.createBasic = function($container) { return new GMaps({ div: $container, lat: -12.043333, lng: -77.028333 }); }, //creates map with markers GoogleMap.prototype.createMarkers = function($container) { var map = new GMaps({ div: $container, lat: -12.043333, lng: -77.028333 }); //sample markers, but you can pass actual marker data as function parameter map.addMarker({ lat: -12.043333, lng: -77.03, title: 'Lima', details: { database_id: 42, author: 'HPNeo' }, click: function(e){ if(console.log) console.log(e); alert('You clicked in this marker'); } }); map.addMarker({ lat: -12.042, lng: -77.028333, title: 'Marker with InfoWindow', infoWindow: { content: '
HTML Content
' } }); return map; }, //creates map with polygone GoogleMap.prototype.createWithPolygon = function ($container, $path) { var map = new GMaps({ div: $container, lat: -12.043333, lng: -77.028333 }); var polygon = map.drawPolygon({ paths: $path, strokeColor: '#BBD8E9', strokeOpacity: 1, strokeWeight: 3, fillColor: '#BBD8E9', fillOpacity: 0.6 }); return map; }, //creates map with overlay GoogleMap.prototype.createWithOverlay = function ($container) { var map = new GMaps({ div: $container, lat: -12.043333, lng: -77.028333 }); map.drawOverlay({ lat: map.getCenter().lat(), lng: map.getCenter().lng(), content: '', verticalAlign: 'top', horizontalAlign: 'center' }); return map; }, //creates map with street view GoogleMap.prototype.createWithStreetview = function ($container, $lat, $lng) { return GMaps.createPanorama({ el: $container, lat : $lat, lng : $lng }); }, //Routes GoogleMap.prototype.createWithRoutes = function ($container, $lat, $lng) { var map = new GMaps({ div: $container, lat: $lat, lng: $lng }); $('#start_travel').click(function(e){ e.preventDefault(); map.travelRoute({ origin: [-12.044012922866312, -77.02470665341184], destination: [-12.090814532191756, -77.02271108990476], travelMode: 'driving', step: function(e){ $('#instructions').append('