Commit Graph

45 Commits

Author SHA1 Message Date
Martin Rubli
c7bfee6f1d README.md: Whitespace fixes 2025-04-09 22:03:08 +02:00
Martin Rubli
92468ccc75 Add MIT license
Fixes #2
v0.1.0
2025-04-06 22:45:58 +02:00
Martin Rubli
1659320af0 README.md: Add example and documentation 2024-04-26 15:11:24 +02:00
Martin Rubli
8525f00af0 layouts: map: Document track options 'color' and 'opacity' 2024-04-26 15:11:23 +02:00
Martin Rubli
d3d9510b9a static: js: Remove .map and LICENSE.txt 2024-02-16 21:45:23 +01:00
Martin Rubli
9ab719213c static: css: Fix image path for resize handle
If the site is deployed to a different root path (e.g. /photos/), the absolute
/images path is broken. Use a relative path instead since the CSS and the images
are both underneath the static directory.
2024-02-15 23:11:52 +01:00
Martin Rubli
6c29c3e839 static: js: Update quip-maps to use inline assets 2024-02-13 22:44:53 +01:00
Martin Rubli
0a5c018c0d layouts: leaflet-loader: Use relURL instead of .Site.BaseURL 2023-12-31 23:34:38 +01:00
Martin Rubli
2c043be976 layouts: leaflet-loader: Fix absolute URL used for loading quip-maps stylesheet 2023-12-31 23:00:14 +01:00
Martin Rubli
1f6c33e3d1 layouts: leaflet-loader: Fix absolute URL used for loading quip-maps
This only worked for local builds with a baseURL of http://localhost:1313/ but
not on something like http://myserver/mybase/.
2023-12-31 22:47:12 +01:00
Martin Rubli
4e3d0a9626 layouts: map: Allow customizing track color and opacity 2023-12-30 18:56:28 +01:00
Martin Rubli
5991d8527f layouts: map: Add leaflet-map parameters for controlling Leaflet.Freezy options 2023-12-30 18:56:28 +01:00
Martin Rubli
6f9ffd0b77 layouts: map: Make tracks downloadable 2023-12-30 18:56:28 +01:00
Martin Rubli
43bf92e9b5 static: js: Update quip-maps to v0.0.9, allows passing of tracks as objects 2023-12-30 18:56:24 +01:00
Martin Rubli
b4bb5effcd static: js: Update quip-maps to v0.0.8 for leaflet-freezy fixes 2023-12-26 23:08:50 +01:00
Martin Rubli
f3746e0fc4 layouts: map: Make unique ID unique on page, not only shortcut parent
The SHORTCODE.Ordinal method "returns the zero-based ordinal of the shortcode in
relation to its parent." (https://gohugo.io/methods/shortcode/ordinal/)

This is a problem if the same shortcode is used on the different page through
different paths, e.g. once on the page itself and once by a partial (e.g. a
header or footer).

Instead of just using the .Ordinal by itself, use a hash of the parent file
_and_ the ordinal, which gives us a properly unique identifier.
2023-12-18 23:35:44 +01:00
Martin Rubli
0384314398 layouts: map: Enable freezing of maps (scroll capture protection) by default 2023-12-18 23:35:20 +01:00
Martin Rubli
873bafef2b layouts: map: Fix accidentally quoted true value in generated JS
This doesn't seem to have had any practical impact, though.
2023-12-18 23:35:20 +01:00
Martin Rubli
b38715d57f static: js: Update quip-maps to v0.0.7 for leaflet-freezy support 2023-12-18 23:34:40 +01:00
Martin Rubli
023b8a7e50 static: css: Fix map tile offset for maps with Tailwind Typography
Embedding a Leaflet map within a Tailwind Typography-styled <article> leads to a
very subtle (the higher the zoom the subtler) vertical map offset. It is
particularly noticeable in combination with track overlays where tracks and map
are suddenly misaligned.

The root cause is this part of the Tailwind-generated stylesheet:

  .prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)) {
      margin-top: 2em;
      margin-bottom: 2em
  }

It adds a 2em margin to all <img> element and, because Leaflet tiles are images,
that leads to a vertical offset.

The obvious solution is to not embed maps in a <article class="prose">. Another
workaround is to add a "not-prose" class to the map container:

  <div id="map_container" class="not-prose">…</div>

While the above should reliably prevent any other Tailwind shenanigans, forcing
the <img> margin to be zero should work well enough for now.
2023-12-18 23:16:48 +01:00
Martin Rubli
c6abd5038e layouts: leaflet-loader: Update Leaflet, jQuery to match quip-maps v0.0.6 2023-12-18 23:16:46 +01:00
Martin Rubli
e97f51ab4d layouts: map: Document the available Swisstopo layers 2023-10-26 21:56:51 +02:00
Martin Rubli
7e049af12a Merge branch 'feature/quip-maps-v0.0.6' 2023-10-24 22:18:14 +02:00
Martin Rubli
8258a580e7 layouts: map: Add option to make map non-maximizable 2023-10-24 22:17:57 +02:00
Martin Rubli
440f144cb9 layouts: map: Add option to make map non-resizable 2023-10-24 22:17:57 +02:00
Martin Rubli
e5da3c0bd8 layouts: map: Update leaflet-elevation-profile documentation 2023-10-24 22:17:57 +02:00
Martin Rubli
8deb7c4698 layouts: map: Add elevation profile option to not expand graph by default 2023-10-24 22:17:57 +02:00
Martin Rubli
e09725f46e static: css: Apply a quip-maps fix for non-resizable maps
See commit 200335d594893f9a1b405279e53533e5024ee0eb in quip-maps for an
explanation:

  demo: css: Fix attribution moving to bottom when map not resizeable
2023-10-24 22:17:57 +02:00
Martin Rubli
ef18860c55 Update quip-maps to v0.0.6 2023-10-24 22:17:55 +02:00
Martin Rubli
6d56b158c0 Update quip-maps to v0.0.5
This contains a fix for the elevation profile choking on .gpx files containing
waypoints (a Leaflet.Heightgraph bug) and disables waypoint rendering by
default.
2023-10-18 22:40:08 +02:00
Martin Rubli
cad859304d layouts: map: Change defaults for width/height to auto and 50vh 2023-10-17 22:58:01 +02:00
Martin Rubli
78588d0c2d layouts: map: Allow specifying width/height in the shortcode tag 2023-10-16 21:13:04 +02:00
Martin Rubli
ea709de623 static: css: Fix z-order of maximized maps to be above other maps on the page 2023-10-16 21:13:04 +02:00
Martin Rubli
43597473a0 static: css: Increase backdrop transparency 2023-10-16 21:13:04 +02:00
Martin Rubli
f010baf633 static: css: Place attributions below the map they belong to
Previously all attributions were placed below the last map on the page.
2023-10-16 21:13:04 +02:00
Martin Rubli
e899c078ee static: css: Remove remnants of an earlier design 2023-10-16 21:13:04 +02:00
Martin Rubli
f1a1b8ed53 layouts: elevation-profile: Add width/height parameters 2023-10-16 21:13:04 +02:00
Martin Rubli
c7fb817a0b layouts: scale: Add position parameter 2023-10-16 21:13:04 +02:00
Martin Rubli
475cb4fd5d layouts: layer: Add selectorPosition parameter 2023-10-16 21:13:04 +02:00
Martin Rubli
88b9607472 layouts: Add shortcodes for various leaflet map elements 2023-10-16 21:13:04 +02:00
Martin Rubli
8127926564 layouts: Add leaflet-loader partial 2023-10-16 21:13:04 +02:00
Martin Rubli
05e5977ea2 static: Add basic styles requires for quip-maps 2023-10-16 21:13:04 +02:00
Martin Rubli
d25d63845e Add quip-maps v0.0.4 distribution files 2023-10-16 21:13:04 +02:00
Martin Rubli
09d393293e Initialize project as Hugo module 2023-10-16 21:13:04 +02:00
Martin Rubli
0a0d967557 Add empty .gitignore 2023-10-10 23:45:13 +02:00