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.
find_file contained a lot of code for searching textures in ways that
haven't been relevant for years. For example, it had workarounds for
MCPatcher, a tool that hasn't been updated since 2015.
Instead of searching in multiple paths that will never succeed in a
resource pack and Minecraft version that actually work, just look
for the filename that the block functions ask for.
Also, if we already have a manually specified resource pack open,
we shouldn't repeatedly re-open it. Furthermore, it's best if
the very first thing find_file does is try to find the file in
the resource pack or client jar we've already opened previously.
We can now also remove chest.png, ender.png, foliage.png, grass.png
and normal_double.png because Minecraft ships them, so we don't
need to ship them ourselves too. Us shipping them actually hid the
whole find_file garbagefire.
Concerns issue #1604.
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.