ixmaps-gl 0.2.24 → 0.2.30
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 +21 -8
- package/ixmaps-gl.js +1595 -748
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ circle/square/diamond/triangle. See the top-of-file comment in
|
|
|
124
124
|
A page's `.require(url)` scripts (page code, e.g. a user chart function) load in order before the
|
|
125
125
|
layers are built. `ixmaps.map()` is the map handle as in flat — its calls wait until the map is ready —
|
|
126
126
|
with `add(theme, flags)` / `replace` / `replaceTheme` / `remove`, `changeThemeStyle` for any style key,
|
|
127
|
-
`getZoom()` (flat's zoom), `resize()`, `attribution(text)` (the page's attribution, bottom left on the map as in flat, in the style of the basemap credit and on its line — also
|
|
127
|
+
`getZoom()` (flat's zoom), `resize()`, `attribution(text)` (the page's attribution, bottom left on the map as in flat, in the style of the basemap credit and on its line, dark on a dark map like the zoom buttons — also
|
|
128
128
|
`.attribution()` on the builder, the `attribution` map option and `ixmaps.setAttribution(text)`; the basemap's credit stays bottom right), `setBasemapOpacity` and `setMapType(id)` (also `setMapTypeId`, `mapType`: a basemap name reading dark/black/night/matter loads CARTO Dark Matter, any other name CARTO Positron, a color a plain background — the same rule the `mapType` option follows at start); the page's `htmlgui_onNewTheme(id)` and
|
|
129
129
|
`htmlgui_onZoomAndPan()` (also once on load) are called (as in flat, a theme swapped in with `replace` comes last
|
|
130
130
|
in the legend, while FEATURE and CHOROPLETH shapes always draw under the charts), and `map`, `getZoom` and flat's
|
|
@@ -224,10 +224,23 @@ but unused. It never mutates the page's own objects. Unit tests: `cd test && npm
|
|
|
224
224
|
|
|
225
225
|
### World copies
|
|
226
226
|
|
|
227
|
-
At an extreme zoom-out MapLibre repeats the world side by side
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
At an extreme zoom-out MapLibre repeats the world side by side. The themes are drawn once, as in
|
|
228
|
+
flat (which repeats only its basemap tiles): the map pans freely past the world's edge, with empty
|
|
229
|
+
space beside it. `.options({themecopies: true})` (also at runtime) repeats the themes on every world
|
|
230
|
+
copy. `.options({worldcopies: false})` draws the world once for the map itself, but MapLibre then
|
|
231
|
+
also stops the zoom-out where the world gets narrower than the window.
|
|
232
|
+
|
|
233
|
+
### Click to action
|
|
234
|
+
|
|
235
|
+
flat's click-to-action (`ui/js/tools/tooltip_to_action.js`, e.g. a click on a country filters every
|
|
236
|
+
theme of the page to it) works as on flat: on a click on an item the engine calls the page's
|
|
237
|
+
`ixmaps.onItemAction(szId, item, themeObj)`, `item.szSelectionId` being the value of the theme's
|
|
238
|
+
selection field, and `ixmaps.onItemAction(null, null)` on a click on the map background. The
|
|
239
|
+
selection field, `getThemeObj(id).szSelectionField`, is the `id` binding, else the position (or
|
|
240
|
+
lookup) field; an aggregated item gives its first record's value. The flat script's own
|
|
241
|
+
`htmlgui_onItemClick`, which reads flat's SVG, is not called — the page only needs
|
|
242
|
+
`.require(".../tooltip_to_action.js")` (or its own `ixmaps.onItemAction`). The click still pins the
|
|
243
|
+
tooltip. See [`ports/index_embed_migration - Zeit online data - 2015-2020 - click2filter.html`](./ports/index_embed_migration%20-%20Zeit%20online%20data%20-%202015-2020%20-%20click2filter.html).
|
|
231
244
|
|
|
232
245
|
### Data formats and data.js
|
|
233
246
|
|
|
@@ -289,7 +302,7 @@ of your own project files gl can render.
|
|
|
289
302
|
Load the engine from jsDelivr, pinned to a release tag (or `@main` for the latest commit):
|
|
290
303
|
|
|
291
304
|
```html
|
|
292
|
-
<script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-gl@v0.2.
|
|
305
|
+
<script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-gl@v0.2.30/ixmaps-gl.js"></script>
|
|
293
306
|
```
|
|
294
307
|
|
|
295
308
|
or from unpkg, the npm package [`ixmaps-gl`](https://www.npmjs.com/package/ixmaps-gl)
|
|
@@ -297,13 +310,13 @@ or from unpkg, the npm package [`ixmaps-gl`](https://www.npmjs.com/package/ixmap
|
|
|
297
310
|
browser script, which defines the global `ixmaps`):
|
|
298
311
|
|
|
299
312
|
```html
|
|
300
|
-
<script src="https://unpkg.com/ixmaps-gl@0.2.
|
|
313
|
+
<script src="https://unpkg.com/ixmaps-gl@0.2.30/ixmaps-gl.js"></script>
|
|
301
314
|
```
|
|
302
315
|
|
|
303
316
|
or use a local copy (`<script src="ixmaps-gl.js"></script>`). A minimal page:
|
|
304
317
|
|
|
305
318
|
```html
|
|
306
|
-
<script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-gl@v0.2.
|
|
319
|
+
<script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-gl@v0.2.30/ixmaps-gl.js"></script>
|
|
307
320
|
<div id="map_div" style="position:absolute;inset:0;"></div>
|
|
308
321
|
|
|
309
322
|
<script>
|