Fix initial camera on marker
All checks were successful
Deploy Spot / deploy (push) Successful in 34s
All checks were successful
Deploy Spot / deploy (push) Successful in 34s
This commit is contained in:
@@ -24,7 +24,7 @@ module.exports = (env, argv) => {
|
|||||||
filename: isDev ? 'assets/[name].js' : 'assets/[name].[contenthash:8].js',
|
filename: isDev ? 'assets/[name].js' : 'assets/[name].[contenthash:8].js',
|
||||||
chunkFilename: isDev ? 'assets/[name].js' : 'assets/[name].[contenthash:8].js',
|
chunkFilename: isDev ? 'assets/[name].js' : 'assets/[name].[contenthash:8].js',
|
||||||
publicPath: './',
|
publicPath: './',
|
||||||
clean: {
|
clean: isDev ? false : {
|
||||||
keep: /^(index\.php|files|geo|images\/icons)(\/.*)?$/
|
keep: /^(index\.php|files|geo|images\/icons)(\/.*)?$/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -92,7 +92,7 @@ module.exports = (env, argv) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
generator: {
|
generator: {
|
||||||
filename: 'assets/images/[name].[contenthash:8][ext]'
|
filename: isDev ? 'assets/images/[name][ext]' : 'assets/images/[name].[contenthash:8][ext]'
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
@@ -115,8 +115,12 @@ module.exports = (env, argv) => {
|
|||||||
chunkGroups: mapChunkGroups(stats.compilation.chunkGroups)
|
chunkGroups: mapChunkGroups(stats.compilation.chunkGroups)
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.mkdirSync(path.resolve(PUBLIC, 'assets'), { recursive: true });
|
const manifestPath = path.resolve(PUBLIC, 'assets', 'entrypoints.json');
|
||||||
fs.writeFileSync(path.resolve(PUBLIC, 'assets', 'entrypoints.json'), JSON.stringify(manifest, null, '\t'));
|
const tmpManifestPath = `${manifestPath}.tmp`;
|
||||||
|
|
||||||
|
fs.mkdirSync(path.dirname(manifestPath), { recursive: true });
|
||||||
|
fs.writeFileSync(tmpManifestPath, JSON.stringify(manifest, null, '\t'));
|
||||||
|
fs.renameSync(tmpManifestPath, manifestPath);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -296,8 +296,8 @@ class Spot extends Main
|
|||||||
|
|
||||||
//Assign medias to closest message
|
//Assign medias to closest message
|
||||||
if(!empty($asMessages)) {
|
if(!empty($asMessages)) {
|
||||||
usort($asMessages, function($a, $b){return $a['unix_time'] > $b['unix_time'];});
|
usort($asMessages, function($a, $b){return (int) $a['unix_time'] <=> (int) $b['unix_time'];});
|
||||||
usort($asMedias, function($a, $b){return $a['unix_time'] > $b['unix_time'];});
|
usort($asMedias, function($a, $b){return (int) $a['unix_time'] <=> (int) $b['unix_time'];});
|
||||||
|
|
||||||
$iIndex = 0;
|
$iIndex = 0;
|
||||||
$iMaxIndex = count($asMessages) - 1;
|
$iMaxIndex = count($asMessages) - 1;
|
||||||
@@ -318,7 +318,7 @@ class Spot extends Main
|
|||||||
|
|
||||||
//Combine markers
|
//Combine markers
|
||||||
$asMarkers = [...$asMessages, ...$asGeoMedias];
|
$asMarkers = [...$asMessages, ...$asGeoMedias];
|
||||||
usort($asMarkers, function($a, $b){return $a['unix_time'] > $b['unix_time'];});
|
usort($asMarkers, function($a, $b){return (int) $a['unix_time'] <=> (int) $b['unix_time'];});
|
||||||
|
|
||||||
$asResult = array(
|
$asResult = array(
|
||||||
'markers' => $asMarkers,
|
'markers' => $asMarkers,
|
||||||
|
|||||||
@@ -469,17 +469,18 @@ export default {
|
|||||||
)) || null;
|
)) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(oHashMarker) { //Direct link to marker
|
//Direct link to marker
|
||||||
|
if(oHashMarker) {
|
||||||
oBounds.extend(new LngLat(oHashMarker.longitude, oHashMarker.latitude));
|
oBounds.extend(new LngLat(oHashMarker.longitude, oHashMarker.latitude));
|
||||||
}
|
}
|
||||||
else if( //Blog Mode: Fit to last message
|
//Blog Mode: Fit to last marker
|
||||||
this.project.mode == this.consts.modes.blog &&
|
else if(this.project.mode == this.consts.modes.blog && this.markers.length > 0) {
|
||||||
this.markers.length > 0
|
let oLastMarker = this.markers.at(-1);
|
||||||
) {
|
if(oLastMarker) oBounds.extend(new LngLat(oLastMarker.longitude, oLastMarker.latitude));
|
||||||
let oLastMsg = this.markers.at(-1);
|
|
||||||
oBounds.extend(new LngLat(oLastMsg.longitude, oLastMsg.latitude));
|
|
||||||
}
|
}
|
||||||
else { //Pre/Histo Mode: Fit to track
|
|
||||||
|
//Pre Mode, Histo Mode, Blog Mode without markers or missing direct link marker: Fit to track
|
||||||
|
if(oBounds.isEmpty()) {
|
||||||
for(const iFeatureId in this.track.features) {
|
for(const iFeatureId in this.track.features) {
|
||||||
oBounds = this.track.features[iFeatureId].geometry.coordinates.reduce(
|
oBounds = this.track.features[iFeatureId].geometry.coordinates.reduce(
|
||||||
(bounds, coord) => bounds.extend(coord),
|
(bounds, coord) => bounds.extend(coord),
|
||||||
|
|||||||
Reference in New Issue
Block a user