diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-04 23:08:13 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-04 23:08:13 +1200 |
commit | c8735de4c31037f16b5f68420bff2d2f6419bae5 (patch) | |
tree | 0ebc706e37774445afd0c5726a4fbc497983213b /web/app/view | |
parent | 7734bfa85228ec85d86a9e1435da568bac0f907b (diff) | |
parent | 23796ee74a04f87d5dd028dffffa8a992c5c662d (diff) | |
download | trackermap-server-c8735de4c31037f16b5f68420bff2d2f6419bae5.tar.gz trackermap-server-c8735de4c31037f16b5f68420bff2d2f6419bae5.tar.bz2 trackermap-server-c8735de4c31037f16b5f68420bff2d2f6419bae5.zip |
Merge pull request #2076 from Abyss777/master
Add geometry WKT encoder and decoder
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/GeofenceMapController.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/web/app/view/GeofenceMapController.js b/web/app/view/GeofenceMapController.js index 1d20ba966..d643c89e4 100644 --- a/web/app/view/GeofenceMapController.js +++ b/web/app/view/GeofenceMapController.js @@ -18,12 +18,16 @@ Ext.define('Traccar.view.GeofenceMapController', { extend: 'Ext.app.ViewController', alias: 'controller.geofenceMap', + requires: [ + 'Traccar.GeofenceConverter' + ], + onSaveClick: function (button) { - var feature, formatter; + var geometry, projection; if (this.getView().getFeatures().getLength() > 0) { - feature = this.getView().getFeatures().pop(); - formatter = new ol.format.WKT(); - this.fireEvent('saveArea', formatter.writeFeature(feature)); + geometry = this.getView().getFeatures().pop().getGeometry(); + projection = this.getView().getMapView().getProjection(); + this.fireEvent('saveArea', Traccar.GeofenceConverter.geometryToWkt(projection, geometry)); button.up('window').close(); } }, |