From e6013751d88cbfaac6c03a070d88cfd5c3e16921 Mon Sep 17 00:00:00 2001 From: Edward Valley Date: Fri, 12 Jul 2019 23:53:29 -0400 Subject: Add support for ArcGIS REST map services --- web/app/store/MapTypes.js | 7 +++++-- web/app/view/map/BaseMap.js | 9 ++++++++- web/l10n/en.json | 4 +++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js index 3d32243..211cc81 100644 --- a/web/app/store/MapTypes.js +++ b/web/app/store/MapTypes.js @@ -47,7 +47,10 @@ Ext.define('Traccar.store.MapTypes', { key: 'wikimedia', name: Strings.mapWikimedia }, { - key: 'custom', - name: Strings.mapCustom + key: 'customXyzFormat', + name: Strings.mapCustomXyzFormat + }, { + key: 'customArcgisRest', + name: Strings.mapCustomArcgisRest }] }); diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index 4f0c8d4..0b39ae3 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -38,7 +38,7 @@ Ext.define('Traccar.view.map.BaseMap', { bingKey = server.get('bingKey'); switch (type) { - case 'custom': + case 'customXyzFormat': layer = new ol.layer.Tile({ source: new ol.source.XYZ({ url: Ext.String.htmlDecode(server.get('mapUrl')), @@ -46,6 +46,13 @@ Ext.define('Traccar.view.map.BaseMap', { }) }); break; + case 'customArcgisRest': + layer = new ol.layer.Tile({ + source: new ol.source.TileArcGISRest({ + url: Ext.String.htmlDecode(server.get('mapUrl')) + }) + }); + break; case 'bingRoad': layer = new ol.layer.Tile({ source: new ol.source.BingMaps({ diff --git a/web/l10n/en.json b/web/l10n/en.json index 69f3fed..07e7609 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -232,6 +232,8 @@ "mapTitle": "Map", "mapLayer": "Map Layer", "mapCustom": "Custom Map", + "mapCustomXyzFormat": "Custom (XYZ)", + "mapCustomArcgisRest": "Custom (ArcGIS REST)", "mapCarto": "Carto Basemaps", "mapOsm": "Open Street Map", "mapBingKey": "Bing Maps Key", @@ -427,4 +429,4 @@ "categoryScooter": "Scooter", "maintenanceStart": "Start", "maintenancePeriod": "Period" -} \ No newline at end of file +} -- cgit v1.2.3 From 66fbb00c9ad302d746ca09e51a2a6a821aefab88 Mon Sep 17 00:00:00 2001 From: Edward Valley Date: Sat, 13 Jul 2019 00:13:36 -0400 Subject: Fix minor typo --- web/app/store/MapTypes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js index 211cc81..f75bbaa 100644 --- a/web/app/store/MapTypes.js +++ b/web/app/store/MapTypes.js @@ -48,7 +48,7 @@ Ext.define('Traccar.store.MapTypes', { name: Strings.mapWikimedia }, { key: 'customXyzFormat', - name: Strings.mapCustomXyzFormat + name: Strings.mapCustomXyzFormat }, { key: 'customArcgisRest', name: Strings.mapCustomArcgisRest -- cgit v1.2.3 From 3b0f7304db66d560e241511f3c9dc6ebaf31013d Mon Sep 17 00:00:00 2001 From: Edward Valley Date: Sun, 14 Jul 2019 20:36:11 -0400 Subject: Changes after first review --- web/app/store/MapTypes.js | 8 ++++---- web/app/view/map/BaseMap.js | 4 ++-- web/l10n/en.json | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/web/app/store/MapTypes.js b/web/app/store/MapTypes.js index f75bbaa..88d54bf 100644 --- a/web/app/store/MapTypes.js +++ b/web/app/store/MapTypes.js @@ -47,10 +47,10 @@ Ext.define('Traccar.store.MapTypes', { key: 'wikimedia', name: Strings.mapWikimedia }, { - key: 'customXyzFormat', - name: Strings.mapCustomXyzFormat + key: 'custom', + name: Strings.mapCustom }, { - key: 'customArcgisRest', - name: Strings.mapCustomArcgisRest + key: 'customArcgis', + name: Strings.mapCustomArcgis }] }); diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index 0b39ae3..0ab48e8 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -38,7 +38,7 @@ Ext.define('Traccar.view.map.BaseMap', { bingKey = server.get('bingKey'); switch (type) { - case 'customXyzFormat': + case 'custom': layer = new ol.layer.Tile({ source: new ol.source.XYZ({ url: Ext.String.htmlDecode(server.get('mapUrl')), @@ -46,7 +46,7 @@ Ext.define('Traccar.view.map.BaseMap', { }) }); break; - case 'customArcgisRest': + case 'customArcgis': layer = new ol.layer.Tile({ source: new ol.source.TileArcGISRest({ url: Ext.String.htmlDecode(server.get('mapUrl')) diff --git a/web/l10n/en.json b/web/l10n/en.json index 07e7609..7374785 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -231,9 +231,8 @@ "serverForceSettings": "Force Settings", "mapTitle": "Map", "mapLayer": "Map Layer", - "mapCustom": "Custom Map", - "mapCustomXyzFormat": "Custom (XYZ)", - "mapCustomArcgisRest": "Custom (ArcGIS REST)", + "mapCustom": "Custom (XYZ)", + "mapCustomArcgis": "Custom (ArcGIS)", "mapCarto": "Carto Basemaps", "mapOsm": "Open Street Map", "mapBingKey": "Bing Maps Key", -- cgit v1.2.3