From 48bd57424ddeb1aafba4b1c7c8e263c55e29bf9b Mon Sep 17 00:00:00 2001 From: Philipp Wollschlegel Date: Fri, 20 Sep 2024 13:24:27 +0200 Subject: [PATCH] download/maps: add openlayer implemenation for maps --- download/maps/index.html | 141 ++++++++++++++++++++++++++++++++++++--- download/maps/maps.js | 81 ---------------------- 2 files changed, 130 insertions(+), 92 deletions(-) delete mode 100644 download/maps/maps.js diff --git a/download/maps/index.html b/download/maps/index.html index 9a29fce..5c7815e 100644 --- a/download/maps/index.html +++ b/download/maps/index.html @@ -6,14 +6,133 @@ jquery: true --- -
- Click on an area to download the corresponding map. -
-
-
-
-
-
- - - + + + + OpenLayers Map + + + + + + +
+
+ + diff --git a/download/maps/maps.js b/download/maps/maps.js deleted file mode 100644 index aed4bcd..0000000 --- a/download/maps/maps.js +++ /dev/null @@ -1,81 +0,0 @@ -var mapOptions = { - zoom: 2, - center: new google.maps.LatLng(25, 0), - mapTypeId: google.maps.MapTypeId.TERRAIN, - streetViewControl: false -}; - -var map = new google.maps.Map(document.getElementById("map"), mapOptions); - -var info = null; -var active_rect = null; -google.maps.event.addListener(map, 'click', function() { - if (info) { - info.close(); - info = null; - } - - if (active_rect) { - active_rect.setOptions({ - strokeColor: "#FF8800", - fillColor: "#FF8800", - }); - active_rect = null; - } -}); - -for (var name in MAPS) { - var ext = MAPS[name]; - - var sw = new google.maps.LatLng(ext[1], ext[0]); - var ne = new google.maps.LatLng(ext[3], ext[2]); - var bounds = new google.maps.LatLngBounds(sw, ne); - var rect = new google.maps.Rectangle({ - strokeColor: "#FF8800", - strokeOpacity: 0.7, - strokeWeight: 2, - fillColor: "#FF8800", - fillOpacity: 0.2, - map: map, - bounds: bounds - }); - - rect.region = name; - - google.maps.event.addListener(rect, 'click', function() { - if (active_rect) { - active_rect.setOptions({ - strokeColor: "#FF8800", - fillColor: "#FF8800", - }); - } - active_rect = this; - active_rect.setOptions({ - strokeColor: "#0000CC", - fillColor: "#0000CC", - }); - var content = "
" + - this.region + "

"+ - "Standard map
" + - "High resolution map
" + - "Altair map
" + - "
"; - - if (info) info.close(); - info = new google.maps.InfoWindow({ - content: content - }); - info.setPosition(this.getBounds().getCenter()); - info.open(map); - }); - - var map_list_info = "

" + name + "


Standard map | High resolution map | Altair map

"; - - $("#map_list").append(map_list_info); -}