(function() { function dashboardGmap() { if ($('#gmapDemo')[0] === undefined || !KisoThemes.jsLibIsActive('gmaps')) { return; } var oldMarker; var map = new GMaps({ div: '#gmapDemo', lat: 0, lng: 0, disableDefaultUI: true, scaleControl: false, scrollwheel: false, disableDoubleClickZoom: true, zoomControl: true, zoomControlOpt: { style: 'SMALL', position: 'TOP_RIGHT' }, height: '485px', zoom: 1 }); function removeMarkers() { map.removeMarkers(); } function update() { map.addMarker({ lat: Math.random() * 280, lng: Math.random() * 360 }); if (!Modernizr.touch) { setTimeout(update, Math.random() * 1000); setTimeout(removeMarkers, 10000); } } update(); } function makeGmap(el, type, opts) { var satelliteGmap = $(el) if(satelliteGmap.length === 0) { return } var defaultOpts = { div: el, lat: '55.855573', lng: '-4.3728844', mapType: type, disableDefaultUI: true, scaleControl: false, scrollwheel: false, disableDoubleClickZoom: false, zoomControl: true, zoomControlOpt: { style: 'SMALL', position: 'TOP_RIGHT' }, height: '485px', zoom: 5 } for (var attrname in opts) { defaultOpts[attrname] = opts[attrname]; } var map = new GMaps(defaultOpts); return map } function createStreetview( el, lat, long, heading, pitch ) { if ($(el).length) { return new GMaps.createPanorama({ el: el, lat: lat, lng: long, pov: { heading: heading, pitch: pitch }, scrollwheel: false }); } } function drawMapOverlay(map, lat, long, content) { map.drawOverlay({ lat: lat, lng: long, content: content }); } function initGmapsDemo() { dashboardGmap(); if($('.gmap-satellite').length) { makeGmap('.gmap-satellite', 'satellite'); } if($('.gmap-terrain').length) { makeGmap('.gmap-terrain', 'terrain'); } if($('.gmap-hybrid').length) { makeGmap('.gmap-hybrid', 'hybrid'); } if($('.gmap-roadmap').length) { makeGmap('.gmap-roadmap', 'roadmap'); } if($('.gmap-default').length) { makeGmap('.gmap-default', 'roadmap'); } if($('#gmap-streetview').length) { createStreetview('#gmap-streetview', '55.8611768', '-4.2538145', 250, 9); } if($('.gmap-overlay').length) { var overlayMap = makeGmap('.gmap-overlay', 'satellite') drawMapOverlay(overlayMap, '55.855573', '-4.3728844','