ixmaps-gl 0.2.11 → 0.2.15
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 +28 -3
- package/ixmaps-gl.js +883 -181
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,6 +101,31 @@ an id wins, a polygon's position is flat's shape center (the vertex mean in Merc
|
|
|
101
101
|
`chartlower` (else `layerupper`/`layerlower`) hide a theme outside their scales; `.filter()` takes
|
|
102
102
|
flat's grammar (`WHERE a > 5 AND b NOT x`, `LIKE`, `IN`, `BETWEEN`, `$field$`, or a plain regex).
|
|
103
103
|
|
|
104
|
+
### Handle API
|
|
105
|
+
|
|
106
|
+
The main interface is flat's handle chain: `ixmaps.map()` — or `ixmaps.map("name")` for the map
|
|
107
|
+
with that `name` in its `Map()` options, so several maps on one page can be addressed separately
|
|
108
|
+
(no name: the last built map, as in flat). From the map handle, `map("name").theme("themename")`
|
|
109
|
+
returns the theme handle (flat's `themeApi`):
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
ixmaps.map("map1").theme("mytheme").changeStyle("scale:1.2", "factor");
|
|
113
|
+
ixmaps.map().theme("mytheme").show(); // also hide(), toggle(), remove(),
|
|
114
|
+
// replace(theme), markClass(n), unmarkClass(n)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The historic global forms remain as compatibility wrappers and dispatch on arity: the canonical
|
|
118
|
+
theme-first `ixmaps.changeThemeStyle(themeId, "style:value", "set")` and `ixmaps.removeTheme(id)`
|
|
119
|
+
(htmlgui.js), the handle method `map().changeThemeStyle(theme, style, flag)`, and the older
|
|
120
|
+
map-first pages calling `ixmaps.changeThemeStyle(null|mapName, themeId, style, flag)` /
|
|
121
|
+
`ixmaps.removeTheme(null|mapName, id)` / `ixmaps.setBasemapOpacity(null|mapName, opacity, mode)`
|
|
122
|
+
— where a registered map name targets that map and a null or unknown name the last built one.
|
|
123
|
+
The `ixmaps.Map(div, opts, callback)` callback receives the builder for its own
|
|
124
|
+
`.options().view().layer()` chain, which also carries flat's mapApi handle methods
|
|
125
|
+
(`setView`, `replace`, `show`, `getThemes`, … — htmlgui_flat.js), each delegated to the handle
|
|
126
|
+
of that map's options name — so a page that keeps the callback object as its map handle,
|
|
127
|
+
as flat pages do, works unmodified.
|
|
128
|
+
|
|
104
129
|
### Zoom levels
|
|
105
130
|
|
|
106
131
|
Zoom numbers in the ixmaps API are ixmaps-flat's, i.e. Leaflet's (256px tiles):
|
|
@@ -208,7 +233,7 @@ of your own project files gl can render.
|
|
|
208
233
|
Load the engine from jsDelivr, pinned to a release tag (or `@main` for the latest commit):
|
|
209
234
|
|
|
210
235
|
```html
|
|
211
|
-
<script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-gl@v0.2.
|
|
236
|
+
<script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-gl@v0.2.14/ixmaps-gl.js"></script>
|
|
212
237
|
```
|
|
213
238
|
|
|
214
239
|
or from unpkg, the npm package [`ixmaps-gl`](https://www.npmjs.com/package/ixmaps-gl)
|
|
@@ -216,13 +241,13 @@ or from unpkg, the npm package [`ixmaps-gl`](https://www.npmjs.com/package/ixmap
|
|
|
216
241
|
browser script, which defines the global `ixmaps`):
|
|
217
242
|
|
|
218
243
|
```html
|
|
219
|
-
<script src="https://unpkg.com/ixmaps-gl@0.2.
|
|
244
|
+
<script src="https://unpkg.com/ixmaps-gl@0.2.14/ixmaps-gl.js"></script>
|
|
220
245
|
```
|
|
221
246
|
|
|
222
247
|
or use a local copy (`<script src="ixmaps-gl.js"></script>`). A minimal page:
|
|
223
248
|
|
|
224
249
|
```html
|
|
225
|
-
<script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-gl@v0.2.
|
|
250
|
+
<script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-gl@v0.2.14/ixmaps-gl.js"></script>
|
|
226
251
|
<div id="map_div" style="position:absolute;inset:0;"></div>
|
|
227
252
|
|
|
228
253
|
<script>
|