Skip to content

Commit

Permalink
Fix external url.
Browse files Browse the repository at this point in the history
  • Loading branch information
ayastreb committed Mar 7, 2018
1 parent 0eb2d99 commit 99bdb5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/jekyll-maps/google_map_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,20 @@ var jekyllMaps = (function() {
title: location.title,
image: location.image,
icon: location.icon || mapOptions.markerIcon,
url: location.url.length > 0 ? mapOptions.baseUrl + location.url : '',
url: markerUrl(mapOptions.baseUrl, location.url),
map: map
})
if (mapOptions.showMarkerPopup) marker.addListener('click', markerPopup)

return marker
}

function markerUrl(baseUrl, url) {
if (/^(https?|\/\/)/.test(url)) return url

return url.length > 0 ? baseUrl + url : ''
}

function markerPopup() {
var contentHtml =
'<div class="map-info-window"><h5>' + this.title + '</h5>'
Expand Down

0 comments on commit 99bdb5a

Please sign in to comment.