diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-08-18 11:22:48 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-08-18 11:22:48 +1200 |
commit | 3c2a5c249d2a0cec1d5c371efcd1dfcf7e8c7f2e (patch) | |
tree | 74f6b995121b615fe39f3d7a23864c37a8db89a8 /web/app/GeofenceConverter.js | |
parent | 1e10dfb3c9f93998c6060297b8458f2a3c3df485 (diff) | |
download | trackermap-web-3c2a5c249d2a0cec1d5c371efcd1dfcf7e8c7f2e.tar.gz trackermap-web-3c2a5c249d2a0cec1d5c371efcd1dfcf7e8c7f2e.tar.bz2 trackermap-web-3c2a5c249d2a0cec1d5c371efcd1dfcf7e8c7f2e.zip |
Fix various style issues
Diffstat (limited to 'web/app/GeofenceConverter.js')
-rw-r--r-- | web/app/GeofenceConverter.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/web/app/GeofenceConverter.js b/web/app/GeofenceConverter.js index 0abefbce..4891e7b1 100644 --- a/web/app/GeofenceConverter.js +++ b/web/app/GeofenceConverter.js @@ -19,10 +19,10 @@ Ext.define('Traccar.GeofenceConverter', { singleton: true, wktToGeometry: function (mapView, wkt) { - 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; 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 +36,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 +45,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 +79,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(); |