Bi Directional Wheelpos
This commit is contained in:
parent
3aea131727
commit
0f890d1593
@ -365,6 +365,7 @@
|
||||
// element.extensions();
|
||||
element.updateMiddleMarker();
|
||||
element.updateVertexFromDirection();
|
||||
element.updateWheelPos();
|
||||
}
|
||||
else if (element instanceof L.Polyline) {
|
||||
if (Number(element.begin) === Number(index)) {
|
||||
@ -480,6 +481,9 @@
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
stopDrawing () {
|
||||
this.$parent.mapObject.editTools.stopDrawing()
|
||||
},
|
||||
drawPolyline () {
|
||||
var polyLine = this.$parent.mapObject.editTools.startPolyline()
|
||||
polyLine.addTo(this.groundnetLayerGroup)
|
||||
@ -563,6 +567,7 @@
|
||||
if (element instanceof L.ParkingSpot) {
|
||||
element.options.attributes = Object.assign({}, this.$store.state.Editable.data.parking)
|
||||
element.updateVertexFromDirection();
|
||||
element.updateWheelPos();
|
||||
}
|
||||
})
|
||||
if (this.$store.state.Editable.data.parking.coords) {
|
||||
@ -603,11 +608,11 @@
|
||||
*/
|
||||
},
|
||||
editedArc() {
|
||||
console.log('Edited Arc : ' + this.$store.state.Editable.index);
|
||||
if (!this.groundnetLayerGroup)
|
||||
return;
|
||||
var arc = this.groundnetLayerGroup.getLayer(this.$store.state.Editable.index);
|
||||
if (arc && arc instanceof L.Polyline) {
|
||||
console.log('Edited Arc : ' + this.$store.state.Editable.index);
|
||||
arc.options.attributes = Object.assign({}, this.$store.state.Editable.data.arc)
|
||||
arc.updateStyle();
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ L.ParkingSpot = L.Circle.extend({
|
||||
var style = {};
|
||||
style['color'] = 'red';
|
||||
this.setStyle(style);
|
||||
element.updateWheelPos();
|
||||
this.updateWheelPos();
|
||||
},
|
||||
deselect() {
|
||||
var style = {};
|
||||
@ -151,6 +151,7 @@ L.ParkingSpot = L.Circle.extend({
|
||||
console.debug("DragEnd Parking : ", event);
|
||||
store.default.dispatch('setParking', event.target.options.attributes);
|
||||
store.default.dispatch('setParkingCoords', event.target.getLatLng().lat.toFixed(5) + ' ' + event.target.getLatLng().lng.toFixed(5));
|
||||
event.target.updateWheelPos();
|
||||
/*
|
||||
store.default.dispatch('setParkingHeading', this.options.attributes.heading)
|
||||
store.default.dispatch('setParkingRadius', this.options.attributes.radius)
|
||||
@ -215,6 +216,29 @@ L.ParkingSpot = L.Circle.extend({
|
||||
},
|
||||
updateStyle: function () {
|
||||
|
||||
},
|
||||
selectParking() {
|
||||
|
||||
store.default.dispatch('setParking', this.options.attributes);
|
||||
store.default.dispatch('setParkingCoords', this.getLatLng().lat.toFixed(5) + ' ' + this.getLatLng().lng.toFixed(5));
|
||||
|
||||
this.select();
|
||||
this.unwatch = store.default.watch(
|
||||
function (state) {
|
||||
return state.Editable.data.parking;
|
||||
},
|
||||
(state) => {
|
||||
if(state === undefined ||
|
||||
state.index !== Number(this.options.attributes.index)) {
|
||||
this.deselect();
|
||||
this.unwatch();
|
||||
}
|
||||
}
|
||||
,
|
||||
{
|
||||
deep: true //add this if u need to watch object properties change etc.
|
||||
}
|
||||
);
|
||||
},
|
||||
turfToLatLng: function (turfPoint) {
|
||||
return {lat: turfPoint.geometry.coordinates[1], lng: turfPoint.geometry.coordinates[0]};
|
||||
|
@ -132,6 +132,11 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
|
||||
console.log(event)
|
||||
});
|
||||
this.on('editable:vertex:clicked', function (event) {
|
||||
var parking = this.featureLookup[event.vertex.latlng.glueindex].filter(n => n instanceof L.ParkingSpot);
|
||||
if(parking.length>0) {
|
||||
parking[0].selectParking();
|
||||
} else {
|
||||
this.editLayer.featureLookup[event.vertex.latlng.glueindex].forEach
|
||||
store.default.dispatch('setNode', event.vertex.latlng)
|
||||
if(event.vertex._icon!=null) {
|
||||
event.vertex._icon.style['background-color'] = 'red';
|
||||
@ -178,6 +183,7 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
|
||||
deep: true //add this if u need to watch object properties change etc.
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
var dragIndex = -1;
|
||||
this.on('editable:vertex:dragstart', function (event) {
|
||||
@ -199,7 +205,13 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
|
||||
});
|
||||
}
|
||||
dragIndex = -1;
|
||||
var parking = this.featureLookup[event.vertex.latlng.glueindex].filter(n => n instanceof L.ParkingSpot);
|
||||
if(parking.length>0) {
|
||||
parking[0].selectParking();
|
||||
} else {
|
||||
store.default.dispatch('setNode', event.vertex.latlng)
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
/**
|
||||
@ -222,6 +234,7 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
|
||||
// element.extensions();
|
||||
element.updateMiddleMarker();
|
||||
element.updateVertexFromDirection();
|
||||
element.updateWheelPos();
|
||||
}
|
||||
else if (element instanceof L.Polyline) {
|
||||
if (Number(element.begin) === Number(dragIndex)) {
|
||||
|
Loading…
Reference in New Issue
Block a user