aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/GeofenceMapController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-07-04 14:33:41 +0500
committerAbyss777 <abyss@fox5.ru>2016-07-04 14:33:41 +0500
commitfe935b21c242a496fde8570d78322c42b3eaf414 (patch)
tree752483d814baa739a461deedff8647c56d022bbc /web/app/view/GeofenceMapController.js
parent22f37ea8bac7f45430e56c07d46d06755297f497 (diff)
downloadtrackermap-server-fe935b21c242a496fde8570d78322c42b3eaf414.tar.gz
trackermap-server-fe935b21c242a496fde8570d78322c42b3eaf414.tar.bz2
trackermap-server-fe935b21c242a496fde8570d78322c42b3eaf414.zip
Added geometry-WKT coder/decoder
Uncommented Circle geofence type
Diffstat (limited to 'web/app/view/GeofenceMapController.js')
-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();
}
},