From 21e85e00b30564b291492f3bdba1ae146e84efc2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 18 Sep 2016 15:06:57 +1200 Subject: Add support for Carto Basemaps --- web/app/view/BaseMap.js | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'web/app/view/BaseMap.js') diff --git a/web/app/view/BaseMap.js b/web/app/view/BaseMap.js index 5074665..a352420 100644 --- a/web/app/view/BaseMap.js +++ b/web/app/view/BaseMap.js @@ -42,9 +42,11 @@ Ext.define('Traccar.view.BaseMap', { layer = new ol.layer.Tile({ source: new ol.source.XYZ({ url: server.get('mapUrl'), - attributions: [new ol.Attribution({ - html: '' - })] + attributions: [ + new ol.Attribution({ + html: '' + }) + ] }) }); } else if (type === 'bingRoad') { @@ -61,10 +63,29 @@ Ext.define('Traccar.view.BaseMap', { imagerySet: 'Aerial' }) }); - } else { + } else if (type === 'osm'){ layer = new ol.layer.Tile({ source: new ol.source.OSM({}) }); + } else { + layer = new ol.layer.Tile({ + source: new ol.source.XYZ({ + urls: [ + 'https://cartodb-basemaps-a.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', + 'https://cartodb-basemaps-b.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', + 'https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', + 'https://cartodb-basemaps-d.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png' + ], + attributions: [ + new ol.Attribution({ + html: [ + '© OpenStreetMap ' + + 'contributors, © CARTO' + ] + }) + ] + }) + }); } lat = user.get('latitude') || server.get('latitude') || Traccar.Style.mapDefaultLat; -- cgit v1.2.3