0
Commit Graph

195 Commits

Author SHA1 Message Date
Nicolas F
cadb24a015 assetmanager: rename icons dir to markers, symlink
This fixes a name collision with Apache's default config.

Closes #1773. Install nginx already.
2020-06-24 17:57:12 +02:00
Nicolas F
1d8279243d genPOI: polyline text improvements
Don't require text for polylines/polygons, and support hovertext
by utilising leaflet's tooltips.
2020-02-13 18:35:20 +01:00
Nicolas F
2c92b4acf9 Merge PR 1649 from deltaidea 2020-02-13 17:40:35 +01:00
Cliff Meyers
a29e9ddf20 Track centers by layer instead of by world
This fixes a bug where a world with multiple layers with different
"northdirection" values would initially load at the wrong center point
because the center for the last layer would override prior values
in the overview.collections.centers map.
2019-12-30 19:40:36 -05:00
Nikita Litvin
a3b9493c57 genPOI: support polylines and filled-in polygons
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.
2019-12-24 01:23:00 +03:00
Andy Martin
17e3e48928 goToHash: set current layer before firing worldCtrl's onChange event so the correct layer is added 2019-10-26 13:36:46 +01:00
Nicolas F
a9aabab790 util.js: actually run the ready queue
Fixes #1466 I hope.
2019-07-12 17:25:29 +02:00
Nicolas F
402d35fefc util.js: remove some obsolete stuff
A few debug console.log statements got the axe too, because I
felt like it.
2019-07-12 16:55:47 +02:00
Nicolas F
4d27cf3dfc util.js: don't specify a map minzoom of 0
Who put this here? Why? Whatever.

Fixes #1590.
2019-07-12 16:43:05 +02:00
Nicolas F
204bcd0310 Add "center" config option
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.
2019-07-06 19:06:15 +02:00
Nicolas F
5b0430f94b textures: greatly simplify find_file and friends
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.
2019-07-04 18:24:57 +02:00
Nicolas F
b6a3c18b65 web_assets: update leaflet to 1.5.1 2019-06-25 19:40:42 +02:00
mircokroon
2dc8ebd4d9 Ensure coordinates are properly converted when changing views (#1571)
* Ensure coordinates are properly converted when changing views
2019-05-19 11:54:01 +02:00
Nicolas F
6f680aa287 Revert "web: fix goToHash on layer change"
This reverts commit 2186d08c32.

Fixes #1553.
2019-04-21 18:02:19 +02:00
aheadley
2186d08c32 web: fix goToHash on layer change
Fixes #1548.
2019-03-28 16:07:30 +01:00
Nicolas F
311d3eacc2 web: add layer fallback to goToHash
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.
2019-02-28 13:37:19 +01:00
Nicolas F
b57db703ae web: fix overlays showing up for all base layers
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.
2019-02-27 14:22:18 +01:00
Nicolas F
bc71ad7a8f web: fix white rectangle behind markers 2019-02-21 18:25:50 +01:00
Nicolas F
23f8cbd330 web: reimplement marker groups default checking
Now you can use checked=True again!

Fixes #1474.
2019-02-21 17:24:08 +01:00
Nicolas F
a05daa7519 Merge pull request #1510 from 14mRh4X0r/fix-icon-offset
Fix marker icon position properly. Closes #1481.
2019-02-21 15:59:14 +01:00
Aaron Griffith
1e4cabe5d0 Merge branch 'master' into minecraft113 2019-02-19 14:28:34 -05:00
Willem Mulder
ad5c419546 Fix marker icon position properly. Closes #1481.
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.
2019-01-23 21:13:59 +01:00
Marc Tönsing
3727f0407a removed strong tags in coordination box
This fixes navigation not working on iOS Safari on iPad and iPhone.
2019-01-10 23:22:27 +01:00
Nicolas F
bde265a8ac web: fix createInfoWindow not having any effect
Fixes #1494.
2018-11-18 09:18:55 +01:00
Nicolas F
2918637539 web: fix marker icon position
Shoutouts to 14mRh4X0r for finding the right CSS properties that
work for centering the marker icons.

Fixes #1481.
2018-11-18 09:10:54 +01:00
Aaron Griffith
e867221d8e Merge #1488: Make JSObserver work with Leaflet.
Fixes #1451.
2018-10-09 11:03:15 -04:00
Aaron Griffith
dc70d6dc62 Merge #1487: Use cached center for initial view.
Fixes #1453.
2018-10-09 11:01:27 -04:00
Willem Mulder
4efb9f2d89 Make JSObserver work with Leaflet. Fixes #1451. 2018-10-08 19:45:57 +02:00
Willem Mulder
3cc184a751 Use cached center for initial view. Fixes #1453. 2018-10-06 18:12:17 +02:00
Leigh Oliver
f4e5b54651 Fixed behaviour of 'defaultZoom' property.
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.
2018-09-13 11:02:11 +10:00
Vladislav Glinsky
7de8fa4f17 Fix missing titles for markers 2018-07-31 00:41:00 +03:00
Nicolas F
39d9dba814 Merge branch 'whitespaces' of https://github.com/r15ch13/Minecraft-Overviewer into r15ch13-fixes 2018-06-14 13:54:34 +02:00
Richard Kuhnt
bc37eaef81 Remove trailing whitespaces 2018-06-13 20:30:59 +02:00
Richard Kuhnt
c6e674e6ce Remove jQuery and underscore dependencies
- replace $.each with .forEach
- replace _.each with .forEach
- replace _.isFunction with typeof comparison
2018-06-13 20:11:46 +02:00
Richard Kuhnt
f58e5bd626 Use <noscript> to display message when JavaScript is disabled 2018-06-13 18:57:37 +02:00
Nicolas F
a129274aa1 Remove broken marker centreing code
Apparently, having an image's origin be in the center is too
advanced of a concept for The Web™. I guess we can't do this then.
2018-05-09 16:22:21 +02:00
Nicolas F
6fbced79bf Fix custom icons not showing up properly
Individual POIs such as player POIs can have their own icon per
POI, so we should respect that.
2018-05-09 15:45:31 +02:00
Andrew Chin
b9be8f8ffd Fixes and improvements to leaflet marker support 2018-05-06 13:47:51 -04:00
Nicolas F
12c12d128f Set the attribution prefix 2018-05-06 17:44:07 +02:00
Nicolas F
05cc9e60e7 Don't collapse marker group control 2018-05-06 17:12:03 +02:00
Nicolas F
23ea1918ea Update leaflet to 1.3.1 2018-05-06 17:11:46 +02:00
Nicolas F
ea33ebe2fb Assume 32x32 marker size so they get centred
Maybe expose this as an option to the markers dict later, with
the anchor as an option too.
2018-05-06 16:59:27 +02:00
Nicolas F
614663f601 Show marker group display names 2018-05-06 16:53:32 +02:00
Nicolas F
84b52326dc leaflet: Reimplement coordinate box on bottom left
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.
2017-03-13 14:04:37 +01:00
Andrew Chin
7a6b9973c2 Protect against optional marker variable 2017-02-19 11:46:44 -05:00
Nicolas F
7af5375df9 Actually add the high-dpi icons, durr
Oops I forgot
2017-02-19 11:37:02 -05:00
Nicolas F
3093a07dc2 Remove old junk in web_assets 2017-02-19 11:36:53 -05:00
Nicolas F
99817f786f Re-implement map compass 2017-02-19 11:36:37 -05:00
Nicolas F
e0b36fa9e4 Move icon anchor to tip of icons
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.
2017-02-19 11:36:24 -05:00
Nicolas F
6426182c1e Add retina size icons for spawn and location
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.
2017-02-19 11:36:15 -05:00