aboutsummaryrefslogtreecommitdiff
path: root/web/app/GeofenceConverter.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-09 13:26:33 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-09 13:26:33 +1200
commitfe7b8bd58e23e289a041bc7c9a5d6c37f085419a (patch)
treed28b58d1ea3b4fcd6c715c4f2d2e2e04cb91c208 /web/app/GeofenceConverter.js
parent70d22de4205aec294660378f0d854cbc32c7a6b8 (diff)
downloadtrackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.tar.gz
trackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.tar.bz2
trackermap-server-fe7b8bd58e23e289a041bc7c9a5d6c37f085419a.zip
Fix issues in JavaScript code
Diffstat (limited to 'web/app/GeofenceConverter.js')
-rw-r--r--web/app/GeofenceConverter.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/web/app/GeofenceConverter.js b/web/app/GeofenceConverter.js
index d104ef127..ebe121385 100644
--- a/web/app/GeofenceConverter.js
+++ b/web/app/GeofenceConverter.js
@@ -20,7 +20,7 @@ Ext.define('Traccar.GeofenceConverter', {
wktToGeometry: function (mapView, wkt) {
var geometry, projection, resolutionAtEquator, pointResolution, resolutionFactor, points = [], center, radius,
content, i, lat, lon, coordinates;
- if (wkt.startsWith("POLYGON")) {
+ if (wkt.startsWith('POLYGON')) {
content = wkt.match(/\([^\(\)]+\)/);
if (content !== null) {
coordinates = content[0].match(/-?\d+\.?\d*/g);
@@ -34,7 +34,7 @@ Ext.define('Traccar.GeofenceConverter', {
geometry = new ol.geom.Polygon([points]);
}
}
- } else if (wkt.startsWith("CIRCLE")) {
+ } else if (wkt.startsWith('CIRCLE')) {
content = wkt.match(/\([^\(\)]+\)/);
if (content !== null) {
coordinates = content[0].match(/-?\d+\.?\d*/g);
@@ -62,17 +62,17 @@ Ext.define('Traccar.GeofenceConverter', {
earthSphere = new ol.Sphere(6378137);
groundRadius = earthSphere.haversineDistance(center,
ol.proj.transform(edgeCoordinate, projection, 'EPSG:4326'));
- result = "CIRCLE (";
- result += center[1] + " " + center[0] + ", ";
- result += Number((groundRadius).toFixed(1)) + ")";
+ result = 'CIRCLE (';
+ result += center[1] + ' ' + center[0] + ', ';
+ result += Number((groundRadius).toFixed(1)) + ')';
} else if (geometry instanceof ol.geom.Polygon) {
geometry.transform(projection, 'EPSG:4326');
points = geometry.getCoordinates();
- result = "POLYGON((";
+ result = 'POLYGON((';
for (i = 0; i < points[0].length; i += 1) {
- result += points[0][i][1] + " " + points[0][i][0] + ", ";
+ result += points[0][i][1] + ' ' + points[0][i][0] + ', ';
}
- result = result.substring(0, result.length - 2) + "))";
+ result = result.substring(0, result.length - 2) + '))';
}
return result;
}