aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/assets/map.html
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-01-07 22:32:23 +0100
committerChristian Schneppe <christian@pix-art.de>2018-01-07 22:32:23 +0100
commit8cf20a8222ee1102edbe47ebec312862042bb0c9 (patch)
tree77a82c956c69c2e50b8932a5ac7621a347994e77 /src/main/assets/map.html
parentb5c137202813059e5ab135f297072118d4cd347a (diff)
reworked location services from GoogleMap to OSM
Diffstat (limited to 'src/main/assets/map.html')
-rw-r--r--src/main/assets/map.html75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/main/assets/map.html b/src/main/assets/map.html
new file mode 100644
index 000000000..6d5784336
--- /dev/null
+++ b/src/main/assets/map.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ <link href="font-awesome.min.css" rel="stylesheet">
+ <link href="animate.min.css" rel="stylesheet">
+
+ <script src="jquery.min.js"></script>
+ <link rel="stylesheet" href="leaflet.css"/>
+ <script src="leaflet.js"></script>
+ </head>
+
+ <body>
+
+ <style>
+ #map{width:100%;height:100%;position:fixed;top:0px;left:0px;right:0px;bottom:0px}
+
+ </style>
+
+ <div id='map'>
+ </div>
+
+ <script type="text/javascript">
+ var getUrlParameter = function getUrlParameter(sParam) {
+ var sPageURL = decodeURIComponent(window.location.search.substring(1)),
+ sURLVariables = sPageURL.split('&'),
+ sParameterName,
+ i;
+
+ for (i = 0; i < sURLVariables.length; i++) {
+ sParameterName = sURLVariables[i].split('=');
+
+ if (sParameterName[0] === sParam) {
+ return sParameterName[1] === undefined ? true : sParameterName[1];
+ }
+ }
+ };
+
+ if (typeof getUrlParameter('lat') === 'undefined' && typeof getUrlParameter('lon') === 'undefined') {
+ var map = L.map('map', {
+ zoomControl: true,
+ attributionControl: false
+ }).fitWorld();
+ } else {
+
+ var map = L.map('map', {
+ zoomControl: true,
+ attributionControl: false
+ }).setView([getUrlParameter('lat'), getUrlParameter('lon')], 15);
+ }
+
+ map.addLayer(new L.TileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
+ minZoom: 1,
+ maxZoom: 19
+ }));
+
+ if (typeof getUrlParameter('lat') !== 'undefined' && typeof getUrlParameter('lon') !== 'undefined' && typeof getUrlParameter('name') !== 'undefined') {
+ var marker = L.marker([getUrlParameter('lat'), getUrlParameter('lon')]).addTo(map);
+ marker.bindPopup(getUrlParameter('name'), {
+ closeOnClick: false,
+ closeButton: false,
+ autoClose: false
+ }).openPopup();
+ } else if (typeof getUrlParameter('lat') !== 'undefined' && typeof getUrlParameter('lon') !== 'undefined' && typeof getUrlParameter('name') === 'undefined') {
+ var marker = L.marker([getUrlParameter('lat'), getUrlParameter('lon')]).addTo(map);
+ }
+
+
+
+ </script>
+
+ </body>
+ </html>