From bacb1297e9842f9038c42a8e72f645df64b3a5ed Mon Sep 17 00:00:00 2001 From: JAGFx Date: Thu, 7 Jan 2021 19:44:28 +0100 Subject: [PATCH] :bug: [feat/maps] #3 correct remote map integration --- maps/extractZip | 4 ++-- src/dashboards/maps/components/DashMaps.vue | 2 -- src/utils/_maps.js | 17 ++++++++--------- 3 files changed, 10 insertions(+), 13 deletions(-) mode change 100644 => 100755 maps/extractZip diff --git a/maps/extractZip b/maps/extractZip old mode 100644 new mode 100755 index e5bbe007..5f7d7a37 --- a/maps/extractZip +++ b/maps/extractZip @@ -1,4 +1,4 @@ #!/bin/bash -tar -zxvf maps.vanilla.tar.gz vanilla -tar -zxvf maps.promod.tar.gz promod +tar -zxvf maps.vanilla.tar.gz +tar -zxvf maps.promod.tar.gz diff --git a/src/dashboards/maps/components/DashMaps.vue b/src/dashboards/maps/components/DashMaps.vue index b2cda422..7f7103be 100644 --- a/src/dashboards/maps/components/DashMaps.vue +++ b/src/dashboards/maps/components/DashMaps.vue @@ -125,8 +125,6 @@ export default { this.ready = true; } ) .catch( e => { - console.log( 'AAAAA' ); - this.message.icon = ''; this.message.text = 'Unable to load map'; this.message.sub = e; diff --git a/src/utils/_maps.js b/src/utils/_maps.js index 48614041..e7266670 100644 --- a/src/utils/_maps.js +++ b/src/utils/_maps.js @@ -38,7 +38,6 @@ const TILES_REMOTE_HOST = 'https://ets2.jagfx.fr'; /** * TODO: Add verification for the min map version and the min map version allowed by the dash - * FIXME: Correct the CORS not allowed with the remote tile location */ const initConfig = ( game ) => { @@ -62,8 +61,6 @@ const initConfig = ( game ) => { const tilesPath = d.paths.tiles.replace( /{[xyz]}/g, 0 ); - //console.log( tilesPath ); - return axios .get( d.paths.base + tilesPath ) .then( response => { @@ -129,10 +126,11 @@ const initMap = () => { // Configuring the custom map tiles. let custom_tilegrid = new ol.tilegrid.TileGrid( { - extent: [ 0, 0, d.config.map.maxX, d.config.map.maxY ], - minZoom: ZOOM_MIN, - origin: [ 0, d.config.map.maxY ], - tileSize: d.map.tileSize,//[ 512, 512 ], + extent: [ 0, 0, d.config.map.maxX, d.config.map.maxY ], + minZoom: ZOOM_MIN, + origin: [ 0, d.config.map.maxY ], + //tileSize: [ 512, 512 ], + tileSize: d.config.map.tileSize,//[ 512, 512 ], resolutions: (function () { let r = []; for ( let z = 0; z <= 8; ++z ) { @@ -262,8 +260,9 @@ const getMapTilesLayer = ( projection, tileGrid ) => { projection: projection, //url: // 'https://github.com/meatlayer/ets2-mobile-route-advisor/raw/master/maps/ets2/tiles/{z}/{x}/{y}.png', - url: d.paths.base + d.paths.tiles, - tileSize: d.map.tileSize,//[ 512, 512 ], + url: d.paths.base + d.paths.tiles, + //tileSize: [ 512, 512 ], + tileSize: d.config.map.tileSize, // Using createXYZ() makes the vector layer (with the features) unaligned. // It also tries loading non-existent tiles. //