bounds management

This commit is contained in:
vcoppe
2025-10-19 16:14:05 +02:00
parent 117c46341b
commit e57ced0ce7
12 changed files with 258 additions and 182 deletions

View File

@@ -61,8 +61,13 @@ export class ReducedGPXLayerCollection {
this._layers = new Map();
this._simplified = new Map();
this._fileStateCollectionOberver = new GPXFileStateCollectionObserver(
(fileId, fileState) => {
this._layers.set(fileId, new ReducedGPXLayer(fileState, this._updateSimplified));
(newFiles) => {
newFiles.forEach((fileState, fileId) => {
this._layers.set(
fileId,
new ReducedGPXLayer(fileState, this._updateSimplified)
);
});
},
(fileId) => {
this._layers.get(fileId)?.destroy();

View File

@@ -84,11 +84,13 @@
onMount(() => {
if ($map && popup && popupElement) {
fileStateCollectionObserver = new GPXFileStateCollectionObserver(
(fileId, fileState) => {
routingControls.set(
fileId,
new RoutingControls(fileId, fileState, popup, popupElement)
);
(newFiles) => {
newFiles.forEach((fileState, fileId) => {
routingControls.set(
fileId,
new RoutingControls(fileId, fileState, popup, popupElement)
);
});
},
(fileId) => {
const controls = routingControls.get(fileId);