Inital commit

This commit is contained in:
grey committed 2022-03-06 18:36:36 +01:00
commit bedd69436b
175 files changed
+9965

No files matched your search

+102
View File
@@ -0,0 +1,102 @@
.leaflet-sidebar {
position: absolute;
height: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
z-index: 2000; }
.leaflet-sidebar.left {
left: -500px;
transition: left 0.5s, width 0.5s;
padding-right: 0; }
.leaflet-sidebar.left.visible {
left: 0; }
.leaflet-sidebar.right {
right: -500px;
transition: right 0.5s, width 0.5s;
padding-left: 0; }
.leaflet-sidebar.right.visible {
right: 0; }
.leaflet-sidebar > .leaflet-control {
height: 100%;
width: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 8px 24px;
font-size: 1.1em;
/*background: white;*/
box-shadow: 0 1px 7px rgba(0, 0, 0, 0.65);
-webkit-border-radius: 4px;
border-radius: 4px; }
.leaflet-touch .leaflet-sidebar > .leaflet-control {
box-shadow: none;
border: 2px solid rgba(0, 0, 0, 0.2);
background-clip: padding-box; }
@media (max-width: 767px) {
.leaflet-sidebar {
width: 100%;
padding: 0; }
.leaflet-sidebar.left.visible ~ .leaflet-left {
left: 100%; }
.leaflet-sidebar.right.visible ~ .leaflet-right {
right: 100%; }
.leaflet-sidebar.left {
left: -100%; }
.leaflet-sidebar.left.visible {
left: 0; }
.leaflet-sidebar.right {
right: -100%; }
.leaflet-sidebar.right.visible {
right: 0; }
.leaflet-sidebar > .leaflet-control {
box-shadow: none;
-webkit-border-radius: 0;
border-radius: 0; }
.leaflet-touch .leaflet-sidebar > .leaflet-control {
border: 0; } }
@media (min-width: 768px) and (max-width: 991px) {
.leaflet-sidebar {
width: 305px; }
.leaflet-sidebar.left.visible ~ .leaflet-left {
left: 305px; }
.leaflet-sidebar.right.visible ~ .leaflet-right {
right: 305px; } }
@media (min-width: 992px) and (max-width: 1199px) {
.leaflet-sidebar {
width: 390px; }
.leaflet-sidebar.left.visible ~ .leaflet-left {
left: 390px; }
.leaflet-sidebar.right.visible ~ .leaflet-right {
right: 390px; } }
@media (min-width: 1200px) {
.leaflet-sidebar {
width: 460px; }
.leaflet-sidebar.left.visible ~ .leaflet-left {
left: 460px; }
.leaflet-sidebar.right.visible ~ .leaflet-right {
right: 460px; } }
.leaflet-sidebar .close {
position: absolute;
right: 20px;
top: 20px;
width: 31px;
height: 31px;
color: #333;
font-size: 25px;
line-height: 1em;
text-align: center;
background: white;
-webkit-border-radius: 16px;
border-radius: 16px;
cursor: pointer;
z-index: 1000; }
.leaflet-left {
transition: left 0.5s; }
.leaflet-right {
transition: right 0.5s; }
+202
View File
@@ -0,0 +1,202 @@
L.Control.Sidebar = L.Control.extend({
includes: L.Evented.prototype || L.Mixin.Events,
options: {
closeButton: true,
position: 'left',
autoPan: true,
},
initialize: function (placeholder, options) {
L.setOptions(this, options);
// Find content container
var content = this._contentContainer = L.DomUtil.get(placeholder);
// Remove the content container from its original parent
if(content.parentNode != undefined){
content.parentNode.removeChild(content);
}
var l = 'leaflet-';
// Create sidebar container
var container = this._container =
L.DomUtil.create('div', l + 'sidebar ' + this.options.position);
// Style and attach content container
L.DomUtil.addClass(content, l + 'control');
container.appendChild(content);
// Create close button and attach it if configured
if (this.options.closeButton) {
var close = this._closeButton =
L.DomUtil.create('a', 'close', container);
close.innerHTML = '×';
}
},
addTo: function (map) {
var container = this._container;
var content = this._contentContainer;
// Attach event to close button
if (this.options.closeButton) {
var close = this._closeButton;
L.DomEvent.on(close, 'click', this.hide, this);
}
L.DomEvent
.on(container, 'transitionend',
this._handleTransitionEvent, this)
.on(container, 'webkitTransitionEnd',
this._handleTransitionEvent, this);
// Attach sidebar container to controls container
var controlContainer = map._controlContainer;
controlContainer.insertBefore(container, controlContainer.firstChild);
this._map = map;
// Make sure we don't drag the map when we interact with the content
var stop = L.DomEvent.stopPropagation;
var fakeStop = L.DomEvent._fakeStop || stop;
L.DomEvent
.on(content, 'contextmenu', stop)
.on(content, 'click', fakeStop)
.on(content, 'mousedown', stop)
.on(content, 'touchstart', stop)
.on(content, 'dblclick', fakeStop)
.on(content, 'mousewheel', stop)
.on(content, 'wheel', stop)
.on(content, 'scroll', stop)
.on(content, 'MozMousePixelScroll', stop);
return this;
},
removeFrom: function (map) {
//if the control is visible, hide it before removing it.
this.hide();
var container = this._container;
var content = this._contentContainer;
// Remove sidebar container from controls container
var controlContainer = map._controlContainer;
controlContainer.removeChild(container);
//disassociate the map object
this._map = null;
// Unregister events to prevent memory leak
var stop = L.DomEvent.stopPropagation;
var fakeStop = L.DomEvent._fakeStop || stop;
L.DomEvent
.off(content, 'contextmenu', stop)
.off(content, 'click', fakeStop)
.off(content, 'mousedown', stop)
.off(content, 'touchstart', stop)
.off(content, 'dblclick', fakeStop)
.off(content, 'mousewheel', stop)
.off(content, 'wheel', stop)
.off(content, 'scroll', stop)
.off(content, 'MozMousePixelScroll', stop);
L.DomEvent
.off(container, 'transitionend',
this._handleTransitionEvent, this)
.off(container, 'webkitTransitionEnd',
this._handleTransitionEvent, this);
if (this._closeButton && this._close) {
var close = this._closeButton;
L.DomEvent.off(close, 'click', this.hide, this);
}
return this;
},
isVisible: function () {
return L.DomUtil.hasClass(this._container, 'visible');
},
show: function () {
if (!this.isVisible()) {
L.DomUtil.addClass(this._container, 'visible');
if (this.options.autoPan) {
this._map.panBy([-this.getOffset() / 2, 0], {
duration: 0.5
});
}
this.fire('show');
}
},
hide: function (e) {
if (this.isVisible()) {
L.DomUtil.removeClass(this._container, 'visible');
if (this.options.autoPan) {
this._map.panBy([this.getOffset() / 2, 0], {
duration: 0.5
});
}
this.fire('hide');
}
if(e) {
L.DomEvent.stopPropagation(e);
}
},
toggle: function () {
if (this.isVisible()) {
this.hide();
} else {
this.show();
}
},
getContainer: function () {
return this._contentContainer;
},
getCloseButton: function () {
return this._closeButton;
},
setContent: function (content) {
var container = this.getContainer();
if (typeof content === 'string') {
container.innerHTML = content;
} else {
// clean current content
while (container.firstChild) {
container.removeChild(container.firstChild);
}
container.appendChild(content);
}
return this;
},
getOffset: function () {
if (this.options.position === 'right') {
return -this._container.offsetWidth;
} else {
return this._container.offsetWidth;
}
},
_handleTransitionEvent: function (e) {
if (e.propertyName == 'left' || e.propertyName == 'right')
this.fire(this.isVisible() ? 'shown' : 'hidden');
}
});
L.control.sidebar = function (placeholder, options) {
return new L.Control.Sidebar(placeholder, options);
};
+158
View File
@@ -0,0 +1,158 @@
$threshold-lg: 1200px;
$threshold-md: 992px;
$threshold-sm: 768px;
$width-lg: 460px;
$width-md: 390px;
$width-sm: 305px;
$width-xs: 100%;
$transition-duration: 0.5s;
@mixin border-radius($border-radius) {
-webkit-border-radius: $border-radius;
border-radius: $border-radius;
}
@mixin box-sizing($box-sizing) {
-webkit-box-sizing: $box-sizing;
-moz-box-sizing: $box-sizing;
box-sizing: $box-sizing;
}
@mixin widths($width) {
width: $width;
&.left.visible ~ .leaflet-left {
left: $width;
}
&.right.visible ~ .leaflet-right {
right: $width;
}
}
.leaflet-sidebar {
position: absolute;
height: 100%;
@include box-sizing(border-box);
padding: 10px;
z-index: 2000;
&.left {
left: -500px;
transition: left $transition-duration, width $transition-duration;
padding-right: 0;
&.visible {
left: 0;
}
}
&.right {
right: -500px;
transition: right $transition-duration, width $transition-duration;
padding-left: 0;
&.visible {
right: 0;
}
}
& > .leaflet-control {
height: 100%;
width: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
@include box-sizing(border-box);
padding: 8px 24px;
font-size: 1.1em;
background: white;
box-shadow: 0 1px 7px rgba(0,0,0,0.65);
@include border-radius(4px);
.leaflet-touch & {
box-shadow: none;
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
}
@media(max-width:$threshold-sm - 1px) {
@include widths($width-xs);
padding: 0;
&.left {
left: -$width-xs;
&.visible {
left: 0;
}
}
&.right {
right: -$width-xs;
&.visible {
right: 0;
}
}
& > .leaflet-control {
box-shadow: none;
@include border-radius(0);
.leaflet-touch & {
border: 0;
}
}
}
@media(min-width:$threshold-sm) and (max-width:$threshold-md - 1px) {
@include widths($width-sm);
}
@media(min-width:$threshold-md) and (max-width:$threshold-lg - 1px) {
@include widths($width-md);
}
@media(min-width:$threshold-lg) {
@include widths($width-lg);
}
.close {
position: absolute;
right: 20px;
top: 20px;
width: 31px;
height: 31px;
color: #333;
font-size: 25pt;
line-height: 1em;
text-align: center;
background: white;
@include border-radius(16px);
cursor: pointer;
// https://github.com/Turbo87/leaflet-sidebar/issues/36
z-index: 1000;
}
}
.leaflet-left {
transition: left $transition-duration;
}
.leaflet-right {
transition: right $transition-duration;
}
+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/favicon/ms-icon-70x70.png"/><square150x150logo src="/favicon/ms-icon-150x150.png"/><square310x310logo src="/favicon/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
+106
View File
@@ -0,0 +1,106 @@
body,
html {
background-color: white;
height: 100%;
margin: 0px;
}
.inspector {
margin: 0px;
height: 100vh;
width: 29%;
float: right;
position: fixed;
right: 0px;
top: 0px;
border: 1px solid rgba(97, 97, 97, 0.486);
border-radius: 2px;
margin: 5px;
padding: 4px;
overflow-y: scroll;
}
.fullheight {
height: 100%;
}
.map {
margin: 0px;
height: 100%;
width: 100%;
z-index: 1;
padding: 0px;
/*float: left;*/
}
.lds-ripple {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-ripple div {
position: absolute;
border: 4px solid #fed;
opacity: 1;
border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
animation-delay: -0.5s;
}
@keyframes lds-ripple {
0% {
top: 36px;
left: 36px;
width: 0;
height: 0;
opacity: 1;
}
100% {
top: 0px;
left: 0px;
width: 72px;
height: 72px;
opacity: 0;
}
}
.dropdown:hover .dropdown-menu {
display: block;
}
.reportBtn {
cursor: pointer;
font-size: 16px;
}
.animate-right {
position: relative;
animation: animateright 0.6s;
}
.animate-right-back {
position: relative;
animation: animaterightBack 0.6s;
}
@keyframes animateright {
from {
right: -300px;
opacity: 0;
}
to {
right: 0;
opacity: 1;
}
}
@keyframes animaterightBack {
from {
right: 0;
opacity: 1;
}
to {
right: -300px;
opacity: 0;
}
}
+3
View File
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+1
View File
@@ -0,0 +1 @@
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000"><defs><style>.cls-1{fill:#e30613;}.cls-2{fill:none;stroke:#fff;stroke-miterlimit:10;stroke-width:19px;}</style></defs><circle class="cls-1" cx="990.4" cy="1000" r="558.07"/><path class="cls-2" d="M950.58,864.56c-2.41,7.4-11.44,25-15.39,37.63-6.22,20-9.37,30.16-11.47,39.29a273.68,273.68,0,0,0-6.26,41,257.38,257.38,0,0,0,1.39,51.46c2.83,21.71,7.77,37.37,12.87,53.54,5.35,17,12.94,35.77,17.32,45.9"/><path class="cls-2" d="M1004.39,841.34c3.27,6.92,7.81,17,12.51,29.55,18.88,50.24,22.46,91.46,23.3,102.92a348.33,348.33,0,0,1-1.74,68.15,354.63,354.63,0,0,1-37.9,120.31"/><path class="cls-2" d="M1097.57,787.45c6.24,12.63,13.89,29.31,21.56,49.37,5.86,15.35,13.48,35.5,19.82,62.59a471.22,471.22,0,0,1,8.69,151.59,442.55,442.55,0,0,1-13.21,66.76,462.49,462.49,0,0,1-37.21,93.19"/><path class="cls-2" d="M1152.16,761.37a465.83,465.83,0,0,1,22.6,46.59,454.65,454.65,0,0,1,19.47,56.68c.86,3.18,4.18,15.63,7.65,33.37A563.18,563.18,0,0,1,1212,982.16a503.51,503.51,0,0,1-3.82,84.84,524,524,0,0,1-19.82,86.23,549.18,549.18,0,0,1-33,81"/><polyline class="cls-2" points="1234.95 717.12 690.7 999.02 1234.43 1282.88"/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@@ -0,0 +1,9 @@
/*!
* LeafletSearch 1.0.1
* (c) 2021 Sjaak Priester, Amsterdam
* MIT License
* https://github.com/sjaakp/leaflet-search
* https://sjaakpriester.nl
*/
!function(){"use strict";!function(t){if(!t||"undefined"==typeof window)return;const e=document.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=t,document.head.appendChild(e)}(".geo-search svg{display:block;width:100%;height:100%;position:relative}.geo-search input{transition:width .4s;width:0;padding:2px 0;border:solid #888;border-width:1px 0;outline:0}.geo-search.open input{width:15em;padding:2px 2px;border-width:1px;border-top-left-radius:4px;border-bottom-left-radius:4px}.geo-search button{background-color:#fff;border:none;border:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000;background-position:50% 50%;background-repeat:no-repeat;overflow:hidden;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-left-radius:4px;border-bottom-right-radius:4px;display:block}.geo-search button:hover{background-color:#ddd}"),L.geo={Geocoder:L.Class.extend({initialize:function(t,e){this._map=t,L.setOptions(this,e)},constructUrl:function(t,e){void 0===e&&(e={});var n=Object.assign({},this.options,e),o=new URL(t);for(var r in n)o.searchParams.set(r,n[r]);return o},fetchJson:function(t){return fetch(t.href).then((function(t){return t.json()}))},placeMarker:function(t,e,n){this._map.placeMarker(t,e,n)},fire:function(t){this._map.fire(t)},suggest:function(t,e){},lookup:function(t){}})},L.geo.Nominatim=L.geo.Geocoder.extend({url:"https://nominatim.openstreetmap.org/",mark:function(t){var e=L.latLng(t.lat,t.lon),n=t.boundingbox,o=L.latLngBounds([n[0],n[2]],[n[1],n[3]]);this.placeMarker(e,o,t)},search:function(t){var e=this.constructUrl(this.url+"search",{format:"json",q:t});return this.fetchJson(e)},suggest:function(t,e){var n=this;this.search(t).then((function(t){e.innerHTML=t.reduce((function(t,e){return t+'<option data-id="'+e.osm_type.charAt(0).toUpperCase()+e.osm_id+'">'+e.display_name+"</option>"}),"")})).catch((function(t){return n.fire(t)}))},lookup:function(t){var e=this,n=this.constructUrl(this.url+"reverse",{format:"json",osm_type:t.charAt(0),osm_id:t.slice(1)});this.fetchJson(n).then((function(t){return e.mark(t)})).catch((function(t){return e.fire(t)}))},geocode:function(t){var e=this;this.search(t).then((function(t){if(t.length<1)throw"notfound";return t[0]})).then((function(t){return e.mark(t)})).catch((function(t){return e.fire(t)}))}}),L.geo.GeoNames=L.geo.Geocoder.extend({url:"http://api.geonames.org/search",fetchGeonames:function(t){return this.fetchJson(t).then((function(t){var e=t.geonames;if(!e||e.length<1)throw"notfound";return e}))},mark:function(t){var e=L.latLng(t.lat,t.lng),n=t.bbox,o=L.latLngBounds([n.north,n.west],[n.south,n.east]);this.placeMarker(e,o,t)},suggest:function(t,e){var n=this,o=this.constructUrl(this.url,{q:t,type:"json",style:"short"});this.fetchGeonames(o).then((function(t){e.innerHTML=t.reduce((function(t,e){return t+'<option data-id="'+e.geonameId+'">'+e.name+"&emsp;"+e.countryCode+"</option>"}),"")})).catch((function(t){return n.fire(t)}))},lookup:function(t){var e=this,n=this.constructUrl("http://api.geonames.org/getJSON",{geonameId:t});this.fetchJson(n).then((function(t){return e.mark(t)})).catch((function(t){return e.fire(t)}))},geocode:function(t){var e=this,n=this.constructUrl(this.url,{q:t,inclBbox:!0});this.fetchGeonames(n).then((function(t){return t.shift()})).then((function(t){return e.mark(t)})).catch((function(t){return e.fire(t)}))}}),L.geo.Here=L.geo.Geocoder.extend({mark:function(t){var e=t.displayPosition,n=L.latLng(e.latitude,e.longitude),o=t.mapView,r=o.topLeft,i=o.bottomRight,s=L.latLngBounds([r.latitude,i.longitude],[i.latitude,r.longitude]);this.placeMarker(n,s,t)},fetchData:function(t){var e=this;t.jsonattributes=1;var n=this.constructUrl("https://geocoder.ls.hereapi.com/6.2/geocode.json",t);this.fetchJson(n).then((function(t){return t.response.view.shift().result.shift()})).then((function(t){return e.mark(t.location)})).catch((function(t){return e.fire(t)}))},suggest:function(t,e){var n=this,o=this.constructUrl("https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json",{query:t});this.fetchJson(o).then((function(t){return t.suggestions})).then((function(t){e.innerHTML=t.reduce((function(t,e){return t+'<option data-id="'+e.locationId+'">'+e.label+"</option>"}),"")})).catch((function(t){return n.fire(t)}))},lookup:function(t){this.fetchData({locationid:t})},geocode:function(t){this.fetchData({searchtext:t})}}),L.geo.TomTom=L.geo.Geocoder.extend({url:"https://api.tomtom.com/search/2/geocode/",suggestions:[],datalist:null,mark:function(t){var e=t.position,n=L.latLng(e.lat,e.lon),o=t.viewport,r=o.topLeftPoint,i=o.btmRightPoint,s=L.latLngBounds([r.lat,i.lon],[i.lat,r.lon]);this.placeMarker(n,s,t)},fetchResults:function(t,e){void 0===e&&(e={});var n=encodeURIComponent(t),o=this.constructUrl(""+this.url+n+".json",e);return this.fetchJson(o).then((function(t){if(t.summary.numResults<1)throw"notfound";return t.results}))},suggest:function(t,e){var n=this;thiLine truncated
//# sourceMappingURL=leaflet-search.js.map
@@ -0,0 +1 @@
{"version":3,"file":"leaflet-search.js","sources":["../src/geo.js","../src/providers/nominatim.js","../src/providers/geonames.js","../src/providers/here.js","../src/providers/tomtom.js","../src/providers/kadaster.js","../node_modules/lodash.debounce/index.js","../src/index.js"],"sourcesContent":["/**\r\n * sjaakp/leaflet-search\r\n * ----------\r\n * Search Control for Leaflet\r\n * Version 1.0.0\r\n * Copyright (c) 2020\r\n * Sjaak Priester, Amsterdam\r\n * MIT License\r\n * https://github.com/sjaakp/leaflet-search\r\n * https://sjaakpriester.nl\r\n */\r\n\r\nL.geo = {\r\n Geocoder: L.Class.extend({\r\n initialize: function (map, options) {\r\n this._map = map;\r\n L.setOptions(this, options);\r\n },\r\n\r\n constructUrl(text, options = {}) {\r\n const opts = Object.assign({}, this.options, options),\r\n url = new URL(text);\r\n for (const k in opts) {\r\n url.searchParams.set(k, opts[k]);\r\n }\r\n return url;\r\n },\r\n\r\n fetchJson(url) {\r\n return fetch(url.href)\r\n .then(response => response.json())\r\n },\r\n\r\n placeMarker(latlng, bbox, place) {\r\n this._map.placeMarker(latlng, bbox, place);\r\n },\r\n\r\n fire(err) {\r\n this._map.fire(err);\r\n },\r\n\r\n suggest(address, datalist) {\r\n },\r\n\r\n lookup(id) {\r\n }\r\n })\r\n};\r\n","\r\n/**\r\n * sjaakp/leaflet-search\r\n * ----------\r\n * Search Control for Leaflet\r\n * Version 1.0.0\r\n * Copyright (c) 2020\r\n * Sjaak Priester, Amsterdam\r\n * MIT License\r\n * https://github.com/sjaakp/leaflet-search\r\n * https://sjaakpriester.nl\r\n */\r\n\r\n/**\r\n * @link https://nominatim.org/release-docs/develop/api/Search/\r\n */\r\nL.geo.Nominatim = L.geo.Geocoder.extend({\r\n url: 'https://nominatim.openstreetmap.org/',\r\n\r\n mark(place) {\r\n const latlng = L.latLng(place.lat, place.lon),\r\n bb = place.boundingbox,\r\n bbox = L.latLngBounds([bb[0], bb[2]], [bb[1], bb[3]]);\r\n this.placeMarker(latlng, bbox, place);\r\n },\r\n\r\n search(address) {\r\n const url = this.constructUrl(this.url + 'search', { format: 'json', q: address });\r\n return this.fetchJson(url)\r\n },\r\n\r\n suggest(address, datalist) {\r\n // const url = this.constructUrl(this.url + 'search', { format: 'json', q: address });\r\n this.search(address)\r\n .then(json => {\r\n // console.log(json);\r\n datalist.innerHTML = json.reduce((a, v) => a + `<option data-id=\"${v.osm_type.charAt(0).toUpperCase()}${v.osm_id}\">${v.display_name}</option>`, '');\r\n })\r\n .catch(error => this.fire(error));\r\n },\r\n\r\n lookup(id) {\r\n const url = this.constructUrl(this.url + 'reverse', {\r\n format: 'json',\r\n osm_type: id.charAt(0),\r\n osm_id: id.slice(1)\r\n });\r\n this.fetchJson(url)\r\n .then(json => this.mark(json))\r\n .catch(error => this.fire(error));\r\n },\r\n\r\n geocode(address) {\r\n // fetch('//nominatim.openstreetmap.org/search?format=json&q=' + encodeURIComponent(address))\r\n // .then(response => response.json())\r\n this.search(address)\r\n .then(json => {\r\n if (json.length < 1) throw('notfound');\r\n return json[0];\r\n })\r\n .then(place => this.mark(place))\r\n .catch(error => this.fire(error));\r\n }\r\n});\r\n","/**\r\n * sjaakp/leaflet-search\r\n * ----------\r\n * Search Control for Leaflet\r\n * Version 1.0.0\r\n * Copyright (c) 2020\r\n * Sjaak Priester, Amsterdam\r\n * MIT License\r\n * https://github.com/sjaakp/leaflet-search\r\n * https://sjaakpriester.nl\r\n */\r\n\r\n/**\r\n * Topological names only; no streets\r\n * @link http://www.geonames.org/export/geonames-search.html\r\n */\r\nL.geo.GeoNames = L.geo.Geocoder.extend({\r\n url: 'http://api.geonames.org/search', // no https!\r\n\r\n fetchGeonames(url) {\r\n return this.fetchJson(url)\r\n .then(json => {\r\n const geonames = json.geonames;\r\n if (! geonames || geonames.length < 1) throw 'notfound';\r\n return geonames;\r\n })\r\n },\r\n\r\n mark(place) {\r\n const latlng = L.latLng(place.lat, place.lng),\r\n bb = place.bbox,\r\n bbox = L.latLngBounds([bb.north, bb.west], [bb.south, bb.east]);\r\n this.placeMarker(latlng, bbox, place);\r\n },\r\n\r\n suggest(address, datalist) {\r\n const url = this.constructUrl(this.url, { q: address, type: 'json', style: 'short' });\r\n\r\n this.fetchGeonames(url)\r\n .then(geonames => {\r\n Line truncated
+89
View File
@@ -0,0 +1,89 @@
(function ($) {
"use strict";
/*==================================================================
[ Focus input ]*/
$('.input100').each(function(){
$(this).on('blur', function(){
if($(this).val().trim() != "") {
$(this).addClass('has-val');
}
else {
$(this).removeClass('has-val');
}
})
})
/*==================================================================
[ Validate ]*/
var input = $('.validate-input .input100');
$('.validate-form').on('submit',function(){
var check = true;
for(var i=0; i<input.length; i++) {
if(validate(input[i]) == false){
showValidate(input[i]);
check=false;
}
}
return check;
});
$('.validate-form .input100').each(function(){
$(this).focus(function(){
hideValidate(this);
});
});
function validate (input) {
if($(input).attr('type') == 'email' || $(input).attr('name') == 'email') {
if($(input).val().trim().match(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/) == null) {
return false;
}
}
else {
if($(input).val().trim() == ''){
return false;
}
}
}
function showValidate(input) {
var thisAlert = $(input).parent();
$(thisAlert).addClass('alert-validate');
}
function hideValidate(input) {
var thisAlert = $(input).parent();
$(thisAlert).removeClass('alert-validate');
}
/*==================================================================
[ Show pass ]*/
var showPass = 0;
$('.btn-show-pass').on('click', function(){
if(showPass == 0) {
$(this).next('input').attr('type','text');
$(this).find('i').removeClass('zmdi-eye');
$(this).find('i').addClass('zmdi-eye-off');
showPass = 1;
}
else {
$(this).next('input').attr('type','password');
$(this).find('i').addClass('zmdi-eye');
$(this).find('i').removeClass('zmdi-eye-off');
showPass = 0;
}
});
})(jQuery);
+589
View File
@@ -0,0 +1,589 @@
/* eslint-disable no-undef */
let retryConnection = false;
var markers = L.markerClusterGroup({
chunkedLoading: true,
removeOutsideVisibleBounds: true,
});
// Prepare everything we need for the map
let theMarker = L.Marker.extend({
options: {
id: "-1",
},
});
// Icons
const defaultIcon = L.icon({
iconUrl: "/img/marker-icon.png",
shadowUrl: "",
iconSize: [25, 41], // size of the icon
shadowSize: [41, 41], // size of the shadow
iconAnchor: [12, 41], // point of the icon which will correspond to marker's location
popupAnchor: [1, -34], // point from which the popup should open relative to the iconAnchor
});
const signalIcon = L.icon({
iconUrl: "/img/signal.png",
shadowUrl: "",
iconSize: [30, 30], // size of the icon
shadowSize: [0, 0], // size of the shadow
iconAnchor: [15, 15], // point of the icon which will correspond to marker's location
shadowAnchor: [0, 0], // the same for the shadow
popupAnchor: [0, 0], // point from which the popup should open relative to the iconAnchor
});
const temperatureIcon = L.icon({
iconUrl: "/img/temperature.png",
shadowUrl: "",
iconSize: [30, 30], // size of the icon
shadowSize: [0, 0], // size of the shadow
iconAnchor: [15, 15], // point of the icon which will correspond to marker's location
shadowAnchor: [0, 0], // the same for the shadow
popupAnchor: [0, 0], // point from which the popup should open relative to the iconAnchor
});
const cctvIcon = L.icon({
iconUrl: "/img/cctv.png",
shadowUrl: "",
iconSize: [30, 30], // size of the icon
shadowSize: [0, 0], // size of the shadow
iconAnchor: [15, 15], // point of the icon which will correspond to marker's location
shadowAnchor: [0, 0], // the same for the shadow
popupAnchor: [0, 0], // point from which the popup should open relative to the iconAnchor
});
const wifiIcon = L.icon({
iconUrl: "/img/wifi.png",
shadowUrl: "",
iconSize: [30, 30], // size of the icon
shadowSize: [0, 0], // size of the shadow
iconAnchor: [15, 15], // point of the icon which will correspond to marker's location
shadowAnchor: [0, 0], // the same for the shadow
popupAnchor: [0, 0], // point from which the popup should open relative to the iconAnchor
});
function showPosition(position) {
mymap.setView(
new L.LatLng(position.coords.latitude, position.coords.longitude),
10
);
}
// Share a point
function sharePOI(id) {
const url = "https://pointsight.project-name-here.de/#" + id;
sidebar.prevContent = sidebar._contentContainer.innerHTML;
navigator.clipboard.writeText(url);
makeToastNotification(
"Copy successful",
"The link to this point has been copied to your clipboard"
);
}
function prepareSidebar(point_id, panTo = false) {
const rawData = httpGet(
"/api/retrieve?uid=" +
point_id +
"&key=b03f8aaf-1f32-4d9e-914a-9a50f904833d"
);
if (rawData.length > 0 && !rawData.includes("502 Bad Gateway")) {
retryConnection = false;
try {
toggleModal("popup-modal-no-conn", false);
retryConnection = false;
} catch (error) {
error;
}
const moreData = JSON.parse(rawData)[0][0];
// Inject toolbar
let inspector =
'<i class="fas fa-flag reportBtn" style="padding: 4px;" onclick="reportPOI(\'' +
point_id +
"')\"></i>";
inspector +=
'<i class="fas fa-share-alt reportBtn" style="padding: 4px;" onclick="sharePOI(\'' +
point_id +
"')\"></i>";
console.warn(moreData);
if (moreData.type == "webcam-iframe") {
// Prepare the template
inspector += httpGet("/templates/inspectorContentIframe.html");
inspector = inspector.replaceAll("#TITLE", moreData.titel);
inspector = inspector.replaceAll("#URL", moreData.url);
inspector = inspector.replaceAll("#URL", moreData.url);
} else if (moreData.type == "webcam-image") {
// Prepare the template
inspector += httpGet("/templates/inspectorContentImage.html");
inspector = inspector.replaceAll("#TITLE", moreData.titel);
inspector = inspector.replaceAll("#URL", moreData.url);
} else if (moreData.type == "iframe") {
// Prepare the template
inspector += httpGet("/templates/inspectorContentIframe.html");
inspector = inspector.replaceAll("#TITLE", moreData.titel);
inspector = inspector.replaceAll("#URL", moreData.url);
inspector = inspector.replaceAll("#URL", moreData.url);
} else if (moreData.type == "request-info") {
// Prepare the template
inspector += httpGet("/templates/inspectorGeneral.html");
inspector = inspector.replaceAll("#TITLE", moreData.object.titel);
inspector = inspector.replaceAll("#description", httpGet(moreData.url));
} else {
inspector += httpGet("/templates/inspectorGeneral.html");
inspector = inspector.replaceAll("#TITLE", moreData.titel);
inspector = inspector.replaceAll("#description", moreData.description);
}
// document.getElementById("inspector").innerHTML = inspector;
sidebar.setContent(inspector);
sidebar.show();
if (panTo) {
mymap.panTo([moreData.location.x, moreData.location.y]);
}
} else {
try {
if (!retryConnection) {
toggleModal("popup-modal-no-conn", true);
}
retryConnection = true;
} catch (error) {
error;
}
}
}
// Handles click actions for markers
function onClick(e) {
prepareSidebar(this.options.object.uid);
}
const form = document.getElementById("reportForm");
form.addEventListener("submit", (event) => {
// submit event detected
event.preventDefault();
console.log("Report done by users");
// Change the UI
document.getElementById("reportBtnText").style.display = "none";
document.getElementById("loadingSpinner").style.display = "block";
document.getElementById("submitBtn").disabled = true;
// Get all values
const formy = new FormData(form);
const reason = formy.get("reason");
const email = formy.get("email");
const pointId = document.getElementById("pointId").innerHTML;
const baseUrl =
"/api/internal/report?key=b03f8aaf-1f32-4d9e-914a-9a50f904833d&";
let reqUrl =
baseUrl + "reason=" + reason + "&mail=" + email + "&point_id=" + pointId;
const response = httpGet(reqUrl);
const reponseParsed = JSON.parse(response);
if (reponseParsed.status == "success") {
setTimeout(() => {
document.getElementById("loadingDone").style.display = "block";
document.getElementById("loadingSpinner").style.display = "none";
}, 1000);
setTimeout(() => {
document.getElementById("reportBtnText").style.display = "block";
document.getElementById("loadingSpinner").style.display = "none";
document.getElementById("submitBtn").disabled = false;
document.getElementById("loadingDone").style.display = "none";
toggleModal("report-modal", false);
form.reset();
makeToastNotification("Report successful", "Thank you for your report.");
}, 2000);
} else {
if (reponseParsed.message == "Invalid mail") {
setTimeout(() => {
document.getElementById("reportBtnText").style.display = "block";
document.getElementById("loadingSpinner").style.display = "none";
document.getElementById("loadingDone").style.display = "none";
document.getElementById("submitBtn").disabled = false;
toggleModal("report-modal", false);
form.reset();
document.getElementById("Geomodal-content").innerHTML =
"It seemed like you provided an invalid mail address. Please try again.";
toggleModal("popup-modal", true);
}, 1000);
} else {
setTimeout(() => {
document.getElementById("reportBtnText").style.display = "block";
document.getElementById("loadingSpinner").style.display = "none";
document.getElementById("loadingDone").style.display = "none";
document.getElementById("submitBtn").disabled = false;
toggleModal("report-modal", false);
form.reset();
document.getElementById("Geomodal-content").innerHTML =
"Something went wrong, please try again later";
toggleModal("popup-modal", true);
}, 1000);
}
}
});
function reportPOI(poi_id) {
document.getElementById("pointId").innerHTML = poi_id;
toggleModal("report-modal", true);
/*const url = "/api/internal/report&key=b03f8aaf-1f32-4d9e-914a-9a50f904833d&"
console.log(poi_id)*/
}
function httpGet(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false); // false for synchronous request
xmlHttp.send(null);
return xmlHttp.responseText;
}
function httpGetTriggerForMapData(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, true); // Doing it asynchronous
xmlHttp.send(null);
xmlHttp.onerror = function (e) {
console.log(e);
};
xmlHttp.onloadend = function (e) {
setTimeout(function () {
if (
xmlHttp.responseText.length > 0 &&
!xmlHttp.responseText.includes("502 Bad Gateway")
) {
retryConnection = false;
try {
toggleModal("popup-modal-no-conn", false);
retryConnection = false;
} catch (error) {
error;
}
response = xmlHttp.responseText;
allMarks = 0;
response = JSON.parse(response);
allMarks = response;
markerList = [];
for (h in response) {
item = response[h];
let mIcon = defaultIcon;
if (item.icon == "signalIcon") {
mIcon = signalIcon;
} else if (item.icon == "cctvIcon") {
mIcon = cctvIcon;
} else if (item.icon == "wifiIcon") {
mIcon = wifiIcon;
} else if (item.icon == "temperatureIcon") {
mIcon = temperatureIcon;
}
var marker = new theMarker([item.location.x, item.location.y], {
icon: mIcon,
object: item,
}).on("click", onClick);
markerList.push(marker);
}
// response.forEach(addPin);
markers.clearLayers();
markers.addLayers(markerList);
mymap.addLayer(markers);
syncBtn.state("default"); // Make sure the button is back to default
} else {
try {
if (!retryConnection) {
toggleModal("popup-modal-no-conn", true);
}
retryConnection = true;
} catch (error) {
error;
}
}
}, 50);
};
}
// Try to find where to user is
function home() {
if (navigator.geolocation) {
setTimeout(function () {
navigator.geolocation.getCurrentPosition(showPosition);
}, 200);
} else {
console.warn("Geolocation of user could not be fetched");
}
}
home();
let allMarks = [];
var layerGroup = L.layerGroup().addTo(mymap);
var scale = L.control.scale().addTo(mymap);
var locator = L.control
.locate({
onLocationError: function (err) {
console.log(err);
let tip = err.message;
if (err.message.indexOf("User denied Geolocation") > -1) {
tip =
"You have denied the location request. Please allow it in your browser settings.";
}
document.getElementById("Geomodal-content").innerHTML = tip;
toggleModal("popup-modal", true);
},
})
.addTo(mymap);
/*mymap.addControl(
new L.Control.Fullscreen({
title: {
false: "View Fullscreen",
true: "Exit Fullscreen",
},
})
);*/
var sidebar = L.control.sidebar("sidebar", {
closeButton: true,
position: "right",
});
mymap.addControl(sidebar);
var sidebar2 = L.control.sidebar("sidebar-left", {
// Filter one
closeButton: true,
position: "left",
});
mymap.addControl(sidebar2);
// sidebar2.setContent(httpGet("/templates/filterPage.html"));
L.easyButton("fa-filter", function (btn, map) {
if (sidebar2.isVisible()) {
sidebar2.hide();
} else {
sidebar2.show();
}
}).addTo(mymap);
syncBtn = L.easyButton({
states: [
{
stateName: "default", // name the state
icon: "fa-sync", // and define its properties
title: "Reload POIs", // like its title
onClick: function (btn, map) {
// and its callback
updatePois(); // Update all da fancy POIs
btn.state("loading"); // change state on click!
},
},
{
stateName: "loading",
icon: "fa-sync fa-spin",
title: "Reloading...",
},
],
});
syncBtn.addTo(mymap);
searchBtn = L.easyButton({
states: [
{
stateName: "default", // name the state
icon: "fa-search", // and define its properties
title: "Search", // like its title
onClick: function (btn, map) {
// and its callback
sear.toggle();
btn.state("search"); // change state on click!
},
},
{
stateName: "search",
icon: "fa-search fa-spin",
title: "Hide search",
onClick: function (btn, map) {
// and its callback
sear.toggle();
btn.state("default"); // change state on click!
},
},
],
});
searchBtn.addTo(mymap);
// Start getting the pois
setTimeout(updatePois, 500);
var additionalFilters = "";
function updatePois() {
// Create a filter string
const enabledFilters = [];
try {
for (fi in tagsAvail) {
const tag = tagsAvail[fi];
if (document.getElementById("tag_" + tag).checked ) {
enabledFilters.push(tag);
}
}
additionalFilters =
'{"conjunction": "OR", "filters": [["tag","' + enabledFilters.join('"],["tag","') + '"]]}';
} catch (error) {
console.log("Filter sidebar seems not ready yet");
}
console.log(additionalFilters);
const bounds = mymap.getBounds();
httpGetTriggerForMapData(
"/api/getPOI?boundingEast=" +
bounds.getNorthEast().lat +
";" +
bounds.getNorthEast().lng +
"&boundingWest=" +
bounds.getSouthWest().lat +
";" +
bounds.getSouthWest().lng +
"&key=b03f8aaf-1f32-4d9e-914a-9a50f904833d&filter=" +
additionalFilters
);
}
let prevZoom = mymap.getZoom();
let prevCenter = mymap.getCenter();
let hasCenterChanged = false;
let maxZoomReached = mymap.getZoom();
setTimeout(function () {
prevCenter = mymap.getCenter();
prevZoom = mymap.getZoom();
}, 200);
function getDistanceBetweenCoordinates(lat1, lon1, lat2, lon2) {
var R = 6371; // Radius of the earth in km
var dLat = deg2rad(lat2 - lat1); // deg2rad below
var dLon = deg2rad(lon2 - lon1);
var a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(deg2rad(lat1)) *
Math.cos(deg2rad(lat2)) *
Math.sin(dLon / 2) *
Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c; // Distance in km
return d;
}
function deg2rad(deg) {
return deg * (Math.PI / 180);
}
mymap.on("dragend", function () {
console.info(
getDistanceBetweenCoordinates(
prevCenter.lat,
prevCenter.lng,
mymap.getCenter().lat,
mymap.getCenter().lng
)
);
if (
getDistanceBetweenCoordinates(
prevCenter.lat,
prevCenter.lng,
mymap.getCenter().lat,
mymap.getCenter().lng
) >= 20
) {
setTimeout(updatePois, 2);
console.info("Updating POIs");
}
prevCenter = mymap.getCenter();
maxZoomReached = mymap.getZoom();
hasCenterChanged = true;
});
mymap.on("zoomend", function () {
console.info(mymap.getZoom() - prevZoom);
prevZoom = mymap.getZoom();
if (mymap.getZoom() <= maxZoomReached) {
maxZoomReached = mymap.getZoom();
console.info("Updating POIs");
setTimeout(updatePois, 2);
} else {
if (hasCenterChanged == false) {
veryLongIntegerVariableWhichNoOneWillEverUseHopefully = 42;
} else {
console.info("Updating POIs");
setTimeout(updatePois, 2);
}
}
hasCenterChanged = false;
});
function applyFilter() {
const val = document.getElementById("filter").value;
console.log(val);
additionalFilters =
'{"filters": [["tag", "' + val + '"]], "conjunction": "OR"}'; // {"filters": [["tag", "webcam"]], "conjunction": "OR"}
updatePois();
}
setTimeout(function () {
let lat = -1;
let lng = -1;
let zoom = 5;
let shouldThings = 0;
let point_id = "";
if (window.location.href.indexOf("#") > -1) {
point_id = window.location.href.split("#")[1];
prepareSidebar(point_id, true);
setTimeout(updatePois, 500);
} else {
window.location.search
.substr(1)
.split("&")
.forEach(function (item) {
const param = item.split("=");
if (param[0] === "lat" && _.isFinite(param[1])) {
lat = param[1];
shouldThings++;
} else if (param[0] === "lng" && _.isFinite(param[1])) {
lng = param[1];
shouldThings++;
} else if (param[0] === "zoom" && _.isFinite(param[1])) {
zoom = param[1];
shouldThings++;
}
if (shouldThings >= 2) {
mymap.flyTo([lat, lng], zoom);
console.log(lat, lng, zoom);
}
});
}
}, 500);
setInterval(function () {
if (retryConnection) {
updatePois();
}
}, 5000);
mymap.on("contextmenu.show", (e) => {
mymap.contextmenu.removeItem(0);
mymap.contextmenu.insertItem(
{
text:
"<b class='background-color=\"red\"'>" +
e.latlng.lat.toFixed(4) +
", " +
e.latlng.lng.toFixed(4) +
"</b>",
callback: copyLocation,
},
0
);
});
sear = L.control.search({ position: "topleft" });
mymap.addControl(sear);
+1
View File
@@ -0,0 +1 @@
var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=[],d=0,e=this.data.length;e>d;d++){var f=this.data.charCodeAt(d);f>65536?(b[0]=240|(1835008&f)>>>18,b[1]=128|(258048&f)>>>12,b[2]=128|(4032&f)>>>6,b[3]=128|63&f):f>2048?(b[0]=224|(61440&f)>>>12,b[1]=128|(4032&f)>>>6,b[2]=128|63&f):f>128?(b[0]=192|(1984&f)>>>6,b[1]=128|63&f):b[0]=f,this.parsedData=this.parsedData.concat(b)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function i(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c<a.length&&0==a[c];)c++;this.num=new Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}function j(a,b){this.totalCount=a,this.dataCount=b}function k(){this.buffer=[],this.length=0}function m(){return"undefined"!=typeof CanvasRenderingContext2D}function n(){var a=!1,b=navigator.userAgent;return/android/i.test(b)&&(a=!0,aMat=b.toString().match(/android ([0-9]\.[0-9])/i),aMat&&aMat[1]&&(a=parseFloat(aMat[1]))),a}function r(a,b){for(var c=1,e=s(a),f=0,g=l.length;g>=f;f++){var h=0;switch(b){case d.L:h=l[f][0];break;case d.M:h=l[f][1];break;case d.Q:h=l[f][2];break;case d.H:h=l[f][3]}if(h>=e)break;c++}if(c>l.length)throw new Error("Too long data");return c}function s(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=new Array(this.moduleCount);for(var e=0;e<this.moduleCount;e++)this.modules[d][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,c),this.typeNumber>=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(this.modules[a+c][b+d]=c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?!0:!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=f.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f<this.modules.length;f++)for(var g=f*e,h=0;h<this.modules[f].length;h++){var i=h*e,j=this.modules[f][h];j&&(d.beginFill(0,100),d.moveTo(i,g),d.lineTo(i+e,g),d.lineTo(i+e,g+e),d.lineTo(i,g+e),d.endFill())}return d},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(var b=8;b<this.moduleCount-8;b++)null==this.modules[6][b]&&(this.modules[6][b]=0==b%2)},setupPositionAdjustPattern:function(){for(var a=f.getPatternPosition(this.typeNumber),b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(null==this.modules[d][e])for(var g=-2;2>=g;g++)for(var h=-2;2>=h;h++)this.modules[d+g][e+h]=-2==g||2==g||-2==h||2==h||0==g&&0==h?!0:!1}},setupTypeNumber:function(a){for(var b=f.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=f.getBCHTypeInfo(c),e=0;15>e;e++){var g=!a&&1==(1&d>>e);6>e?this.modules[e][8]=g:8>e?this.modules[e+1][8]=g:this.modules[this.moduleCount-15+e][8]=g}for(var e=0;15>e;e++){var g=!a&&1==(1&d>>e);8>e?this.modules[8][this.moduleCount-e-1]=g:9>e?this.modules[8][15-e-1+1]=g:this.modules[8][15-e-1]=g}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,g=0,h=this.moduleCount-1;h>0;h-=2)for(6==h&&h--;;){for(var i=0;2>i;i++)if(null==this.modules[d][h-i]){var j=!1;g<a.length&&(j=1==(1&a[g]>>>e));var k=f.getMask(b,d,h-i);k&&(j=!j),this.modules[d][h-i]=j,e--,-1==e&&(g++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,d){for(var e=j.getRSBlocks(a,cLine truncated
+74
View File
@@ -0,0 +1,74 @@
/* eslint-disable no-undef */
function httpGet(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false); // false for synchronous request
try {
xmlHttp.send(null);
} catch (error) {
try {
if (!retryConnection) {
toggleModal("popup-modal-no-conn", true);
}
retryConnection = true;
} catch (error) {
error;
}
}
return xmlHttp.responseText;
}
function home() {
if (navigator.geolocation) {
setTimeout(function () {
navigator.geolocation.getCurrentPosition(showPosition);
}, 200);
} else {
console.warn("Geolocation of user could not be fetched");
}
}
function on() {
document.getElementById("overlay").style.display = "block";
}
function off() {
document.getElementById("overlay").style.display = "none";
}
function makeToastNotification(title, message) {
document.getElementById("notificationToast").style.display = "block";
document.getElementById("toast_title").innerHTML = title;
document.getElementById("toast_desc").innerHTML = message;
try {
setTimeout(function () {
document
.getElementById("notificationToast")
.classList.remove("animate-right");
document
.getElementById("notificationToast")
.classList.add("animate-right-back");
setTimeout(function () {
document.getElementById("notificationToast").style.display = "none";
setTimeout(function () {
document
.getElementById("notificationToast")
.classList.add("animate-right");
document
.getElementById("notificationToast")
.classList.remove("animate-right-back");
}, 50);
}, 500);
}, 2000);
} catch (error) {
console.warn(
"Failed to show toast notification with title: `" +
title +
"` and message: `" +
message +
"`"
);
alert(title + " \n" + message);
}
}
+60
View File
@@ -0,0 +1,60 @@
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}
.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}
.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}
/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
background-color: rgb(181, 226, 140);
}
.leaflet-oldie .marker-cluster-small div {
background-color: rgb(110, 204, 57);
}
.leaflet-oldie .marker-cluster-medium {
background-color: rgb(241, 211, 87);
}
.leaflet-oldie .marker-cluster-medium div {
background-color: rgb(240, 194, 12);
}
.leaflet-oldie .marker-cluster-large {
background-color: rgb(253, 156, 115);
}
.leaflet-oldie .marker-cluster-large div {
background-color: rgb(241, 128, 23);
}
.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;
text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}
+14
View File
@@ -0,0 +1,14 @@
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}
.leaflet-cluster-spider-leg {
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1 @@
{"version":3,"file":"leaflet.markercluster-src.js","sources":["../src/MarkerClusterGroup.js","../src/MarkerCluster.js","../src/MarkerOpacity.js","../src/DistanceGrid.js","../src/MarkerCluster.QuickHull.js","../src/MarkerCluster.Spiderfier.js","../src/MarkerClusterGroup.Refresh.js"],"sourcesContent":["/*\r\n * L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within\r\n */\r\n\r\nexport var MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({\r\n\r\n\toptions: {\r\n\t\tmaxClusterRadius: 80, //A cluster will cover at most this many pixels from its center\r\n\t\ticonCreateFunction: null,\r\n\t\tclusterPane: L.Marker.prototype.options.pane,\r\n\r\n\t\tspiderfyOnMaxZoom: true,\r\n\t\tshowCoverageOnHover: true,\r\n\t\tzoomToBoundsOnClick: true,\r\n\t\tsingleMarkerMode: false,\r\n\r\n\t\tdisableClusteringAtZoom: null,\r\n\r\n\t\t// Setting this to false prevents the removal of any clusters outside of the viewpoint, which\r\n\t\t// is the default behaviour for performance reasons.\r\n\t\tremoveOutsideVisibleBounds: true,\r\n\r\n\t\t// Set to false to disable all animations (zoom and spiderfy).\r\n\t\t// If false, option animateAddingMarkers below has no effect.\r\n\t\t// If L.DomUtil.TRANSITION is falsy, this option has no effect.\r\n\t\tanimate: true,\r\n\r\n\t\t//Whether to animate adding markers after adding the MarkerClusterGroup to the map\r\n\t\t// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.\r\n\t\tanimateAddingMarkers: false,\r\n\r\n\t\t//Increase to increase the distance away that spiderfied markers appear from the center\r\n\t\tspiderfyDistanceMultiplier: 1,\r\n\r\n\t\t// Make it possible to specify a polyline options on a spider leg\r\n\t\tspiderLegPolylineOptions: { weight: 1.5, color: '#222', opacity: 0.5 },\r\n\r\n\t\t// When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts\r\n\t\tchunkedLoading: false,\r\n\t\tchunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)\r\n\t\tchunkDelay: 50, // at the end of each interval, give n milliseconds back to system/browser\r\n\t\tchunkProgress: null, // progress callback: function(processed, total, elapsed) (e.g. for a progress indicator)\r\n\r\n\t\t//Options to pass to the L.Polygon constructor\r\n\t\tpolygonOptions: {}\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tL.Util.setOptions(this, options);\r\n\t\tif (!this.options.iconCreateFunction) {\r\n\t\t\tthis.options.iconCreateFunction = this._defaultIconCreateFunction;\r\n\t\t}\r\n\r\n\t\tthis._featureGroup = L.featureGroup();\r\n\t\tthis._featureGroup.addEventParent(this);\r\n\r\n\t\tthis._nonPointGroup = L.featureGroup();\r\n\t\tthis._nonPointGroup.addEventParent(this);\r\n\r\n\t\tthis._inZoomAnimation = 0;\r\n\t\tthis._needsClustering = [];\r\n\t\tthis._needsRemoving = []; //Markers removed while we aren't on the map need to be kept track of\r\n\t\t//The bounds of the currently shown area (from _getExpandedVisibleBounds) Updated on zoom/move\r\n\t\tthis._currentShownBounds = null;\r\n\r\n\t\tthis._queue = [];\r\n\r\n\t\tthis._childMarkerEventHandlers = {\r\n\t\t\t'dragstart': this._childMarkerDragStart,\r\n\t\t\t'move': this._childMarkerMoved,\r\n\t\t\t'dragend': this._childMarkerDragEnd,\r\n\t\t};\r\n\r\n\t\t// Hook the appropriate animation methods.\r\n\t\tvar animate = L.DomUtil.TRANSITION && this.options.animate;\r\n\t\tL.extend(this, animate ? this._withAnimation : this._noAnimation);\r\n\t\t// Remember which MarkerCluster class to instantiate (animated or not).\r\n\t\tthis._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated;\r\n\t},\r\n\r\n\taddLayer: function (layer) {\r\n\r\n\t\tif (layer instanceof L.LayerGroup) {\r\n\t\t\treturn this.addLayers([layer]);\r\n\t\t}\r\n\r\n\t\t//Don't cluster non point data\r\n\t\tif (!layer.getLatLng) {\r\n\t\t\tthis._nonPointGroup.addLayer(layer);\r\n\t\t\tthis.fire('layeradd', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!this._map) {\r\n\t\t\tthis._needsClustering.push(layer);\r\n\t\t\tthis.fire('layeradd', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (this.hasLayer(layer)) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\r\n\t\t//If we have already clustered we'll need to add this one to a cluster\r\n\r\n\t\tif (this._unspiderfy) {\r\n\t\t\tthis._unspiderfy();\r\n\t\t}\r\n\r\n\t\tthis._addLayer(layer, this._maxZoom);\r\n\t\tthis.fire('layeradd', { layer: layer });\r\n\r\n\t\t// Refresh bounds and weighted positions.\r\n\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\t//Work out what is visible\r\n\t\tvar visibleLayer = layer,\r\n\t\t currentZoom = this._zoom;\r\n\t\tif (layer.__parent) {\r\n\t\t\twhile (visibleLayer.__parent._zoom >= currentZoom) {\r\n\t\t\t\tvisibleLayer = visibleLayer._Line truncated
+3
View File
@@ -0,0 +1,3 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Leaflet=e.Leaflet||{},e.Leaflet.markercluster=e.Leaflet.markercluster||{}))}(this,function(e){"use strict";var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i,n=this._featureGroup,r=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,u=!0;if(this._map){var _=(new Date).getTime(),d=L.bind(function(){for(var c=(new Date).getTime();h>l;l++){if(s&&0===l%200){var p=(new Date).getTime()-c;if(p>o)break}if(i=e[l],i instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var f=i.__parent.getAllChildMarkers(),m=f[0]===i?f[1]:f[0];n.removeLayer(m)}}else r.addLayer(i),t||this.fire("layeradd",{layer:i})}a&&a(l,h,(new Date).getTime()-_),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var c=this._needsClustering;h>l;l++)i=e[l],i instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||c.push(i):r.addLayer(i);return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=n;for(t=0;h>t;t++)i=a[t],i instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerLine truncated
},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=i});
//# sourceMappingURL=leaflet.markercluster.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["../src/MarkerClusterGroup.js","../src/MarkerCluster.js","../src/MarkerOpacity.js","../src/DistanceGrid.js","../src/MarkerCluster.QuickHull.js","../src/MarkerCluster.Spiderfier.js","../src/MarkerClusterGroup.Refresh.js"],"names":[],"mappings":"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 truncated
@@ -0,0 +1,54 @@
.leaflet-contextmenu {
display: none;
box-shadow: 0 1px 7px rgba(0,0,0,0.4);
-webkit-border-radius: 4px;
border-radius: 4px;
padding: 4px 0;
background-color: #fff;
cursor: default;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.leaflet-contextmenu a.leaflet-contextmenu-item {
display: block;
color: #222;
font-size: 12px;
line-height: 20px;
text-decoration: none;
padding: 0 12px;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
cursor: default;
outline: none;
}
.leaflet-contextmenu a.leaflet-contextmenu-item-disabled {
opacity: 0.5;
}
.leaflet-contextmenu a.leaflet-contextmenu-item.over {
background-color: #f4f4f4;
border-top: 1px solid #f0f0f0;
border-bottom: 1px solid #f0f0f0;
}
.leaflet-contextmenu a.leaflet-contextmenu-item-disabled.over {
background-color: inherit;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
}
.leaflet-contextmenu-icon {
margin: 2px 8px 0 0;
width: 16px;
height: 16px;
float: left;
border: 0;
}
.leaflet-contextmenu-separator {
border-bottom: 1px solid #ccc;
margin: 5px 0;
}
@@ -0,0 +1,592 @@
/*
Leaflet.contextmenu, a context menu for Leaflet.
(c) 2015, Adam Ratcliffe, GeoSmart Maps Limited
@preserve
*/
(function(factory) {
// Packaging/modules magic dance
var L;
if (typeof define === 'function' && define.amd) {
// AMD
define(['leaflet'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') {
// Node/CommonJS
L = require('leaflet');
module.exports = factory(L);
} else {
// Browser globals
if (typeof window.L === 'undefined') {
throw new Error('Leaflet must be loaded first');
}
factory(window.L);
}
})(function(L) {
L.Map.mergeOptions({
contextmenuItems: []
});
L.Map.ContextMenu = L.Handler.extend({
_touchstart: L.Browser.msPointer ? 'MSPointerDown' : L.Browser.pointer ? 'pointerdown' : 'touchstart',
statics: {
BASE_CLS: 'leaflet-contextmenu'
},
initialize: function (map) {
L.Handler.prototype.initialize.call(this, map);
this._items = [];
this._visible = false;
var container = this._container = L.DomUtil.create('div', L.Map.ContextMenu.BASE_CLS, map._container);
container.style.zIndex = 10000;
container.style.position = 'absolute';
if (map.options.contextmenuWidth) {
container.style.width = map.options.contextmenuWidth + 'px';
}
this._createItems();
L.DomEvent
.on(container, 'click', L.DomEvent.stop)
.on(container, 'mousedown', L.DomEvent.stop)
.on(container, 'dblclick', L.DomEvent.stop)
.on(container, 'contextmenu', L.DomEvent.stop);
},
addHooks: function () {
var container = this._map.getContainer();
L.DomEvent
.on(container, 'mouseleave', this._hide, this)
.on(document, 'keydown', this._onKeyDown, this);
if (L.Browser.touch) {
L.DomEvent.on(document, this._touchstart, this._hide, this);
}
this._map.on({
contextmenu: this._show,
mousedown: this._hide,
zoomstart: this._hide
}, this);
},
removeHooks: function () {
var container = this._map.getContainer();
L.DomEvent
.off(container, 'mouseleave', this._hide, this)
.off(document, 'keydown', this._onKeyDown, this);
if (L.Browser.touch) {
L.DomEvent.off(document, this._touchstart, this._hide, this);
}
this._map.off({
contextmenu: this._show,
mousedown: this._hide,
zoomstart: this._hide
}, this);
},
showAt: function (point, data) {
if (point instanceof L.LatLng) {
point = this._map.latLngToContainerPoint(point);
}
this._showAtPoint(point, data);
},
hide: function () {
this._hide();
},
addItem: function (options) {
return this.insertItem(options);
},
insertItem: function (options, index) {
index = index !== undefined ? index: this._items.length;
var item = this._createItem(this._container, options, index);
this._items.push(item);
this._sizeChanged = true;
this._map.fire('contextmenu.additem', {
contextmenu: this,
el: item.el,
index: index
});
return item.el;
},
removeItem: function (item) {
var container = this._container;
if (!isNaN(item)) {
item = container.children[item];
}
if (item) {
this._removeItem(L.Util.stamp(item));
this._sizeChanged = true;
this._map.fire('contextmenu.removeitem', {
contextmenu: this,
el: item
});
return item;
}
return null;
},
removeAllItems: function () {
var items = this._container.children,
item;
while (items.length) {
item = items[0];
this._removeItem(L.Util.stamp(item));
}
return items;
},
hideAllItems: function () {
var item, i, l;
for (i = 0, l = this._items.length; i < l; i++) {
item = this._items[i];
item.el.style.display = 'none';
}
},
showAllItems: function () {
var item, i, l;
for (i = 0, l = this._items.length; i < l; i++) {
item = this._items[i];
item.el.style.display = '';
}
},
setDisabled: function (item, disabled) {
var container = this._container,
itemCls = L.Map.ContextMenu.BASE_CLS + '-item';
if (!isNaN(item)) {
item = container.children[item];
}
if (item && L.DomUtil.hasClass(item, itemCls)) {
if (disabled) {
L.DomUtil.addClass(item, itemCls + '-disabled');
this._map.fire('contextmenu.disableitem', {
contextmenu: this,
el: item
});
} else {
L.DomUtil.removeClass(item, itemCls + '-disabled');
this._map.fire('contextmenu.enableitem', {
contextmenu: this,
el: item
});
}
}
},
isVisible: function () {
return this._visible;
},
_createItems: function () {
var itemOptions = this._map.options.contextmenuItems,
item,
i, l;
for (i = 0, l = itemOptions.length; i < l; i++) {
this._items.push(this._createItem(this._container, itemOptions[i]));
}
},
_createItem: function (container, options, index) {
if (options.separator || options === '-') {
return this._createSeparator(container, index);
}
var itemCls = L.Map.ContextMenu.BASE_CLS + '-item',
cls = options.disabled ? (itemCls + ' ' + itemCls + '-disabled') : itemCls,
el = this._insertElementAt('a', cls, container, index),
callback = this._createEventHandler(el, options.callback, options.context, options.hideOnSelect),
icon = this._getIcon(options),
iconCls = this._getIconCls(options),
html = '';
if (icon) {
html = '<img class="' + L.Map.ContextMenu.BASE_CLS + '-icon" src="' + icon + '"/>';
} else if (iconCls) {
html = '<span class="' + L.Map.ContextMenu.BASE_CLS + '-icon ' + iconCls + '"></span>';
}
el.innerHTML = html + options.text;
el.href = '#';
L.DomEvent
.on(el, 'mouseover', this._onItemMouseOver, this)
.on(el, 'mouseout', this._onItemMouseOut, this)
.on(el, 'mousedown', L.DomEvent.stopPropagation)
.on(el, 'click', callback);
if (L.Browser.touch) {
L.DomEvent.on(el, this._touchstart, L.DomEvent.stopPropagation);
}
// Devices without a mouse fire "mouseover" on tap, but never “mouseout"
if (!L.Browser.pointer) {
L.DomEvent.on(el, 'click', this._onItemMouseOut, this);
}
return {
id: L.Util.stamp(el),
el: el,
callback: callback
};
},
_removeItem: function (id) {
var item,
el,
i, l, callback;
for (i = 0, l = this._items.length; i < l; i++) {
item = this._items[i];
if (item.id === id) {
el = item.el;
callback = item.callback;
if (callback) {
L.DomEvent
.off(el, 'mouseover', this._onItemMouseOver, this)
.off(el, 'mouseover', this._onItemMouseOut, this)
.off(el, 'mousedown', L.DomEvent.stopPropagation)
.off(el, 'click', callback);
if (L.Browser.touch) {
L.DomEvent.off(el, this._touchstart, L.DomEvent.stopPropagation);
}
if (!L.Browser.pointer) {
L.DomEvent.on(el, 'click', this._onItemMouseOut, this);
}
}
this._container.removeChild(el);
this._items.splice(i, 1);
return item;
}
}
return null;
},
_createSeparator: function (container, index) {
var el = this._insertElementAt('div', L.Map.ContextMenu.BASE_CLS + '-separator', container, index);
return {
id: L.Util.stamp(el),
el: el
};
},
_createEventHandler: function (el, func, context, hideOnSelect) {
var me = this,
map = this._map,
disabledCls = L.Map.ContextMenu.BASE_CLS + '-item-disabled',
hideOnSelect = (hideOnSelect !== undefined) ? hideOnSelect : true;
return function (e) {
if (L.DomUtil.hasClass(el, disabledCls)) {
return;
}
var map = me._map,
containerPoint = me._showLocation.containerPoint,
layerPoint = map.containerPointToLayerPoint(containerPoint),
latlng = map.layerPointToLatLng(layerPoint),
relatedTarget = me._showLocation.relatedTarget,
data = {
containerPoint: containerPoint,
layerPoint: layerPoint,
latlng: latlng,
relatedTarget: relatedTarget
};
if (hideOnSelect) {
me._hide();
}
if (func) {
func.call(context || map, data);
}
me._map.fire('contextmenu.select', {
contextmenu: me,
el: el
});
};
},
_insertElementAt: function (tagName, className, container, index) {
var refEl,
el = document.createElement(tagName);
el.className = className;
if (index !== undefined) {
refEl = container.children[index];
}
if (refEl) {
container.insertBefore(el, refEl);
} else {
container.appendChild(el);
}
return el;
},
_show: function (e) {
this._showAtPoint(e.containerPoint, e);
},
_showAtPoint: function (pt, data) {
if (this._items.length) {
var map = this._map,
event = L.extend(data || {}, {contextmenu: this});
this._showLocation = {
containerPoint: pt
};
if (data && data.relatedTarget){
this._showLocation.relatedTarget = data.relatedTarget;
}
this._setPosition(pt);
if (!this._visible) {
this._container.style.display = 'block';
this._visible = true;
}
this._map.fire('contextmenu.show', event);
}
},
_hide: function () {
if (this._visible) {
this._visible = false;
this._container.style.display = 'none';
this._map.fire('contextmenu.hide', {contextmenu: this});
}
},
_getIcon: function (options) {
return L.Browser.retina && options.retinaIcon || options.icon;
},
_getIconCls: function (options) {
return L.Browser.retina && options.retinaIconCls || options.iconCls;
},
_setPosition: function (pt) {
var mapSize = this._map.getSize(),
container = this._container,
containerSize = this._getElementSize(container),
anchor;
if (this._map.options.contextmenuAnchor) {
anchor = L.point(this._map.options.contextmenuAnchor);
pt = pt.add(anchor);
}
container._leaflet_pos = pt;
if (pt.x + containerSize.x > mapSize.x) {
container.style.left = 'auto';
container.style.right = Math.min(Math.max(mapSize.x - pt.x, 0), mapSize.x - containerSize.x - 1) + 'px';
} else {
container.style.left = Math.max(pt.x, 0) + 'px';
container.style.right = 'auto';
}
if (pt.y + containerSize.y > mapSize.y) {
container.style.top = 'auto';
container.style.bottom = Math.min(Math.max(mapSize.y - pt.y, 0), mapSize.y - containerSize.y - 1) + 'px';
} else {
container.style.top = Math.max(pt.y, 0) + 'px';
container.style.bottom = 'auto';
}
},
_getElementSize: function (el) {
var size = this._size,
initialDisplay = el.style.display;
if (!size || this._sizeChanged) {
size = {};
el.style.left = '-999999px';
el.style.right = 'auto';
el.style.display = 'block';
size.x = el.offsetWidth;
size.y = el.offsetHeight;
el.style.left = 'auto';
el.style.display = initialDisplay;
this._sizeChanged = false;
}
return size;
},
_onKeyDown: function (e) {
var key = e.keyCode;
// If ESC pressed and context menu is visible hide it
if (key === 27) {
this._hide();
}
},
_onItemMouseOver: function (e) {
L.DomUtil.addClass(e.target || e.srcElement, 'over');
},
_onItemMouseOut: function (e) {
L.DomUtil.removeClass(e.target || e.srcElement, 'over');
}
});
L.Map.addInitHook('addHandler', 'contextmenu', L.Map.ContextMenu);
L.Mixin.ContextMenu = {
bindContextMenu: function (options) {
L.setOptions(this, options);
this._initContextMenu();
return this;
},
unbindContextMenu: function (){
this.off('contextmenu', this._showContextMenu, this);
return this;
},
addContextMenuItem: function (item) {
this.options.contextmenuItems.push(item);
},
removeContextMenuItemWithIndex: function (index) {
var items = [];
for (var i = 0; i < this.options.contextmenuItems.length; i++) {
if (this.options.contextmenuItems[i].index == index){
items.push(i);
}
}
var elem = items.pop();
while (elem !== undefined) {
this.options.contextmenuItems.splice(elem,1);
elem = items.pop();
}
},
replaceContextMenuItem: function (item) {
this.removeContextMenuItemWithIndex(item.index);
this.addContextMenuItem(item);
},
_initContextMenu: function () {
this._items = [];
this.on('contextmenu', this._showContextMenu, this);
},
_showContextMenu: function (e) {
var itemOptions,
data, pt, i, l;
if (this._map.contextmenu) {
data = L.extend({relatedTarget: this}, e);
pt = this._map.mouseEventToContainerPoint(e.originalEvent);
if (!this.options.contextmenuInheritItems) {
this._map.contextmenu.hideAllItems();
}
for (i = 0, l = this.options.contextmenuItems.length; i < l; i++) {
itemOptions = this.options.contextmenuItems[i];
this._items.push(this._map.contextmenu.insertItem(itemOptions, itemOptions.index));
}
this._map.once('contextmenu.hide', this._hideContextMenu, this);
this._map.contextmenu.showAt(pt, data);
}
},
_hideContextMenu: function () {
var i, l;
for (i = 0, l = this._items.length; i < l; i++) {
this._map.contextmenu.removeItem(this._items[i]);
}
this._items.length = 0;
if (!this.options.contextmenuInheritItems) {
this._map.contextmenu.showAllItems();
}
}
};
var classes = [L.Marker, L.Path],
defaultOptions = {
contextmenu: false,
contextmenuItems: [],
contextmenuInheritItems: true
},
cls, i, l;
for (i = 0, l = classes.length; i < l; i++) {
cls = classes[i];
// L.Class should probably provide an empty options hash, as it does not test
// for it here and add if needed
if (!cls.prototype.options) {
cls.prototype.options = defaultOptions;
} else {
cls.mergeOptions(defaultOptions);
}
cls.addInitHook(function () {
if (this.options.contextmenu) {
this._initContextMenu();
}
});
cls.include(L.Mixin.ContextMenu);
}
return L.Map.ContextMenu;
});
+1
View File
@@ -0,0 +1 @@
.leaflet-contextmenu{display:none;box-shadow:0 1px 7px rgba(0,0,0,0.4);-webkit-border-radius:4px;border-radius:4px;padding:4px 0;background-color:#fff;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-contextmenu a.leaflet-contextmenu-item{display:block;color:#222;font-size:12px;line-height:20px;text-decoration:none;padding:0 12px;border-top:1px solid transparent;border-bottom:1px solid transparent;cursor:default;outline:0}.leaflet-contextmenu a.leaflet-contextmenu-item-disabled{opacity:.5}.leaflet-contextmenu a.leaflet-contextmenu-item.over{background-color:#f4f4f4;border-top:1px solid #f0f0f0;border-bottom:1px solid #f0f0f0}.leaflet-contextmenu a.leaflet-contextmenu-item-disabled.over{background-color:inherit;border-top:1px solid transparent;border-bottom:1px solid transparent}.leaflet-contextmenu-icon{margin:2px 8px 0 0;width:16px;height:16px;float:left;border:0}.leaflet-contextmenu-separator{border-bottom:1px solid #ccc;margin:5px 0}
+7
View File
@@ -0,0 +1,7 @@
/*
Leaflet.contextmenu, a context menu for Leaflet.
(c) 2015, Adam Ratcliffe, GeoSmart Maps Limited
@preserve
*/
(function(t){var e;if(typeof define==="function"&&define.amd){define(["leaflet"],t)}else if(typeof module==="object"&&typeof module.exports==="object"){e=require("leaflet");module.exports=t(e)}else{if(typeof window.L==="undefined"){throw new Error("Leaflet must be loaded first")}t(window.L)}})(function(t){t.Map.mergeOptions({contextmenuItems:[]});t.Map.ContextMenu=t.Handler.extend({_touchstart:t.Browser.msPointer?"MSPointerDown":t.Browser.pointer?"pointerdown":"touchstart",statics:{BASE_CLS:"leaflet-contextmenu"},initialize:function(e){t.Handler.prototype.initialize.call(this,e);this._items=[];this._visible=false;var n=this._container=t.DomUtil.create("div",t.Map.ContextMenu.BASE_CLS,e._container);n.style.zIndex=1e4;n.style.position="absolute";if(e.options.contextmenuWidth){n.style.width=e.options.contextmenuWidth+"px"}this._createItems();t.DomEvent.on(n,"click",t.DomEvent.stop).on(n,"mousedown",t.DomEvent.stop).on(n,"dblclick",t.DomEvent.stop).on(n,"contextmenu",t.DomEvent.stop)},addHooks:function(){var e=this._map.getContainer();t.DomEvent.on(e,"mouseleave",this._hide,this).on(document,"keydown",this._onKeyDown,this);if(t.Browser.touch){t.DomEvent.on(document,this._touchstart,this._hide,this)}this._map.on({contextmenu:this._show,mousedown:this._hide,zoomstart:this._hide},this)},removeHooks:function(){var e=this._map.getContainer();t.DomEvent.off(e,"mouseleave",this._hide,this).off(document,"keydown",this._onKeyDown,this);if(t.Browser.touch){t.DomEvent.off(document,this._touchstart,this._hide,this)}this._map.off({contextmenu:this._show,mousedown:this._hide,zoomstart:this._hide},this)},showAt:function(e,n){if(e instanceof t.LatLng){e=this._map.latLngToContainerPoint(e)}this._showAtPoint(e,n)},hide:function(){this._hide()},addItem:function(t){return this.insertItem(t)},insertItem:function(t,e){e=e!==undefined?e:this._items.length;var n=this._createItem(this._container,t,e);this._items.push(n);this._sizeChanged=true;this._map.fire("contextmenu.additem",{contextmenu:this,el:n.el,index:e});return n.el},removeItem:function(e){var n=this._container;if(!isNaN(e)){e=n.children[e]}if(e){this._removeItem(t.Util.stamp(e));this._sizeChanged=true;this._map.fire("contextmenu.removeitem",{contextmenu:this,el:e});return e}return null},removeAllItems:function(){var e=this._container.children,n;while(e.length){n=e[0];this._removeItem(t.Util.stamp(n))}return e},hideAllItems:function(){var t,e,n;for(e=0,n=this._items.length;e<n;e++){t=this._items[e];t.el.style.display="none"}},showAllItems:function(){var t,e,n;for(e=0,n=this._items.length;e<n;e++){t=this._items[e];t.el.style.display=""}},setDisabled:function(e,n){var i=this._container,o=t.Map.ContextMenu.BASE_CLS+"-item";if(!isNaN(e)){e=i.children[e]}if(e&&t.DomUtil.hasClass(e,o)){if(n){t.DomUtil.addClass(e,o+"-disabled");this._map.fire("contextmenu.disableitem",{contextmenu:this,el:e})}else{t.DomUtil.removeClass(e,o+"-disabled");this._map.fire("contextmenu.enableitem",{contextmenu:this,el:e})}}},isVisible:function(){return this._visible},_createItems:function(){var t=this._map.options.contextmenuItems,e,n,i;for(n=0,i=t.length;n<i;n++){this._items.push(this._createItem(this._container,t[n]))}},_createItem:function(e,n,i){if(n.separator||n==="-"){return this._createSeparator(e,i)}var o=t.Map.ContextMenu.BASE_CLS+"-item",s=n.disabled?o+" "+o+"-disabled":o,h=this._insertElementAt("a",s,e,i),r=this._createEventHandler(h,n.callback,n.context,n.hideOnSelect),a=this._getIcon(n),m=this._getIconCls(n),u="";if(a){u='<img class="'+t.Map.ContextMenu.BASE_CLS+'-icon" src="'+a+'"/>'}else if(m){u='<span class="'+t.Map.ContextMenu.BASE_CLS+"-icon "+m+'"></span>'}h.innerHTML=u+n.text;h.href="#";t.DomEvent.on(h,"mouseover",this._onItemMouseOver,this).on(h,"mouseout",this._onItemMouseOut,this).on(h,"mousedown",t.DomEvent.stopPropagation).on(h,"click",r);if(t.Browser.touch){t.DomEvent.on(h,this._touchstart,t.DomEvent.stopPropagation)}if(!t.Browser.pointer){t.DomEvent.on(h,"click",this._onItemMouseOut,this)}return{id:t.Util.stamp(h),el:h,callback:r}},_removeItem:function(e){var n,i,o,s,h;for(o=0,s=this._items.length;o<s;o++){n=this._items[o];if(n.id===e){i=n.el;h=n.callback;if(h){t.DomEvent.off(i,"mouseover",this._onItemMouseOver,this).off(i,"mouseover",this._onItemMouseOut,this).off(i,"mousedown",t.DomEvent.stopPropagation).off(i,"click",h);if(t.Browser.touch){t.DomEvent.off(i,this._touchstart,t.DomEvent.stopPropagation)}if(!t.Browser.pointer){t.DomEvent.on(i,"click",this._onItemMouseOut,this)}}this._container.removeChild(i);this._items.splice(o,1);return n}}return null},_createSeparator:function(e,n){var i=this._insertElementAt("div",t.Map.ContextMenu.BASE_CLS+"-separator",e,n);return{id:t.Util.stamp(i),el:i}},_createEventHandler:function(e,n,i,o){var s=this,h=this._map,r=t.Map.ContextMenu.BASE_CLS+"-item-disabled",o=o!==undefined?o:true;return function(h){if(t.DomUtil.hasClass(e,r)){return}var a=s._map,m=s._showLocation.containerPoint,u=a.containerPointToLayerPoint(m),l=a.layerPointToLatLng(u)Line truncated
+41
View File
@@ -0,0 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/favicon\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/favicon\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/favicon\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/favicon\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/favicon\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/favicon\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
+41
View File
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8" />
<title>Pointsight is offline</title>
<meta name="description" content="This is the Pointsight fallback website." />
<meta name="author" content="[Project-Name-Here]" />
<!-- Mobile Specific Metas
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- CSS
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="/css/tailwindInclude.css" />
<!-- Favicon
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="icon" type="image/png" href="images/favicon-16.png" />
</head>
<body>
<div class="bg-gradient-to-r
from-purple-400
via-pink-500
to-red-500
animate-gradient-xy">
<div class="flex items-center justify-center h-screen">
<div class="text-black rounded-lg shadow-lg p-10 bg-gray-50 dark:bg-gray-800 dark:text-white text-center">
<h1 class="text-6xl">Offline</h1>
<p class="text-4xl">That's not good</p>
<p>Huh, it seems like one of us is offline.<br> If you are sure that you are only, maybe we have a problem. Please check later!</p><br>
</div>
</div>
</body>
</html>
Loaded 100 of 175 files, more files were not shown because too many files have changed in this diff. Show more