From 9cc4a5fcf6c044615d11b30eb4ad74bf0f76a63d Mon Sep 17 00:00:00 2001 From: portree_kid Date: Mon, 24 Feb 2020 21:25:02 +0100 Subject: [PATCH] Parking Radius --- src/renderer/components/GroundnetEdit.vue | 39 ----------- src/renderer/components/LeafletSidebar.vue | 6 +- src/renderer/components/ParkingEdit.vue | 80 ++++++++++++++++++++++ src/renderer/loaders/ParkingSpot.js | 2 +- src/renderer/store/modules/Editable.js | 3 + 5 files changed, 87 insertions(+), 43 deletions(-) delete mode 100644 src/renderer/components/GroundnetEdit.vue create mode 100644 src/renderer/components/ParkingEdit.vue diff --git a/src/renderer/components/GroundnetEdit.vue b/src/renderer/components/GroundnetEdit.vue deleted file mode 100644 index 57a3b39..0000000 --- a/src/renderer/components/GroundnetEdit.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/src/renderer/components/LeafletSidebar.vue b/src/renderer/components/LeafletSidebar.vue index 2a37e81..e65e4e5 100644 --- a/src/renderer/components/LeafletSidebar.vue +++ b/src/renderer/components/LeafletSidebar.vue @@ -29,7 +29,7 @@
- + @@ -52,7 +52,7 @@ import {} from 'leaflet-sidebar-v2' import L from 'leaflet' import AirportEdit from './AirportEdit' - import GroundnetEdit from './GroundnetEdit' + import ParkingEdit from './ParkingEdit' import ArcEdit from './ArcEdit' import NodeEdit from './NodeEdit' import SettingsPanel from './SettingsPanel' @@ -62,7 +62,7 @@ export default { name: 'leaflet-sidebar', - components: { AirportEdit, ArcEdit, NodeEdit, GroundnetEdit, SettingsPanel, RunScan, FileSelect, Search }, + components: { AirportEdit, ArcEdit, NodeEdit, ParkingEdit, SettingsPanel, RunScan, FileSelect, Search }, props: [], mounted () { this.add() diff --git a/src/renderer/components/ParkingEdit.vue b/src/renderer/components/ParkingEdit.vue new file mode 100644 index 0000000..e326a18 --- /dev/null +++ b/src/renderer/components/ParkingEdit.vue @@ -0,0 +1,80 @@ + + + diff --git a/src/renderer/loaders/ParkingSpot.js b/src/renderer/loaders/ParkingSpot.js index 648ec2f..edf86de 100644 --- a/src/renderer/loaders/ParkingSpot.js +++ b/src/renderer/loaders/ParkingSpot.js @@ -79,7 +79,7 @@ L.ParkingSpot = L.Circle.extend({ var end = this.editor._resizeLatLng.__vertex.getLatLng(); var heading = turf.bearing([start.lng, start.lat], [end.lng, end.lat]); this.options.attributes.heading = heading + 180; - const counts = [14, 18, 26, 33, 40]; + const counts = [15, 24, 36, 52, 65, 80]; const output = counts.reduce((prev, curr) => Math.abs(curr - this._mRadius) < Math.abs(prev - this._mRadius) ? curr : prev); diff --git a/src/renderer/store/modules/Editable.js b/src/renderer/store/modules/Editable.js index b2fcee6..c4a9aec 100644 --- a/src/renderer/store/modules/Editable.js +++ b/src/renderer/store/modules/Editable.js @@ -43,6 +43,9 @@ const mutations = { 'SET_EDIT_PARKING_NAME' (state, parkingName) { Vue.set(state.data.parking, 'name', parkingName) }, + 'SET_EDIT_PARKING_RADIUS' (state, radius) { + Vue.set(state.data.parking, 'radius', radius) + }, 'SET_EDIT_ARC_NAME' (state, arcName) { Vue.set(state.data.arc, 'name', arcName) },