diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-02 12:55:29 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-02 12:55:29 -0800 |
commit | fe47299d6cc02a4e43a1d2f3a788897be8a6f5ce (patch) | |
tree | 90cd987766fb51f104b2ad52e45acb67998a5c7a /web/app/GeofenceConverter.js | |
parent | e029756644581346a42f162a6505dda717a8c572 (diff) | |
download | trackermap-web-fe47299d6cc02a4e43a1d2f3a788897be8a6f5ce.tar.gz trackermap-web-fe47299d6cc02a4e43a1d2f3a788897be8a6f5ce.tar.bz2 trackermap-web-fe47299d6cc02a4e43a1d2f3a788897be8a6f5ce.zip |
Fix openlayers upgrade issues (fix #724)
Diffstat (limited to 'web/app/GeofenceConverter.js')
-rw-r--r-- | web/app/GeofenceConverter.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/web/app/GeofenceConverter.js b/web/app/GeofenceConverter.js index 4891e7b1..1f6ad377 100644 --- a/web/app/GeofenceConverter.js +++ b/web/app/GeofenceConverter.js @@ -45,7 +45,7 @@ Ext.define('Traccar.GeofenceConverter', { resolutionAtEquator = mapView.getResolution(); pointResolution = ol.proj.getPointResolution(projection, resolutionAtEquator, center); resolutionFactor = resolutionAtEquator / pointResolution; - radius = Number(coordinates[2]) / ol.proj.METERS_PER_UNIT.m * resolutionFactor; + radius = Number(coordinates[2]) / ol.proj.Units.METERS_PER_UNIT.m * resolutionFactor; geometry = new ol.geom.Circle(center, radius); } } @@ -74,9 +74,8 @@ Ext.define('Traccar.GeofenceConverter', { radius = geometry.getRadius(); edgeCoordinate = [center[0] + radius, center[1]]; center = ol.proj.transform(center, projection, 'EPSG:4326'); - earthSphere = new ol.Sphere(6378137); - groundRadius = earthSphere.haversineDistance(center, - ol.proj.transform(edgeCoordinate, projection, 'EPSG:4326')); + groundRadius = ol.sphere.getDistance( + center, ol.proj.transform(edgeCoordinate, projection, 'EPSG:4326'), 6378137) result = 'CIRCLE ('; result += center[1] + ' ' + center[0] + ', '; result += groundRadius.toFixed(1) + ')'; |