diff --git a/src/renderer/components/AirportLayer.vue b/src/renderer/components/AirportLayer.vue index c051a31..cb8564c 100644 --- a/src/renderer/components/AirportLayer.vue +++ b/src/renderer/components/AirportLayer.vue @@ -4,7 +4,7 @@ \ No newline at end of file diff --git a/src/renderer/components/ToolButton.vue b/src/renderer/components/ToolButton.vue new file mode 100644 index 0000000..93a61cd --- /dev/null +++ b/src/renderer/components/ToolButton.vue @@ -0,0 +1,64 @@ + + + + + \ No newline at end of file diff --git a/src/renderer/components/ToolLayer.vue b/src/renderer/components/ToolLayer.vue new file mode 100644 index 0000000..41a34e0 --- /dev/null +++ b/src/renderer/components/ToolLayer.vue @@ -0,0 +1,69 @@ + + + + + + diff --git a/src/renderer/components/ZoomButton.vue b/src/renderer/components/ZoomButton.vue new file mode 100644 index 0000000..ad9dfde --- /dev/null +++ b/src/renderer/components/ZoomButton.vue @@ -0,0 +1,64 @@ + + + + + \ No newline at end of file diff --git a/src/renderer/leaflet/EditControl.js b/src/renderer/leaflet/EditControl.js index 8d16bbe..fcbf0d2 100644 --- a/src/renderer/leaflet/EditControl.js +++ b/src/renderer/leaflet/EditControl.js @@ -2,7 +2,7 @@ L.EditControl = L.Control.extend({ options: { - position: 'topleft', + position: 'topright', callback: null, kind: '', html: '', @@ -44,6 +44,33 @@ L.NewMarkerControl = L.EditControl.extend({ callback: null, kind: 'marker', html: '🖈' - } + }, + onAdd: function (map) { + var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'), + link = L.DomUtil.create('a', '', container); + + link.href = '#'; + link.title = this.options.tooltip; + link.innerHTML = this.options.html; + link.callback = this.options.callback; + link.addEventListener('click',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + }, false); + link.addEventListener('mousedown',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + window.LAYER = this.callback.call(map.editTools); + }, false); + link.addEventListener('mouseup',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + }, false); + return container; + } }); + diff --git a/src/renderer/leaflet/ToolControl.js b/src/renderer/leaflet/ToolControl.js new file mode 100644 index 0000000..d456706 --- /dev/null +++ b/src/renderer/leaflet/ToolControl.js @@ -0,0 +1,36 @@ +/* eslint-disable */ +L.ToolControl = L.Control.extend({ + options: { + position: 'bottomright', + callback: null, + kind: 'marker', + html: '🖈' + }, + + onAdd: function (map) { + var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'), + link = L.DomUtil.create('a', '', container); + + link.href = '#'; + link.title = this.options.tooltip; + link.innerHTML = this.options.html; + link.callback = this.options.callback; + link.addEventListener('click',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + }, false); + link.addEventListener('mousedown',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + window.LAYER = this.callback.call(map.editTools); + }, false); + link.addEventListener('mouseup',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + }, false); + return container; + } +}); diff --git a/src/renderer/leaflet/ZoomControl.js b/src/renderer/leaflet/ZoomControl.js new file mode 100644 index 0000000..f7a4d0a --- /dev/null +++ b/src/renderer/leaflet/ZoomControl.js @@ -0,0 +1,76 @@ +/* eslint-disable */ +L.ZoomControl = L.Control.extend({ + + options: { + position: 'topleft', + callback: null, + kind: '', + html: '', + tooltip: 'tooltip' + }, + + onAdd: function (map) { + var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'), + link = L.DomUtil.create('a', '', container); + + link.href = '#'; + link.title = this.options.tooltip; + link.innerHTML = this.options.html; + link.callback = this.options.callback; + link.addEventListener('click',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + }, false); + link.addEventListener('mousedown',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + window.LAYER = this.callback.call(map.editTools); + }, false); + link.addEventListener('mouseup',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + }, false); + return container; + } +}); + + +L.NewMarkerControl = L.EditControl.extend({ + options: { + position: 'topright', + callback: null, + kind: 'marker', + html: '🖈' + }, + + onAdd: function (map) { + var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'), + link = L.DomUtil.create('a', '', container); + + link.href = '#'; + link.title = this.options.tooltip; + link.innerHTML = this.options.html; + link.callback = this.options.callback; + link.addEventListener('click',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + }, false); + link.addEventListener('mousedown',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + window.LAYER = this.callback.call(map.editTools); + }, false); + link.addEventListener('mouseup',function (event) { + event.stopPropagation(); + event.preventDefault(); + event.stopImmediatePropagation(); + }, false); + return container; + } +}); +