aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/map/GeofenceMapController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-29 11:46:40 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-29 11:46:40 +0500
commit8523cf92c8ef566ec28b9a759c81f4a86957c11e (patch)
treeac9592f2fa077118ee91bfd2d455f5610f67dd1c /web/app/view/map/GeofenceMapController.js
parentc6a1dc961500b62379b70b8629fc5c8da688db0b (diff)
downloadtrackermap-web-8523cf92c8ef566ec28b9a759c81f4a86957c11e.tar.gz
trackermap-web-8523cf92c8ef566ec28b9a759c81f4a86957c11e.tar.bz2
trackermap-web-8523cf92c8ef566ec28b9a759c81f4a86957c11e.zip
Fit to edited geofence or main Map
Diffstat (limited to 'web/app/view/map/GeofenceMapController.js')
-rw-r--r--web/app/view/map/GeofenceMapController.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/app/view/map/GeofenceMapController.js b/web/app/view/map/GeofenceMapController.js
index ffafb7f8..f075ac93 100644
--- a/web/app/view/map/GeofenceMapController.js
+++ b/web/app/view/map/GeofenceMapController.js
@@ -23,6 +23,16 @@ Ext.define('Traccar.view.map.GeofenceMapController', {
'Traccar.GeofenceConverter'
],
+ config: {
+ listen: {
+ controller: {
+ '*': {
+ mapstate: 'setMapState'
+ }
+ }
+ }
+ },
+
onSaveClick: function (button) {
var geometry, projection;
if (this.getView().getFeatures().getLength() > 0) {
@@ -40,5 +50,10 @@ Ext.define('Traccar.view.map.GeofenceMapController', {
onTypeSelect: function (combo) {
this.getView().removeInteraction();
this.getView().addInteraction(combo.getValue());
+ },
+
+ setMapState: function (lat, lon, zoom) {
+ this.getView().getMapView().setCenter(ol.proj.fromLonLat([lon, lat]));
+ this.getView().getMapView().setZoom(zoom);
}
});