Holdpoint nodes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="BLABLA">
|
||||
<div id="EditBar">
|
||||
<EditButton icon="fas fa-edit" v-on:click="edit" :show="!editing" tooltip="Edit"></EditButton>
|
||||
<EditButton icon="fas fa-undo" v-on:click="centerDialogVisible = true" :show="editing" tooltip="Undo"></EditButton>
|
||||
<el-dialog title="Reload" :visible.sync="centerDialogVisible" width="30%" center>
|
||||
|
||||
@@ -188,9 +188,12 @@
|
||||
})
|
||||
},
|
||||
editedNode() {
|
||||
var isOnRunway = this.$store.state.Editable.data.node.isOnRunway;
|
||||
var isOnRunway = Number(this.$store.state.Editable.data.node.isOnRunway);
|
||||
var isHoldPoint = this.$store.state.Editable.data.node.holdPointType !== 'none' &&
|
||||
this.$store.state.Editable.data.node.holdPointType !== undefined;
|
||||
var nIndex = this.$store.state.Editable.index;
|
||||
var hasRunwayNode = false;
|
||||
var hasHoldPointNode = false;
|
||||
var latlng;
|
||||
this.featureLookup[nIndex].forEach((element,index) => {
|
||||
if (element instanceof L.RunwayNode) {
|
||||
@@ -200,6 +203,13 @@
|
||||
this.featureLookup[nIndex].splice(index,1);
|
||||
}
|
||||
hasRunwayNode = true;
|
||||
} else if (element instanceof L.HoldNode) {
|
||||
if (!isHoldPoint) {
|
||||
// We shouldn't have a RunwayNode
|
||||
element.removeFrom(layerGroup);
|
||||
this.featureLookup[nIndex].splice(index,1);
|
||||
}
|
||||
hasHoldPointNode = true;
|
||||
}
|
||||
else if (element instanceof L.ParkingSpot) {
|
||||
}
|
||||
@@ -225,6 +235,19 @@
|
||||
this.featureLookup[nIndex].push(node);
|
||||
node.addListeners();
|
||||
}
|
||||
if (!hasHoldPointNode && isHoldPoint) {
|
||||
const icon = new L.DivIcon({
|
||||
className: 'custom-div-icon',
|
||||
html: "<div style='background-color:#4838cc;' class='marker-pin'></div><i class='fas fa-hand-paper'></i>",
|
||||
iconSize: [30, 42],
|
||||
iconAnchor: [15, 42]
|
||||
});
|
||||
const node = new L.HoldNode(latlng, { icon: icon });
|
||||
node.glueindex = nIndex;
|
||||
node.addTo(layerGroup);
|
||||
this.featureLookup[nIndex].push(node);
|
||||
node.addListeners();
|
||||
}
|
||||
},
|
||||
closestLayerSnap (eventLatlng, snap) {
|
||||
var layers = []
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="leaflet-sidebar-content">
|
||||
<div class="leaflet-sidebar-pane" id="home">
|
||||
<h1 class="leaflet-sidebar-header">
|
||||
sidebar-v2
|
||||
Help
|
||||
<div class="leaflet-sidebar-close"><i class="fa fa-caret-left"></i></div>
|
||||
</h1>
|
||||
<p>A responsive sidebar for mapping libraries</p>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
*/
|
||||
computed: {
|
||||
options: function () {
|
||||
return [{value: 'node', label: 'node'}, {value: 'PushBack', label: 'PushBack'}, {value: 'normal', label: 'normal'}, {value: 'CAT II/III', label: 'CAT II/III'}]
|
||||
return [{value: 'none', label: 'none'}, {value: 'PushBack', label: 'PushBack'}, {value: 'normal', label: 'normal'}, {value: 'CAT II/III', label: 'CAT II/III'}]
|
||||
},
|
||||
node: function () {
|
||||
return this.$store.state.Editable.type === 'node'
|
||||
|
||||
@@ -77,7 +77,4 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.edit-layer {
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user