From 8fccc2300931b2cf6a4c86bca86b20966e899a3e Mon Sep 17 00:00:00 2001 From: portree_kid Date: Thu, 5 Mar 2020 22:05:20 +0100 Subject: [PATCH] New middle vertex fixed --- .travis.yml | 2 +- .../loaders/TaxiwaySegmentExtender.js | 21 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32d3ca9..47ba78d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ deploy: provider: releases api_key: secure: Xm3z86gQmpSajvlXSVgG7mxcaS5K7GfE4HrARIDR4pQ4UguQ3/fFOenRyKAQImmH0kLCSIbVE21NMAQ3YI2F9El9I6GU7Wirccsg14TZZiBQAzKOTXZ+JsBloeBxuTOsR84SkO6pV8OT/pRnQd9frqyc1W7wzoX+0sQykMztXCNfI+1MXXGOAgMzlKuDMO1PVENz0V63mWipL/Mae/SyrHa1Bws+4LJKvv42m0HMKdN7ekt41vxcSUvLmN+YLlqUEVr/eUhQXUNCaWlmM0KxmfuzTedca5/1yzLvN8smEt2I2b0DFRM3Mi/QdI22fVRHs6XGpm8yqZRKmhySDXFspXKWBiuCF6AezX6NiIe/ZUh10gIukjkyLtrNk/o29qhj2WE9HJz4xhsGMAx3632cLSMPku5ALN7jv5scWjwCGNHs4ZeZyyePMeGM6Y6pje1uJPbxWGjwoV6iI4Y4esP+z3KcXvZdnzkpYMy2mzdT4gf7A7zieax1YwB6U/MEanXYKFBH4yzYK9+hx3ck2eLT3LcV/ChHN2bKmERJdf18h+zI8e5YKTzd3/kHLiUUv19N2a4TUYloGOyzrLwn2VD1Xm4jJVVLTIQvWbH5YK7cNkHYa4+PnsB+JppSoby7HiBcothw4OLpJO8eCMqXcPRU1n+cRAZTB7VOS7pWh8e8LFE= - file: build/flightgear-airports*.* + file: build/* draft: true on: repo: Portree-Kid/flightgear-airports diff --git a/src/renderer/loaders/TaxiwaySegmentExtender.js b/src/renderer/loaders/TaxiwaySegmentExtender.js index a4861e0..ee05d77 100644 --- a/src/renderer/loaders/TaxiwaySegmentExtender.js +++ b/src/renderer/loaders/TaxiwaySegmentExtender.js @@ -88,16 +88,25 @@ exports.extendTaxiSegment = function (taxiwaySegment) { event.latlng.__vertex['glueindex'] = Number(closest.glueindex); event.latlng.__vertex.setLatLng(closest.latlng); this.editLayer.featureLookup[event.latlng.__vertex.glueindex].push(event.latlng.__vertex); + event.latlng.attributes = {index: event.latlng.__vertex.glueindex, isOnRunway: 0}; console.log(closest) } else { - event.latlng.__vertex['glueindex'] = ++this.editLayer.groundnetLayerGroup.maxId; - this.editLayer.featureLookup[event.latlng.__vertex.glueindex] = []; - this.editLayer.featureLookup[event.latlng.__vertex.glueindex].push(event.latlng.__vertex); + event.vertex['glueindex'] = ++this.editLayer.groundnetLayerGroup.maxId; + event.vertex.latlng.attributes = {index: event.vertex.glueindex, isOnRunway: 0}; + this.editLayer.featureLookup[event.vertex.glueindex] = []; + this.editLayer.featureLookup[event.vertex.glueindex].push(event.vertex); + event.vertex.editor.enable(); } - event.latlng.attributes = {index: event.latlng.__vertex.glueindex, isOnRunway: 0}; - }) + }); + this.on('editable:vertex:deleted', event => { + console.log(event) + }); + this.on('editable:vertex:rawclick', event => { + event.cancel() + console.log(event) + }); this.on('editable:vertex:clicked', function (event) { - console.log(this.featureLookup[event.vertex.glueindex]); + console.log(this.featureLookup[event.vertex.glueindex]); store.default.dispatch('setNode', event.vertex.latlng.attributes) if(event.vertex._icon!=null) {