aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/GeofenceMapController.js12
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();
}
},