Mapshot

by palats

Generates a zoomable render of the whole map.

Utilities
a month ago
1.0 - 1.1
3.44K

g serving mapshot save list with apache

2 years ago

Hi palats,

When using the mapshot-windows serve function, browsing to the index.html file it serves displays a list of available versions of the save that have been generated.
When I serve the same files via apache, it just loads the latest one immediately and there is no list.

Is it possible for the list of versions to be accessed when serving from a webserver other than the mapshot-windows serve function?

Cheers,

Snappypants

2 years ago

Hello!

Unfortunately, there is no easy way to do so currently. The listing of available version is listed dynamically by the serve subcommand, limiting what's possible to do statically. Right now, the only workaround I can think of is:
- When you create a new mapshot version of a save, rename each time the index.html to something with a different name (e.g., save-v3.html).
- Allow Apache to list the files in that directory.
This way, it will be possible to see which saves are available in the directory and load them.

Note that the content of index.html is relatively simple. The only difference between each version is the path string (e.g., MAPSHOT_CONFIG={"path":"d-12592d50"}), so the viewer for other versions than the latest can easily be recreated manually.

I've opened https://github.com/Palats/mapshot/issues/17 to add better support for listing versions when using just the static files. (Note: I don't have time to work on it for now though).

New response