aboutsummaryrefslogtreecommitdiff
path: root/web/app/GeofenceConverter.js
diff options
context:
space:
mode:
authortsmgeek <tsmgeek@gmail.com>2017-08-22 00:21:29 +0100
committertsmgeek <tsmgeek@gmail.com>2017-08-22 00:21:29 +0100
commitfdf35488b5b3cd5725c6c2e179b65377d30c6577 (patch)
treeda0b3927f3049475cd67977fe093d198920c1c37 /web/app/GeofenceConverter.js
parentf8b98b236fd676fe8945d942842640ddea5bbac8 (diff)
parente0bb9b92d07176677b3043530660af3bc30774d7 (diff)
downloadetbsa-traccar-web-fdf35488b5b3cd5725c6c2e179b65377d30c6577.tar.gz
etbsa-traccar-web-fdf35488b5b3cd5725c6c2e179b65377d30c6577.tar.bz2
etbsa-traccar-web-fdf35488b5b3cd5725c6c2e179b65377d30c6577.zip
Merge from upstream, change .eslintrc.json
Diffstat (limited to 'web/app/GeofenceConverter.js')
-rw-r--r--web/app/GeofenceConverter.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/web/app/GeofenceConverter.js b/web/app/GeofenceConverter.js
index ce529b1..d3d562e 100644
--- a/web/app/GeofenceConverter.js
+++ b/web/app/GeofenceConverter.js
@@ -19,10 +19,15 @@ Ext.define('Traccar.GeofenceConverter', {
singleton: true,
wktToGeometry: function (mapView, wkt) {
+<<<<<<< HEAD
var geometry, projection, resolutionAtEquator, pointResolution, resolutionFactor, points = [], center, radius,
content, i, lat, lon, coordinates;
+=======
+ var geometry, projection, resolutionAtEquator, pointResolution, resolutionFactor,
+ points = [], center, radius, content, i, lat, lon, coordinates;
+>>>>>>> e0bb9b92d07176677b3043530660af3bc30774d7
if (wkt.lastIndexOf('POLYGON', 0) === 0) {
- content = wkt.match(/\([^\(\)]+\)/);
+ content = wkt.match(/\([^()]+\)/);
if (content !== null) {
coordinates = content[0].match(/-?\d+\.?\d*/g);
if (coordinates !== null) {
@@ -36,7 +41,7 @@ Ext.define('Traccar.GeofenceConverter', {
}
}
} else if (wkt.lastIndexOf('CIRCLE', 0) === 0) {
- content = wkt.match(/\([^\(\)]+\)/);
+ content = wkt.match(/\([^()]+\)/);
if (content !== null) {
coordinates = content[0].match(/-?\d+\.?\d*/g);
if (coordinates !== null) {
@@ -45,12 +50,12 @@ 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.METERS_PER_UNIT.m * resolutionFactor;
geometry = new ol.geom.Circle(center, radius);
}
}
} else if (wkt.lastIndexOf('LINESTRING', 0) === 0) {
- content = wkt.match(/\([^\(\)]+\)/);
+ content = wkt.match(/\([^()]+\)/);
if (content !== null) {
coordinates = content[0].match(/-?\d+\.?\d*/g);
if (coordinates !== null) {
@@ -79,7 +84,7 @@ Ext.define('Traccar.GeofenceConverter', {
ol.proj.transform(edgeCoordinate, projection, 'EPSG:4326'));
result = 'CIRCLE (';
result += center[1] + ' ' + center[0] + ', ';
- result += Number((groundRadius).toFixed(1)) + ')';
+ result += groundRadius.toFixed(1) + ')';
} else if (geometry instanceof ol.geom.Polygon) {
geometry.transform(projection, 'EPSG:4326');
points = geometry.getCoordinates();