Skip to content

Commit

Permalink
🐛 [feat/maps] #3 correct remote map integration
Browse files Browse the repository at this point in the history
  • Loading branch information
JAGFx committed Jan 7, 2021
1 parent ff57847 commit bacb129
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions maps/extractZip
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions src/dashboards/maps/components/DashMaps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ export default {
this.ready = true;
} )
.catch( e => {
console.log( 'AAAAA' );
this.message.icon = '<i class="fas fa-times"></i>';
this.message.text = 'Unable to load map';
this.message.sub = e;
Expand Down
17 changes: 8 additions & 9 deletions src/utils/_maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) => {
Expand All @@ -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 => {
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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.
//
Expand Down

0 comments on commit bacb129

Please sign in to comment.