diff options
author | Guillermo Guerrero <wolf.fox1985@gmail.com> | 2016-09-18 22:18:59 +0300 |
---|---|---|
committer | Guillermo Guerrero <wolf.fox1985@gmail.com> | 2016-10-11 09:40:03 +0300 |
commit | 5d072c591784dbbf3443e9edea8a5d2115f82c34 (patch) | |
tree | 1a02d1a92ca4713221631058f1f345c0d2733b73 /static | |
parent | 9a294ed8751bd98edcac7c82b9f510890a8c1294 (diff) |
Added google maps in contact.
Diffstat (limited to 'static')
-rw-r--r-- | static/js/gmaps.init.js | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/static/js/gmaps.init.js b/static/js/gmaps.init.js index c77e0e0..869d061 100644 --- a/static/js/gmaps.init.js +++ b/static/js/gmaps.init.js @@ -1,41 +1,42 @@ $(function () { - map(); - }); /* map */ function map() { + if ($("#map") != undefined) { + 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: -12.043333, - lng: -77.028333, - 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 }); - var image = 'img/marker.png'; - map.addMarker({ - lat: -12.043333, - lng: -77.028333, - icon: image/* , - title: '', - infoWindow: { - content: '<p>HTML Content</p>' - }*/ + lat: lat, + lng: lng, + icon: image/* , + title: '', + infoWindow: { + content: '<p>HTML Content</p>' + }*/ }); -}
\ No newline at end of file + } +} |