aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/map/GeofenceMap.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/GeofenceMap.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/GeofenceMap.js')
-rw-r--r--web/app/view/map/GeofenceMap.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/web/app/view/map/GeofenceMap.js b/web/app/view/map/GeofenceMap.js
index 37d3be74..d16e6ca1 100644
--- a/web/app/view/map/GeofenceMap.js
+++ b/web/app/view/map/GeofenceMap.js
@@ -68,11 +68,9 @@ Ext.define('Traccar.view.map.GeofenceMap', {
if (this.area !== '') {
geometry = Traccar.GeofenceConverter.wktToGeometry(this.mapView, this.area);
this.features.push(new ol.Feature(geometry));
- if (geometry instanceof ol.geom.Circle) {
- this.mapView.setCenter(geometry.getCenter());
- } else if (geometry instanceof ol.geom.Polygon) {
- this.mapView.setCenter(geometry.getCoordinates()[0][0]);
- }
+ this.mapView.fit(geometry);
+ } else {
+ this.controller.fireEvent('mapstaterequest');
}
fillColor = ol.color.asArray(Traccar.Style.mapGeofenceColor);
fillColor[3] = Traccar.Style.mapGeofenceOverlayOpacity;