diff options
author | Adrian Moreno <adrian@morenomartinez.com> | 2016-10-12 01:08:43 +0300 |
---|---|---|
committer | Adrian Moreno <adrian@morenomartinez.com> | 2016-10-12 01:08:43 +0300 |
commit | 1cc6c2cfdd41bd124e418ef0b657d58d7c7f25e2 (patch) | |
tree | eb3296093b955b6a4bee9af3ff7d414dd0ab5b95 /static | |
parent | 808caed6c859aea638db09f536b42459693031f0 (diff) |
Fixes bug carousel not displaying (closes #19)
Diffstat (limited to 'static')
-rw-r--r-- | static/js/gmaps.init.js | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/static/js/gmaps.init.js b/static/js/gmaps.init.js index 869d061..2f62fbb 100644 --- a/static/js/gmaps.init.js +++ b/static/js/gmaps.init.js @@ -1,42 +1,40 @@ -$(function () { +$( document ).ready(function() { map(); }); -/* map */ - function map() { - if ($("#map") != undefined) { + if( $('#map').length ) { var lat = $("#gmap-lat").val(); var lng = $("#gmap-lng").val(); var image = '/img/marker.png'; var styles = [{"featureType": "landscape", "stylers": [{"saturation": -100}, {"lightness": 65}, {"visibility": "on"}]}, {"featureType": "poi", "stylers": [{"saturation": -100}, {"lightness": 51}, {"visibility": "simplified"}]}, {"featureType": "road.highway", "stylers": [{"saturation": -100}, {"visibility": "simplified"}]}, {"featureType": "road.arterial", "stylers": [{"saturation": -100}, {"lightness": 30}, {"visibility": "on"}]}, {"featureType": "road.local", "stylers": [{"saturation": -100}, {"lightness": 40}, {"visibility": "on"}]}, {"featureType": "transit", "stylers": [{"saturation": -100}, {"visibility": "simplified"}]}, {"featureType": "administrative.province", "stylers": [{"visibility": "off"}]}, {"featureType": "water", "elementType": "labels", "stylers": [{"visibility": "on"}, {"lightness": -25}, {"saturation": -100}]}, {"featureType": "water", "elementType": "geometry", "stylers": [{"hue": "#ffff00"}, {"lightness": -25}, {"saturation": -97}]}]; map = new GMaps({ - el: '#map', - lat: lat, - lng: lng, - zoomControl: true, - zoomControlOpt: { - style: 'SMALL', - position: 'TOP_LEFT' - }, - panControl: false, - streetViewControl: false, - mapTypeControl: false, - overviewMapControl: false, - scrollwheel: false, - draggable: false, - styles: styles + el: '#map', + lat: lat, + lng: lng, + zoomControl: true, + zoomControlOpt: { + style: 'SMALL', + position: 'TOP_LEFT' + }, + panControl: false, + streetViewControl: false, + mapTypeControl: false, + overviewMapControl: false, + scrollwheel: false, + draggable: false, + styles: styles }); map.addMarker({ - lat: lat, - lng: lng, - icon: image/* , - title: '', - infoWindow: { - content: '<p>HTML Content</p>' - }*/ + lat: lat, + lng: lng, + icon: image/* , + title: '', + infoWindow: { + content: '<p>HTML Content</p>' + }*/ }); } } |