Arc colour update

pull/36/head
portree_kid 5 years ago
parent cbee301ac5
commit e1bf234cbb

@ -235,7 +235,12 @@
})
},
editedArc() {
console.log('Edited Arc');
console.log('Edited Arc : ' + this.$store.state.Editable.index);
var arc = this.groundnetLayerGroup.getLayer(this.$store.state.Editable.index);
if (arc) {
arc.options.attributes = Object.assign({}, this.$store.state.Editable.data.arc)
arc.updateStyle();
}
},
editedNode() {
if (this.$store.state.Editable.index === undefined ||

@ -118,7 +118,7 @@ L.ParkingSpot = L.Circle.extend({
return state.Editable.data.parking;
},
() => {
event.target.setStyle({color : '#3388ff'});
event.target.updateStyle();
this.unwatch();
}
,

@ -45,6 +45,8 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
event.target.setStyle({color : 'red'});
console.log("Click : " + event.target);
if (store.default.state.Editable.data.arc !== event.target.options.attributes) {
event.target.options.attributes.index = event.target._leaflet_id;
event.target.options.attributes.selected = true;
store.default.dispatch('setArc', event.target.options.attributes);
}
this.unwatch = store.default.watch(
@ -53,7 +55,8 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
},
() => {
// Reset colour
event.target.setStyle({color : '#3388ff'});
event.target.options.attributes.selected = false;
event.target.updateStyle();
this.unwatch();
}
,
@ -205,9 +208,14 @@ exports.extendTaxiSegment = function (taxiwaySegment) {
taxiwaySegment.__proto__.updateStyle = function() {
var style = {};
if (this.options.attributes.isPushBackRoute) {
if(this.options.attributes.selected){
style.color = 'red';
} else if (this.options.attributes.isPushBackRoute) {
style.color = 'magenta';
}
else {
style.color = '#3388ff';
}
this.setStyle(style);
if (!this.bidirectional) {
this.setText(' ► ', {repeat: true, attributes: {fill: 'red', size: 20}})

Loading…
Cancel
Save