From 5395dc657dc9f9d6d53b09b2bf69d6492d39cf1b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 31 Oct 2020 13:19:13 -0700 Subject: Fix lint issues --- web/app/view/map/GeofenceMapController.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/view/map/GeofenceMapController.js b/web/app/view/map/GeofenceMapController.js index 5274bc3..237858a 100644 --- a/web/app/view/map/GeofenceMapController.js +++ b/web/app/view/map/GeofenceMapController.js @@ -34,15 +34,16 @@ Ext.define('Traccar.view.map.GeofenceMapController', { }, onFileChange: function (fileField) { - var reader, parser, xml, segment, point, projection, points = [], view = this.getView(); + var reader, parser, xml, segment, projection, points = [], view = this.getView(); if (fileField.fileInputEl.dom.files.length > 0) { reader = new FileReader(); - reader.onload = function (event) { + reader.onload = function () { parser = new DOMParser(); xml = parser.parseFromString(reader.result, 'text/xml'); segment = xml.getElementsByTagName('trkseg')[0]; projection = view.mapView.getProjection(); Array.from(segment.getElementsByTagName('trkpt')).forEach(function (point) { + var lat, lon; lat = Number(point.getAttribute('lat')); lon = Number(point.getAttribute('lon')); points.push(ol.proj.transform([lon, lat], 'EPSG:4326', projection)); -- cgit v1.2.3