Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorschuster-rainer <rainerschuster79@gmail.com>2017-03-01 00:31:19 +0300
committerAdrián Moreno <adrian@morenomartinez.com>2017-03-09 14:29:04 +0300
commit3943a0fbb9a665b0f6d8b71cb3cac11ac44ac0c7 (patch)
tree3760e5d70e7aa108eb09a86263c8f6510e9e87f3 /static
parent15526a60fa71c2990236053456529c02783558ca (diff)
Added directions for gmaps on pin click
When the direction attribute is used in the config the given address is used for directions instead of long and lat
Diffstat (limited to 'static')
-rw-r--r--static/js/gmaps.init.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/static/js/gmaps.init.js b/static/js/gmaps.init.js
index 7bf4b49..4790ee9 100644
--- a/static/js/gmaps.init.js
+++ b/static/js/gmaps.init.js
@@ -8,6 +8,7 @@ function map () {
if ($('#map').length) {
var lat = $('#gmap-lat').val()
var lng = $('#gmap-lng').val()
+ var direction = $('#gmap-dir').val()
var image = '/img/marker.png'
var styles =
@@ -54,8 +55,14 @@ function map () {
map.addMarker({
lat: lat,
lng: lng,
- icon: image /* ,
- title: '',
+ icon: image,
+ click: function(e) {
+ // when we get an address with spaces ...
+ url = "https://maps.google.com?daddr=" + direction.split("match").join("replace");
+ window.open(url,'_blank');
+ },
+ title: direction,
+ /* ,
infoWindow: {
content: '<p>HTML Content</p>'
} */