@projektemacher/storymapjs 0.10.3 → 0.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -71,14 +71,43 @@ need `icon` inside the location object.
71
71
  ### Limit the map to a bounding box
72
72
 
73
73
  Set `map_bbox` to `[west, south, east, north]` (lon/lat) to constrain the map —
74
- nothing outside of the box can be visible:
74
+ the view center stays inside the box, so the map cannot pan away from it:
75
75
 
76
76
  map_bbox: [-11, 34, 32, 71], // or null (the default) to leave the map unconstrained
77
77
 
78
78
  For image-space (IIIF) maps the coordinates are raw image pixels. When the
79
79
  slide content panel is opaque (a solid background that hides the map behind it),
80
80
  the initial fit accounts for the covered area so the story stays inside the
81
- visible region.
81
+ visible region. To limit the map to the left, visible half in landscape (with
82
+ an opaque slide panel instead of the gradient over the map), set
83
+ `map_area: "left"` (default `"full"`).
84
+
85
+ ### Custom tile templates
86
+
87
+ `map_type` accepts absolute or relative tile URL templates and style JSON URLs:
88
+
89
+ map_type: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
90
+ map_type: "./tiles/{z}/{x}/{y}.png", // same-origin, works on subpaths + Electron
91
+ map_type: "https://tiles.openfreemap.org/styles/bright", // vector style
92
+
93
+ Any value containing `{z}` renders as a raster XYZ layer; a path without `{z}`
94
+ that looks like a URL/path renders as a vector style layer; anything else falls
95
+ back to classic OSM raster.
96
+
97
+ ### Switching the basemap at runtime
98
+
99
+ `storymap.setMapOption("map_type", next)` / `setMapOptions({...})` rebuilds the
100
+ main tile layer **and** the minimap (`ol/control/OverviewMap`) layer, keeping
101
+ the overview fitted to the marker bounds (zoomify/IIIF extents preserved). The
102
+ current slide is re-fitted after the swap.
103
+
104
+ ### Icons
105
+
106
+ Default pins use the bundled `vco-icons` font (`dist/css/icons/`, referenced via
107
+ relative `./icons/...` URLs from `dist/css/storymap.css`), so pins render on
108
+ subpath deploys, bundler consumers (Vite leaves absolute `/css/...` untouched)
109
+ and `file://`/Electron hosts without extra configuration. Import the stylesheet
110
+ once (`import "@projektemacher/storymapjs/css/storymap.css"`).
82
111
 
83
112
  ## Custom HTML in slide content
84
113
 
@@ -1 +1 @@
1
- import{t as e}from"./main-mUk_qlWN.js";import"./modulepreload-polyfill-P2Xu9kJm.js";function t(e){document.title=`StoryMapJS: `+e.title}window.storymap=new e(`storymap-embed`,`./demo.json`,{},{title:t});
1
+ import{t as e}from"./main-DwbXrrYn.js";import"./modulepreload-polyfill-P2Xu9kJm.js";function t(e){document.title=`StoryMapJS: `+e.title}window.storymap=new e(`storymap-embed`,`./demo.json`,{},{title:t});
@@ -1 +1 @@
1
- import{t as e}from"./main-mUk_qlWN.js";import"./modulepreload-polyfill-P2Xu9kJm.js";window.__smErrors=[],window.__smReady=!1,window.addEventListener(`error`,e=>{window.__smErrors.push(String(e.message||e))});var t=new URLSearchParams(window.location.search),n=t.get(`manifest`),r=t.get(`url`),i=n===null?t.get(`example`):n,a=n===null?`/examples/`:`/examples-iiif/`,o={};if(t.get(`options`))try{o=JSON.parse(t.get(`options`))}catch(e){window.__smErrors.push(`harness: bad options param: `+e)}var s=r??a+i+`.json`;fetch(s).then(e=>e.json()).then(t=>{window.__sm=new e(`storymap-embed`,t,o,{}),window.__smReady=!0}).catch(e=>{window.__smErrors.push(`harness: `+(e&&e.message?e.message:String(e))),window.__smReady=!0});
1
+ import{t as e}from"./main-DwbXrrYn.js";import"./modulepreload-polyfill-P2Xu9kJm.js";window.__smErrors=[],window.__smReady=!1,window.addEventListener(`error`,e=>{window.__smErrors.push(String(e.message||e))});var t=new URLSearchParams(window.location.search),n=t.get(`manifest`),r=t.get(`url`),i=n===null?t.get(`example`):n,a=n===null?`/examples/`:`/examples-iiif/`,o={};if(t.get(`options`))try{o=JSON.parse(t.get(`options`))}catch(e){window.__smErrors.push(`harness: bad options param: `+e)}var s=r??a+i+`.json`;fetch(s).then(e=>e.json()).then(t=>{window.__sm=new e(`storymap-embed`,t,o,{}),window.__smReady=!0}).catch(e=>{window.__smErrors.push(`harness: `+(e&&e.message?e.message:String(e))),window.__smReady=!0});