diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-02-25 10:12:10 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-24 19:38:57 +0200 |
commit | 94625c811cb68fdc15629f9f4bc24caf60d97eed (patch) | |
tree | 1a3286988a4358931e04e9380d91c046c52faf2b /ishtar_common | |
parent | c9065973be6d91736715986797658a3ce492f3bb (diff) | |
download | Ishtar-94625c811cb68fdc15629f9f4bc24caf60d97eed.tar.bz2 Ishtar-94625c811cb68fdc15629f9f4bc24caf60d97eed.zip |
Map: hide tracking when connection is not secure
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/static/js/ishtar-map.js | 23 | ||||
-rw-r--r-- | ishtar_common/templates/base.html | 1 |
2 files changed, 16 insertions, 8 deletions
diff --git a/ishtar_common/static/js/ishtar-map.js b/ishtar_common/static/js/ishtar-map.js index 247bc4bb6..807e35d46 100644 --- a/ishtar_common/static/js/ishtar-map.js +++ b/ishtar_common/static/js/ishtar-map.js @@ -525,15 +525,22 @@ var initialize_base_map = function(map_id, layers){ zoom: map_default_zoom }); - map[map_id] = new ol.Map({ - controls: ol.control.defaults().extend([ - new ol.control.OverviewMap({ - layers: map_layers[map_id] - }), - new ol.control.FullScreen(), - new ol.control.ScaleLine(), + var map_controls = ol.control.defaults().extend([ + new ol.control.OverviewMap({ + layers: map_layers[map_id] + }), + new ol.control.FullScreen(), + new ol.control.ScaleLine() + ]); + + if (location.protocol == 'https:'){ + map_controls.push( new TrackPositionControl({map_id: map_id}) - ]), + ); + } + + map[map_id] = new ol.Map({ + controls: map_controls, target: map_id, layers: map_layers[map_id], view: map_view[map_id] diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index bcf965ab2..8c2a83713 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -52,6 +52,7 @@ var complete_list_label = "{% trans 'complete list...' %}"; var added_message = "{% trans " items added." %}"; var select_only_one_msg = "{% trans "Select only one item." %}"; + var session var YES = "{% trans 'yes' %}"; var NO = "{% trans 'no' %}"; var show_msg = "{% trans "Show" %}"; |