Add support for polyline POIs just like in the good ol'
Google Maps days. See #883.
The format after this commit is:
{ id, x, y, z, text, color, polyline/polygon: [{ x, y, z }, ...] }
Optional properties:
- common ones like "icon" and "hovertext"
- "strokeColor" (string),
- "fill" (boolean)
- "weight" (integer)
Docs not included.
Largely based on PR #1536 by @jsmienk.
Closes#1456, closes#1536, closes#1643.
This option allows you to specify your own initial center for a
tileset, which is useful if your map is extremely asymmetric or
you don't really care about what's around the spawn.
Future work needs to be done on the JS side in order to fix the
fromWorldToLatLng and friends, as they're currently off by -24 in X
and +24 in Z direction.
Closes#1350.
With the changes to things being indexed by path instead of name,
old hashes would stop working. To make this a bit less jarring, we
can fall back to the default tileset of a world, which means the
map would still load.
Overlays should only show up for the base layers they apply to,
however, we've had them show up for all base layers in a world.
To fix this, we first change things to be indexed by the unique path,
not the human-readable name (which is not supposed to be always unique).
Then, we remove and add overlay layers to the layerCtrl as needed on a
baselayerchange event.
CSS margin is always relative to the containing element. For some
reason, using the browser inspector, this does not get propagated
properly. Adding a containing element with the size of the child element
allows us to use margin to offset the icon.
The initial map view was not affected by the 'defaultZoom' property in the config file. This has been fixed, by passing the value into 'centers' collection, when it is initially created. Additionally, the 'defaultZoom' config property is passed to the first overviewer.map.setView statement, to ensure correct zoom level on the initial page load.
I'd move the event setup into addTo, but JS is utter garbage and thinks
"this" in a function callback like that should be whatever, not where you
actually define it.
The spawn and location icons should now have the tip of the icon
image point at the actual location. Previously, the icons were
centred onto it, which was slightly off in the vertical direction.
Unfortunately we need to explicitly tell leaflet not to scale them
weirdly but to make them perceptually equivalent to the normal ones,
which means we have hardcoded icon sizes for those two right now.
Instead of stuffing specialised values into overviewer.collections,
put a reference to the overviewerConfig tileset entry into the leaflet
layer, so that we can access it from callbacks easily.