isard 1.7.0 → 1.9.0
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/CHANGELOG.md +53 -0
- package/dist/basemap/grid.js +2 -5
- package/dist/basemap/grid.js.map +1 -1
- package/dist/basemap/models/furniture.d.ts +12 -0
- package/dist/basemap/{furniture.js → models/furniture.js} +6 -8
- package/dist/basemap/models/furniture.js.map +1 -0
- package/dist/basemap/{meshes.js → models/meshes.js} +1 -1
- package/dist/basemap/models/meshes.js.map +1 -0
- package/dist/basemap/models/trees.d.ts +21 -0
- package/dist/basemap/{trees.js → models/trees.js} +4 -36
- package/dist/basemap/models/trees.js.map +1 -0
- package/dist/basemap/placed.d.ts +2 -0
- package/dist/basemap/placed.js +2 -0
- package/dist/basemap/placed.js.map +1 -1
- package/dist/basemap/pmtiles.js +4 -3
- package/dist/basemap/pmtiles.js.map +1 -1
- package/dist/basemap/pmtileslayer.d.ts +4 -4
- package/dist/basemap/pmtileslayer.js +2 -1
- package/dist/basemap/pmtileslayer.js.map +1 -1
- package/dist/basemap/resample.js +3 -2
- package/dist/basemap/resample.js.map +1 -1
- package/dist/basemap/terrain.d.ts +5 -0
- package/dist/basemap/terrain.js +6 -4
- package/dist/basemap/terrain.js.map +1 -1
- package/dist/basemap/vectortiles/context.d.ts +3 -2
- package/dist/basemap/vectortiles/context.js.map +1 -1
- package/dist/basemap/vectortiles/extrusions.js.map +1 -1
- package/dist/basemap/vectortiles/furniture.d.ts +3 -3
- package/dist/basemap/vectortiles/furniture.js +2 -1
- package/dist/basemap/vectortiles/furniture.js.map +1 -1
- package/dist/basemap/vectortiles/labels.js +2 -1
- package/dist/basemap/vectortiles/labels.js.map +1 -1
- package/dist/basemap/vectortiles/lamps.d.ts +3 -3
- package/dist/basemap/vectortiles/lamps.js +1 -1
- package/dist/basemap/vectortiles/lamps.js.map +1 -1
- package/dist/basemap/vectortiles/placed.d.ts +3 -2
- package/dist/basemap/vectortiles/placed.js +5 -10
- package/dist/basemap/vectortiles/placed.js.map +1 -1
- package/dist/basemap/vectortiles/street-wind.js +2 -2
- package/dist/basemap/vectortiles/street-wind.js.map +1 -1
- package/dist/basemap/vectortiles/style.js +7 -8
- package/dist/basemap/vectortiles/style.js.map +1 -1
- package/dist/basemap/vectortiles/tiles.d.ts +1 -3
- package/dist/basemap/vectortiles/tiles.js +1 -1
- package/dist/basemap/vectortiles/tiles.js.map +1 -1
- package/dist/basemap/vectortiles/trees.d.ts +4 -4
- package/dist/basemap/vectortiles/trees.js +2 -1
- package/dist/basemap/vectortiles/trees.js.map +1 -1
- package/dist/basemap/vectortiles/vectors.d.ts +2 -3
- package/dist/basemap/vectortiles/vectors.js.map +1 -1
- package/dist/basemap/vectortiles.d.ts +6 -5
- package/dist/basemap/vectortiles.js +4 -3
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap/wmts.js +3 -4
- package/dist/basemap/wmts.js.map +1 -1
- package/dist/basemap/{trees.d.ts → woods.d.ts} +2 -19
- package/dist/basemap/woods.js +38 -0
- package/dist/basemap/woods.js.map +1 -0
- package/dist/basemap/workerpool.d.ts +1 -1
- package/dist/basemap/workerpool.js +3 -3
- package/dist/basemap/workerpool.js.map +1 -1
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +23 -22
- package/dist/bind/layers.d.ts +10 -3
- package/dist/bind/layers.js +11 -4
- package/dist/bind/layers.js.map +1 -1
- package/dist/data/collada.js +4 -4
- package/dist/data/collada.js.map +1 -1
- package/dist/data/ifc.js +6 -11
- package/dist/data/ifc.js.map +1 -1
- package/dist/decoder.worker.js +5 -5
- package/dist/decoder.worker.js.map +7 -6
- package/dist/decoding/decoders.js.map +1 -0
- package/dist/{engine → decoding}/loader.js +2 -2
- package/dist/decoding/loader.js.map +1 -0
- package/dist/{engine → decoding}/protocol.d.ts +1 -1
- package/dist/decoding/protocol.js.map +1 -0
- package/dist/engine-loader.d.ts +1 -1
- package/dist/engine-loader.js +3 -2
- package/dist/engine-loader.js.map +1 -1
- package/dist/geoplateforme.d.ts +4 -3
- package/dist/geoplateforme.js +8 -10
- package/dist/geoplateforme.js.map +1 -1
- package/dist/index.d.ts +16 -8
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/isard_bg.wasm +0 -0
- package/dist/isard_core_bg.wasm +0 -0
- package/dist/isard_grid_bg.wasm +0 -0
- package/dist/isard_tess_bg.wasm +0 -0
- package/dist/layers/custom.d.ts +56 -0
- package/dist/layers/custom.js +93 -0
- package/dist/layers/custom.js.map +1 -0
- package/dist/layers/extrusions.d.ts +4 -2
- package/dist/layers/extrusions.js +2 -1
- package/dist/layers/extrusions.js.map +1 -1
- package/dist/layers/features.d.ts +3 -14
- package/dist/layers/features.js +4 -25
- package/dist/layers/features.js.map +1 -1
- package/dist/layers/flow.d.ts +3 -3
- package/dist/layers/flow.js +3 -4
- package/dist/layers/flow.js.map +1 -1
- package/dist/layers/glyphs.js +5 -3
- package/dist/layers/glyphs.js.map +1 -1
- package/dist/layers/ground.d.ts +57 -0
- package/dist/layers/ground.js +78 -0
- package/dist/layers/ground.js.map +1 -0
- package/dist/layers/icons.js +8 -6
- package/dist/layers/icons.js.map +1 -1
- package/dist/layers/layers.d.ts +2 -199
- package/dist/layers/layers.js +2 -469
- package/dist/layers/layers.js.map +1 -1
- package/dist/layers/models.d.ts +48 -0
- package/dist/layers/models.js +111 -0
- package/dist/layers/models.js.map +1 -0
- package/dist/layers/network.d.ts +26 -0
- package/dist/layers/network.js +127 -0
- package/dist/layers/network.js.map +1 -0
- package/dist/layers/panoramas.d.ts +2 -11
- package/dist/layers/panoramas.js +19 -9
- package/dist/layers/panoramas.js.map +1 -1
- package/dist/layers/photos.d.ts +4 -7
- package/dist/layers/photos.js +3 -4
- package/dist/layers/photos.js.map +1 -1
- package/dist/layers/pointclouds.d.ts +3 -2
- package/dist/layers/pointclouds.js +3 -3
- package/dist/layers/pointclouds.js.map +1 -1
- package/dist/layers/raster.d.ts +9 -0
- package/dist/layers/raster.js +24 -0
- package/dist/layers/raster.js.map +1 -0
- package/dist/layers/symbols.d.ts +2 -2
- package/dist/layers/symbols.js +2 -1
- package/dist/layers/symbols.js.map +1 -1
- package/dist/layers/tiles3d.d.ts +15 -0
- package/dist/layers/tiles3d.js +55 -0
- package/dist/layers/tiles3d.js.map +1 -0
- package/dist/layers/trees.d.ts +5 -7
- package/dist/layers/trees.js +2 -1
- package/dist/layers/trees.js.map +1 -1
- package/dist/layers/vectors.js.map +1 -1
- package/dist/map/basemap-layers.js +1 -1
- package/dist/map/basemap-layers.js.map +1 -1
- package/dist/map/engine-settings.d.ts +1 -1
- package/dist/map/engine-settings.js +1 -1
- package/dist/map/engine-settings.js.map +1 -1
- package/dist/map/engines.js.map +1 -1
- package/dist/map/layer-spec.d.ts +7 -13
- package/dist/map/layer-spec.js.map +1 -1
- package/dist/map/workers.js +3 -4
- package/dist/map/workers.js.map +1 -1
- package/dist/map.d.ts +15 -58
- package/dist/map.js +39 -52
- package/dist/map.js.map +1 -1
- package/dist/panoramax.d.ts +15 -2
- package/dist/panoramax.js +38 -21
- package/dist/panoramax.js.map +1 -1
- package/dist/react/CustomLayer.d.ts +1 -1
- package/dist/react/CustomLayer.js +5 -4
- package/dist/react/CustomLayer.js.map +1 -1
- package/dist/react/Layer.d.ts +6 -2
- package/dist/react/Layer.js +6 -5
- package/dist/react/Layer.js.map +1 -1
- package/dist/react/VectorGeometry.js +5 -4
- package/dist/react/VectorGeometry.js.map +1 -1
- package/dist/react/VectorTiles.d.ts +2 -2
- package/dist/react/VectorTiles.js +1 -1
- package/dist/react/VectorTiles.js.map +1 -1
- package/dist/react/context.d.ts +3 -0
- package/dist/react/context.js +8 -1
- package/dist/react/context.js.map +1 -1
- package/dist/types.d.ts +14 -4
- package/dist/types.js.map +1 -1
- package/dist/ui/controls.js +2 -1
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/interaction.js +6 -5
- package/dist/ui/interaction.js.map +1 -1
- package/dist/ui/minimap.js +1 -1
- package/dist/ui/minimap.js.map +1 -1
- package/dist/ui/overlay.js +3 -3
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/search.js +1 -1
- package/dist/ui/search.js.map +1 -1
- package/dist/util/animation.js +3 -2
- package/dist/util/animation.js.map +1 -1
- package/dist/util/color.d.ts +10 -0
- package/dist/util/color.js +29 -9
- package/dist/util/color.js.map +1 -1
- package/dist/util/fetch.d.ts +5 -0
- package/dist/util/fetch.js +11 -0
- package/dist/util/fetch.js.map +1 -0
- package/dist/util/geo.d.ts +5 -0
- package/dist/util/geo.js +8 -2
- package/dist/util/geo.js.map +1 -1
- package/dist/util/math.d.ts +3 -0
- package/dist/util/math.js +4 -0
- package/dist/util/math.js.map +1 -0
- package/dist/util/requests.js.map +1 -0
- package/dist/util/roofs.d.ts +0 -2
- package/dist/util/roofs.js +0 -3
- package/dist/util/roofs.js.map +1 -1
- package/dist/wasm/isard.js +1 -1
- package/dist/wasm/isard_core.js +1 -1
- package/dist/workers/basemap/geometry.d.ts +9 -19
- package/dist/workers/{basemap.worker.d.ts → basemap/protocol.d.ts} +29 -23
- package/dist/workers/basemap/street.d.ts +4 -2
- package/dist/workers/basemap/tiles.d.ts +1 -3
- package/dist/workers/basemap/trees.d.ts +2 -2
- package/package.json +1 -1
- package/dist/basemap/furniture.d.ts +0 -26
- package/dist/basemap/furniture.js.map +0 -1
- package/dist/basemap/meshes.js.map +0 -1
- package/dist/basemap/trees.js.map +0 -1
- package/dist/engine/decoders.js.map +0 -1
- package/dist/engine/loader.js.map +0 -1
- package/dist/engine/protocol.js.map +0 -1
- package/dist/engine/requests.js.map +0 -1
- package/dist/workers/basemap/furniture.d.ts +0 -13
- package/dist/workers/basemap/labels.d.ts +0 -24
- package/dist/workers/basemap/lamps.d.ts +0 -10
- package/dist/workers/basemap/raster.d.ts +0 -10
- package/dist/workers/basemap.worker.js +0 -221
- package/dist/workers/basemap.worker.js.map +0 -1
- /package/dist/basemap/{meshes.d.ts → models/meshes.d.ts} +0 -0
- /package/dist/{engine → decoding}/decoders.d.ts +0 -0
- /package/dist/{engine → decoding}/decoders.js +0 -0
- /package/dist/{engine → decoding}/loader.d.ts +0 -0
- /package/dist/{engine → decoding}/protocol.js +0 -0
- /package/dist/{engine → util}/requests.d.ts +0 -0
- /package/dist/{engine → util}/requests.js +0 -0
package/dist/layers/icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/layers/icons.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAsBxD,MAAM,OAAO,GAAG,CAAC,KAAc,EAA+B,EAAE,CAC9D,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;AAEtF,4EAA4E;AAC5E,MAAM,YAAY,GAAG,CAAC,KAAc,EAAuB,EAAE,CAC3D,QAAQ,CAAC,KAAK,CAAC;IACf,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;IACjF,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAC;IACxE,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC;IAC3D,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,C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ons for the symbol layers: the images of a style's sprite (MapLibre's sprite format: a JSON index and a PNG sheet,\n * `@2x` on high-density screens, one sprite or several with their ids) and the application's own (`map.addImage`),\n * packed on first use into an RGBA atlas the engine samples (premultiplied: no dark fringe where it is scaled); and the\n * layout of an icon around its anchor: by its anchor and offset, or stretched around its text (`icon-text-fit`), by\n * the stretchable zones and the content box of its image when it has them (`stretchX`, `stretchY`, `content`).\n */\n\nimport { withHeaders } from '../engine/requests.ts';\nimport type { Anchor } from '../ui/overlay.ts';\nimport { isNumbers, isRecord } from '../util/guards.ts';\nimport type { Engine } from '../wasm/isard.js';\n\n/** An image of a sprite's index: its place in the sheet (pixels) and how it is drawn */\nexport interface SpriteIcon {\n x: number;\n y: number;\n width: number;\n height: number;\n /** Image pixels per CSS pixel (default 1; 2 in an `@2x` sheet) */\n pixelRatio?: number;\n /** A signed distance field in alpha, drawn in the icon color */\n sdf?: boolean;\n /** Columns and rows that stretch when the icon is fitted to its text (image pixels): the others keep their size */\n stretchX?: [number, number][];\n stretchY?: [number, number][];\n /** Where the text goes when the icon is fitted to it: left, top, right, bottom (image pixels) */\n content?: [number, number, number, number];\n}\n\nexport type SpriteIndex = Record<string, SpriteIcon>;\n\nconst isPairs = (value: unknown): value is [number, number][] =>\n Array.isArray(value) && value.every((pair) => isNumbers(pair) && pair.length === 2);\n\n/** An icon of a sprite index: its place, and what is drawn from the rest */\nconst isSpriteIcon = (value: unknown): value is SpriteIcon =>\n isRecord(value) &&\n [value.x, value.y, value.width, value.height].every((v) => typeof v === 'number') &&\n (value.pixelRatio === undefined || typeof value.pixelRatio === 'number') &&\n (value.sdf === undefined || typeof value.sdf === 'boolean') &&\n (value.stretchX === undefined || isPairs(value.stretchX)) &&\n (value.stretchY === undefined || isPairs(value.stretchY)) &&\n (value.content === undefined || (isNumbers(value.content) && value.content.length === 4));\n\n/** RGBA pixels, straight alpha, row after row */\nexport interface Pixels {\n width: number;\n height: number;\n data: Uint8Array | Uint8ClampedArray;\n}\n\n/** How an image of the application is drawn (`map.addImage`): `SpriteIcon` without its place */\nexport type ImageOptions = Omit<SpriteIcon, 'x' | 'y' | 'width' | 'height'>;\n\n/** An icon in the atlas: its place (texels) and how it is drawn */\nexport interface Icon {\n x: number;\n y: number;\n width: number;\n height: number;\n pixelRatio: number;\n sdf: boolean;\n stretchX: [number, number][] | undefined;\n stretchY: [number, number][] | undefined;\n content: [number, number, number, number] | undefined;\n}\n\n/** A sprite of a style: its id (`default`: its images keep their names, else `id:name`) and its URL without\n * extension */\nexport interface SpriteSource {\n id: string;\n url: string;\n}\n\n/** The sprites of a style's `sprite`: one URL, or several with their ids (MapLibre's style specification) */\nexport const spriteSources = (sprite: string | readonly SpriteSource[] | undefined): SpriteSource[] => {\n if (typeof sprite === 'string') return sprite ? [{ id: 'default', url: sprite }] : [];\n\n return Array.isArray(sprite) ? sprite.filter((s) => typeof s?.url === 'string' && typeof s.id === 'string') : [];\n};\n\n/** The name of an image of a sprite in the style: its own in the `default` sprite, `id:name` in another */\nexport const spriteName = (id: string, name: string): string => {\n return id === 'default' ? name : `${id}:${name}`;\n};\n\n/** The URL of a sprite's index or sheet: `.json` or `.png`, `@2x` before it for high-density screens, before the\n * query of the URL if it has one */\nexport const spriteFile = (url: string, extension: 'json' | 'png', ratio: number): string => {\n const suffix = `${ratio > 1 ? '@2x' : ''}.${extension}`;\n const query = url.search(/[?#]/);\n\n return query < 0 ? `${url}${suffix}` : `${url.slice(0, query)}${suffix}${url.slice(query)}`;\n};\n\n/** A sprite loaded: its images by name (with the sprite's prefix) and its sheet */\nexport interface LoadedSprite {\n icons: SpriteIndex;\n image: ImageBitmap;\n}\n\n/** Loads a style's sprites (`@2x` above a device pixel ratio of 1, the 1x ones if a server has none); the sprites\n * that fail are left out */\nexport const loadSprites = async (\n sprite: string | readonly SpriteSource[] | undefined,\n ratio = typeof devicePixelRatio === 'number' ? devicePixelRatio : 1,\n): Promise<LoadedSprite[]> => {\n const one = async ({ id, url }: SpriteSource, r: number): Promise<LoadedSprite | undefined> => {\n const [json, png] = await Promise.all([\n fetch(spriteFile(url, 'json', r), withHeaders(spriteFile(url, 'json', r))),\n fetch(spriteFile(url, 'png', r), withHeaders(spriteFile(url, 'png', r))),\n ]);\n\n if (!json.ok || !png.ok) return r > 1 ? one({ id, url }, 1) : undefined;\n\n const index: unknown = await json.json();\n\n if (!isRecord(index)) return r > 1 ? one({ id, url }, 1) : undefined;\n\n const icons: SpriteIndex = Object.fromEntries(\n Object.entries(index).flatMap(([name, icon]) => (isSpriteIcon(icon) ? [[spriteName(id, name), icon]] : [])),\n );\n\n return { icons, image: await createImageBitmap(await png.blob()) };\n };\n const loaded = await Promise.all(spriteSources(sprite).map((s) => one(s, ratio).catch(() => undefined)));\n\n return loaded.filter((s): s is LoadedSprite => s !== undefined);\n};\n\n/** The pixels of an image (read back through a canvas) */\nexport const readPixels = (image: CanvasImageSource & { width: number; height: number }): Pixels | undefined => {\n const { width, height } = image;\n\n if (!(width > 0 && height > 0)) return undefined;\n\n const g =\n typeof OffscreenCanvas === 'function'\n ? new OffscreenCanvas(width, height).getContext('2d')\n : Object.assign(document.createElement('canvas'), { width, height }).getContext('2d');\n\n if (!g) return undefined;\n g.drawImage(image, 0, 0);\n\n return g.getImageData(0, 0, width, height);\n};\n\n/** Where an icon's pixels are: a region of an image, read when first packed */\ninterface IconSource {\n pixels: () => Pixels | undefined;\n x: number;\n y: number;\n width: number;\n height: number;\n options: ImageOptions;\n}\n\n/** A shelf of the packer: its y, height, and the x of the next free place */\ninterface Shelf {\n y: number;\n height: number;\n x: number;\n}\n\n/** The icons of a map and their atlas: a square that doubles as it fills, up to the texture size limit */\nexport class Icons {\n private size = 256;\n private data = new Uint8Array(256 * 256 * 4);\n private shelves: Shelf[] = [];\n private readonly sources = new Map<string, IconSource>();\n /** Icons packed, null for those that cannot be (no pixels, the atlas full) */\n private readonly packed = new Map<string, Icon | null>();\n private engine: Engine | undefined;\n /** Rows changed since the last upload: first, end */\n private dirty: [number, number] | undefined;\n private full = false;\n private readonly maxSize: number;\n /** Bumped each time icons are added or removed: labels laid out without some of theirs are laid out again */\n version = 0;\n\n /** `maxSize`: the GPU's texture size limit if known (the atlas is at most 4096 × 4096) */\n constructor(maxSize = 4096) {\n this.maxSize = Math.max(256, Math.min(4096, maxSize));\n }\n\n /** Sends the whole atlas to an engine (a new one after a context loss) */\n attach(engine: Engine): void {\n this.engine = engine;\n this.dirty = undefined;\n this.upload();\n }\n\n /** Side of the atlas */\n get atlasSize(): number {\n return this.size;\n }\n\n /** An image of the application under `name` (another image of that name is replaced) */\n add(name: string, pixels: Pixels, options: ImageOptions = {}): void {\n this.define(name, { pixels: () => pixels, x: 0, y: 0, width: pixels.width, height: pixels.height, options });\n }\n\n /** The images of a sprite's index, `prefix` before their names, their pixels read from the sheet on first use */\n addSprite(prefix: string, index: SpriteIndex, sheet: () => Pixels | undefined): void {\n let pixels: Pixels | undefined;\n let read = false;\n const once = () => {\n if (!read) {\n read = true;\n pixels = sheet();\n }\n\n return pixels;\n };\n\n Object.entries(index).forEach(([name, icon]) => {\n if (!icon || typeof icon !== 'object') return;\n\n const { x, y, width, height, ...options } = icon;\n\n this.define(`${prefix}${name}`, { pixels: once, x, y, width, height, options }, false);\n });\n this.version += 1;\n }\n\n private define(name: string, source: IconSource, bump = true): void {\n this.sources.set(name, source);\n // Packed again on its next use (its old place stays taken)\n this.packed.delete(name);\n if (bump) this.version += 1;\n }\n\n has(name: string): boolean {\n return this.sources.has(name);\n }\n\n /** Forgets an image, or every image whose name starts with `prefix` (a sprite's) */\n remove(name: string, prefix = false): void {\n [...this.sources.keys()]\n .filter((key) => (prefix ? key.startsWith(name) : key === name))\n .forEach((key) => {\n this.sources.delete(key);\n this.packed.delete(key);\n });\n this.version += 1;\n }\n\n /** The icon of this name, packed into the atlas on first use; undefined if there is none (`flush` uploads it) */\n get(name: string): Icon | undefined {\n const hit = this.packed.get(name);\n\n if (hit !== undefined) return hit ?? undefined;\n\n const source = this.sources.get(name);\n\n if (!source) return undefined;\n\n const icon = this.pack(source);\n\n this.packed.set(name, icon ?? null);\n\n return icon;\n }\n\n /** Sends the rows changed since the last upload to the engine */\n flush(): void {\n const dirty = this.dirty;\n\n this.dirty = undefined;\n if (!dirty || !this.engine) return;\n\n const [y0, y1] = dirty;\n const row = this.size * 4;\n\n this.engine.updateIconAtlas(0, y0, this.size, y1 - y0, this.data.subarray(y0 * row, y1 * row));\n }\n\n private upload(): void {\n const engine = this.engine;\n\n if (!engine) return;\n engine.setIconAtlas(this.size, this.size);\n\n const used = this.shelves.reduce((m, s) => Math.max(m, s.y + s.height), 0);\n\n if (used > 0) engine.updateIconAtlas(0, 0, this.size, used, this.data.subarray(0, used * this.size * 4));\n }\n\n /** Copies an icon's pixels into the atlas, premultiplied, with a texel of room around it */\n private pack(source: IconSource): Icon | undefined {\n const pixels = source.pixels();\n const { x, y, width: w, height: h } = source;\n\n if (!pixels || !(w > 0 && h > 0) || x < 0 || y < 0 || x + w > pixels.width || y + h > pixels.height) {\n return undefined;\n }\n\n const place = this.place(w + 2, h + 2);\n\n if (!place) return undefined;\n\n const [px, py] = [place[0] + 1, place[1] + 1];\n\n for (let row = 0; row < h; row += 1) {\n for (let col = 0; col < w; col += 1) {\n const from = ((y + row) * pixels.width + x + col) * 4;\n const to = ((py + row) * this.size + px + col) * 4;\n const a = pixels.data[from + 3] ?? 0;\n\n this.data[to] = ((pixels.data[from] ?? 0) * a + 127) / 255;\n this.data[to + 1] = ((pixels.data[from + 1] ?? 0) * a + 127) / 255;\n this.data[to + 2] = ((pixels.data[from + 2] ?? 0) * a + 127) / 255;\n this.data[to + 3] = a;\n }\n }\n\n const [d0, d1] = this.dirty ?? [place[1], place[1]];\n\n this.dirty = [Math.min(d0, place[1]), Math.max(d1, place[1] + h + 2)];\n\n const { pixelRatio, sdf, stretchX, stretchY, content } = source.options;\n\n return {\n x: px,\n y: py,\n width: w,\n height: h,\n pixelRatio: pixelRatio && pixelRatio > 0 ? pixelRatio : 1,\n sdf: sdf === true,\n stretchX: Array.isArray(stretchX) ? stretchX : undefined,\n stretchY: Array.isArray(stretchY) ? stretchY : undefined,\n content: Array.isArray(content) && content.length === 4 ? content : undefined,\n };\n }\n\n /** A free place of `w` × `h` texels (shelves, the atlas doubled when full); undefined once it cannot grow */\n private place(w: number, h: number): [number, number] | undefined {\n for (;;) {\n const shelf = this.shelves.find((s) => s.height >= h && s.height <= h + 8 && s.x + w <= this.size);\n\n if (shelf) {\n shelf.x += w;\n\n return [shelf.x - w, shelf.y];\n }\n\n const last = this.shelves.at(-1);\n const y = last ? last.y + last.height : 0;\n\n if (y + h <= this.size && w <= this.size) {\n this.shelves.push({ y, height: h, x: w });\n\n return [0, y];\n }\n if (this.size * 2 > this.maxSize) {\n if (!this.full) console.warn(`isard: the icon atlas is full (${this.size} × ${this.size})`);\n this.full = true;\n\n return undefined;\n }\n this.grow();\n }\n }\n\n /** Doubles the atlas; the icons keep their places (texels) */\n private grow(): void {\n const size = this.size * 2;\n const data = new Uint8Array(size * size * 4);\n\n for (let row = 0; row < this.size; row += 1) {\n data.set(this.data.subarray(row * this.size * 4, (row + 1) * this.size * 4), row * size * 4);\n }\n this.size = size;\n this.data = data;\n this.dirty = undefined;\n this.upload();\n }\n}\n\n/** How an icon is laid out around its anchor */\nexport interface IconLayoutOptions {\n /** Scale of the image (`icon-size`) */\n size: number;\n anchor: Anchor;\n /** CSS pixels at size 1 */\n offset: [number, number];\n /** Degrees, clockwise */\n rotate: number;\n /** Stretched around the text: its width, its height, both (`icon-text-fit`) */\n fit: 'none' | 'width' | 'height' | 'both';\n /** Room around the text when fitted: top, right, bottom, left (CSS pixels) */\n padding: [number, number, number, number];\n /** The text's box around the anchor (CSS pixels), if it has one */\n text?: [number, number, number, number] | undefined;\n}\n\n/** An icon laid out: its quads (x, y, width, height in CSS pixels from the anchor, atlas u0, v0, u1, v1 in texels, -1\n * or -2 for a distance field, turn in radians) and its box from the anchor */\nexport interface IconLayout {\n quads: number[][];\n box: [number, number, number, number];\n}\n\n/** Pieces of an image along one axis: image start, end, laid out start, end */\ntype Pieces = [number, number, number, number][];\n\n/**\n * An axis of an icon fitted to `lo`…`hi` (CSS pixels): its content (the whole image by default) spans them, its\n * stretchable zones (the whole image by default) taking the room the fixed parts (at `scale` CSS pixels per image\n * pixel) leave\n */\nexport const stretch = (\n length: number,\n zones: readonly [number, number][] | undefined,\n content: [number, number] | undefined,\n lo: number,\n hi: number,\n scale: number,\n): Pieces => {\n const clamp = (v: number) => Math.max(0, Math.min(length, Number(v) || 0));\n const whole: [number, number][] = [[0, length]];\n const spans = (zones?.length ? zones : whole)\n .map(([a, b]): [number, number] => [clamp(Math.min(a, b)), clamp(Math.max(a, b))])\n .filter(([a, b]) => b > a);\n const cuts = [...new Set([0, length, ...spans.flat()])].sort((a, b) => a - b);\n const pieces = cuts.slice(1).map((b, i): [number, number, boolean] => {\n const a = cuts[i] ?? 0;\n\n return [a, b, spans.some(([s, e]) => s <= a && b <= e)];\n });\n const [c0, c1] = content ? [clamp(content[0]), clamp(content[1])] : [0, length];\n const overlap = (a: number, b: number) => Math.max(0, Math.min(b, c1) - Math.max(a, c0));\n const stretchable = pieces.reduce((n, [a, b, s]) => n + (s ? overlap(a, b) : 0), 0);\n const fixed = c1 - c0 - stretchable;\n // CSS pixels per stretchable image pixel: what the fixed parts of the content leave of the room\n const k = stretchable > 0 ? Math.max(0, (hi - lo - fixed * scale) / stretchable) : scale;\n // Laid out position of an image coordinate\n const at = (x: number) => pieces.reduce((n, [a, b, s]) => n + Math.max(0, Math.min(x, b) - a) * (s ? k : scale), 0);\n const origin = lo - at(c0);\n\n return pieces.map(([a, b]) => [a, b, origin + at(a), origin + at(b)]);\n};\n\n/** Where an anchor's side lies along an axis of the icon: at its start 0, at its end 1, else the middle */\nconst align = (start: boolean, end: boolean): number => {\n if (start) return 0;\n\n return end ? 1 : 0.5;\n};\n\n/** Lays an icon out around its anchor: placed by its anchor and offset, or fitted to its text */\nexport const layoutIcon = (icon: Icon, options: IconLayoutOptions): IconLayout => {\n const { size, anchor, offset, rotate, fit, padding, text } = options;\n const { width: w, height: h, pixelRatio } = icon;\n const [xs, ys] = ((): [Pieces, Pieces] => {\n if (fit !== 'none' && text) {\n const [top, right, bottom, left] = padding;\n const [x0, y0, x1, y1] = [text[0] - left, text[1] - top, text[2] + right, text[3] + bottom];\n // The fixed parts at the image's own size; an axis not fitted at the icon's size, centered on the text\n const own = 1 / pixelRatio;\n const scaled = size / pixelRatio;\n const centered = (length: number, lo: number, hi: number): Pieces => {\n const c = (lo + hi) / 2;\n\n return [[0, length, c - (length * scaled) / 2, c + (length * scaled) / 2]];\n };\n const content = icon.content;\n\n return [\n fit === 'height'\n ? centered(w, x0, x1)\n : stretch(w, icon.stretchX, content && [content[0], content[2]], x0, x1, own),\n fit === 'width'\n ? centered(h, y0, y1)\n : stretch(h, icon.stretchY, content && [content[1], content[3]], y0, y1, own),\n ];\n }\n\n const [dw, dh] = [(w / pixelRatio) * size, (h / pixelRatio) * size];\n const ax = align(anchor.includes('left'), anchor.includes('right'));\n const ay = align(anchor.startsWith('top'), anchor.startsWith('bottom'));\n const [left, top] = [offset[0] * size - dw * ax, offset[1] * size - dh * ay];\n\n return [[[0, w, left, left + dw]], [[0, h, top, top + dh]]];\n })();\n const angle = ((Number(rotate) || 0) * Math.PI) / 180;\n const kind = icon.sdf ? -2 : -1;\n const quads: number[][] = [];\n const [cs, sn] = [Math.cos(angle), Math.sin(angle)];\n const box: [number, number, number, number] = [\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n ];\n\n ys.forEach(([v0, v1, top, bottom]) => {\n xs.forEach(([u0, u1, left, right]) => {\n if (right <= left || bottom <= top) return;\n quads.push([\n left,\n top,\n right - left,\n bottom - top,\n icon.x + u0,\n icon.y + v0,\n icon.x + u1,\n icon.y + v1,\n kind,\n angle,\n ]);\n\n // The box of the turned corners\n const corners: [number, number][] = [\n [left, top],\n [right, top],\n [left, bottom],\n [right, bottom],\n ];\n\n corners.forEach(([px, py]) => {\n const [rx, ry] = [px * cs - py * sn, px * sn + py * cs];\n\n box[0] = Math.min(box[0], rx);\n box[1] = Math.min(box[1], ry);\n box[2] = Math.max(box[2], rx);\n box[3] = Math.max(box[3], ry);\n });\n });\n });\n\n return { quads, box: quads.length ? box : [0, 0, 0, 0] };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/layers/icons.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAsBlD,MAAM,OAAO,GAAG,CAAC,KAAc,EAA+B,EAAE,CAC9D,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;AAEtF,4EAA4E;AAC5E,MAAM,YAAY,GAAG,CAAC,KAAc,EAAuB,EAAE,CAC3D,QAAQ,CAAC,KAAK,CAAC;IACf,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;IACjF,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAC;IACxE,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,GAAG,K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prite format: a JSON index and a PNG sheet,\n * `@2x` on high-density screens, one sprite or several with their ids) and the application's own (`map.addImage`),\n * packed on first use into an RGBA atlas the engine samples (premultiplied: no dark fringe where it is scaled); and the\n * layout of an icon around its anchor: by its anchor and offset, or stretched around its text (`icon-text-fit`), by\n * the stretchable zones and the content box of its image when it has them (`stretchX`, `stretchY`, `content`).\n */\n\nimport type { Anchor } from '../ui/overlay.ts';\nimport { RAD } from '../util/geo.ts';\nimport { isNumbers, isRecord } from '../util/guards.ts';\nimport { clamp } from '../util/math.ts';\nimport { withHeaders } from '../util/requests.ts';\nimport type { Engine } from '../wasm/isard.js';\n\n/** An image of a sprite's index: its place in the sheet (pixels) and how it is drawn */\nexport interface SpriteIcon {\n x: number;\n y: number;\n width: number;\n height: number;\n /** Image pixels per CSS pixel (default 1; 2 in an `@2x` sheet) */\n pixelRatio?: number;\n /** A signed distance field in alpha, drawn in the icon color */\n sdf?: boolean;\n /** Columns and rows that stretch when the icon is fitted to its text (image pixels): the others keep their size */\n stretchX?: [number, number][];\n stretchY?: [number, number][];\n /** Where the text goes when the icon is fitted to it: left, top, right, bottom (image pixels) */\n content?: [number, number, number, number];\n}\n\nexport type SpriteIndex = Record<string, SpriteIcon>;\n\nconst isPairs = (value: unknown): value is [number, number][] =>\n Array.isArray(value) && value.every((pair) => isNumbers(pair) && pair.length === 2);\n\n/** An icon of a sprite index: its place, and what is drawn from the rest */\nconst isSpriteIcon = (value: unknown): value is SpriteIcon =>\n isRecord(value) &&\n [value.x, value.y, value.width, value.height].every((v) => typeof v === 'number') &&\n (value.pixelRatio === undefined || typeof value.pixelRatio === 'number') &&\n (value.sdf === undefined || typeof value.sdf === 'boolean') &&\n (value.stretchX === undefined || isPairs(value.stretchX)) &&\n (value.stretchY === undefined || isPairs(value.stretchY)) &&\n (value.content === undefined || (isNumbers(value.content) && value.content.length === 4));\n\n/** RGBA pixels, straight alpha, row after row */\nexport interface Pixels {\n width: number;\n height: number;\n data: Uint8Array | Uint8ClampedArray;\n}\n\n/** How an image of the application is drawn (`map.addImage`): `SpriteIcon` without its place */\nexport type ImageOptions = Omit<SpriteIcon, 'x' | 'y' | 'width' | 'height'>;\n\n/** An icon in the atlas: its place (texels) and how it is drawn */\nexport interface Icon {\n x: number;\n y: number;\n width: number;\n height: number;\n pixelRatio: number;\n sdf: boolean;\n stretchX: [number, number][] | undefined;\n stretchY: [number, number][] | undefined;\n content: [number, number, number, number] | undefined;\n}\n\n/** A sprite of a style: its id (`default`: its images keep their names, else `id:name`) and its URL without\n * extension */\nexport interface SpriteSource {\n id: string;\n url: string;\n}\n\n/** The sprites of a style's `sprite`: one URL, or several with their ids (MapLibre's style specification) */\nexport const spriteSources = (sprite: string | readonly SpriteSource[] | undefined): SpriteSource[] => {\n if (typeof sprite === 'string') return sprite ? [{ id: 'default', url: sprite }] : [];\n\n return Array.isArray(sprite) ? sprite.filter((s) => typeof s?.url === 'string' && typeof s.id === 'string') : [];\n};\n\n/** The name of an image of a sprite in the style: its own in the `default` sprite, `id:name` in another */\nexport const spriteName = (id: string, name: string): string => {\n return id === 'default' ? name : `${id}:${name}`;\n};\n\n/** The URL of a sprite's index or sheet: `.json` or `.png`, `@2x` before it for high-density screens, before the\n * query of the URL if it has one */\nexport const spriteFile = (url: string, extension: 'json' | 'png', ratio: number): string => {\n const suffix = `${ratio > 1 ? '@2x' : ''}.${extension}`;\n const query = url.search(/[?#]/);\n\n return query < 0 ? `${url}${suffix}` : `${url.slice(0, query)}${suffix}${url.slice(query)}`;\n};\n\n/** A sprite loaded: its images by name (with the sprite's prefix) and its sheet */\nexport interface LoadedSprite {\n icons: SpriteIndex;\n image: ImageBitmap;\n}\n\n/** Loads a style's sprites (`@2x` above a device pixel ratio of 1, the 1x ones if a server has none); the sprites\n * that fail are left out */\nexport const loadSprites = async (\n sprite: string | readonly SpriteSource[] | undefined,\n ratio = typeof devicePixelRatio === 'number' ? devicePixelRatio : 1,\n): Promise<LoadedSprite[]> => {\n const one = async ({ id, url }: SpriteSource, r: number): Promise<LoadedSprite | undefined> => {\n const [json, png] = await Promise.all([\n fetch(spriteFile(url, 'json', r), withHeaders(spriteFile(url, 'json', r))),\n fetch(spriteFile(url, 'png', r), withHeaders(spriteFile(url, 'png', r))),\n ]);\n\n if (!json.ok || !png.ok) return r > 1 ? one({ id, url }, 1) : undefined;\n\n const index: unknown = await json.json();\n\n if (!isRecord(index)) return r > 1 ? one({ id, url }, 1) : undefined;\n\n const icons: SpriteIndex = Object.fromEntries(\n Object.entries(index).flatMap(([name, icon]) => (isSpriteIcon(icon) ? [[spriteName(id, name), icon]] : [])),\n );\n\n return { icons, image: await createImageBitmap(await png.blob()) };\n };\n const loaded = await Promise.all(spriteSources(sprite).map((s) => one(s, ratio).catch(() => undefined)));\n\n return loaded.filter((s): s is LoadedSprite => s !== undefined);\n};\n\n/** The pixels of an image (read back through a canvas) */\nexport const readPixels = (image: CanvasImageSource & { width: number; height: number }): Pixels | undefined => {\n const { width, height } = image;\n\n if (!(width > 0 && height > 0)) return undefined;\n\n const g =\n typeof OffscreenCanvas === 'function'\n ? new OffscreenCanvas(width, height).getContext('2d')\n : Object.assign(document.createElement('canvas'), { width, height }).getContext('2d');\n\n if (!g) return undefined;\n g.drawImage(image, 0, 0);\n\n return g.getImageData(0, 0, width, height);\n};\n\n/** Where an icon's pixels are: a region of an image, read when first packed */\ninterface IconSource {\n pixels: () => Pixels | undefined;\n x: number;\n y: number;\n width: number;\n height: number;\n options: ImageOptions;\n}\n\n/** A shelf of the packer: its y, height, and the x of the next free place */\ninterface Shelf {\n y: number;\n height: number;\n x: number;\n}\n\n/** The icons of a map and their atlas: a square that doubles as it fills, up to the texture size limit */\nexport class Icons {\n private size = 256;\n private data = new Uint8Array(256 * 256 * 4);\n private shelves: Shelf[] = [];\n private readonly sources = new Map<string, IconSource>();\n /** Icons packed, null for those that cannot be (no pixels, the atlas full) */\n private readonly packed = new Map<string, Icon | null>();\n private engine: Engine | undefined;\n /** Rows changed since the last upload: first, end */\n private dirty: [number, number] | undefined;\n private full = false;\n private readonly maxSize: number;\n /** Bumped each time icons are added or removed: labels laid out without some of theirs are laid out again */\n version = 0;\n\n /** `maxSize`: the GPU's texture size limit if known (the atlas is at most 4096 × 4096) */\n constructor(maxSize = 4096) {\n this.maxSize = clamp(maxSize, 256, 4096);\n }\n\n /** Sends the whole atlas to an engine (a new one after a context loss) */\n attach(engine: Engine): void {\n this.engine = engine;\n this.dirty = undefined;\n this.upload();\n }\n\n /** Side of the atlas */\n get atlasSize(): number {\n return this.size;\n }\n\n /** An image of the application under `name` (another image of that name is replaced) */\n add(name: string, pixels: Pixels, options: ImageOptions = {}): void {\n this.define(name, { pixels: () => pixels, x: 0, y: 0, width: pixels.width, height: pixels.height, options });\n }\n\n /** The images of a sprite's index, `prefix` before their names, their pixels read from the sheet on first use */\n addSprite(prefix: string, index: SpriteIndex, sheet: () => Pixels | undefined): void {\n let pixels: Pixels | undefined;\n let read = false;\n const once = () => {\n if (!read) {\n read = true;\n pixels = sheet();\n }\n\n return pixels;\n };\n\n Object.entries(index).forEach(([name, icon]) => {\n if (!icon || typeof icon !== 'object') return;\n\n const { x, y, width, height, ...options } = icon;\n\n this.define(`${prefix}${name}`, { pixels: once, x, y, width, height, options }, false);\n });\n this.version += 1;\n }\n\n private define(name: string, source: IconSource, bump = true): void {\n this.sources.set(name, source);\n // Packed again on its next use (its old place stays taken)\n this.packed.delete(name);\n if (bump) this.version += 1;\n }\n\n has(name: string): boolean {\n return this.sources.has(name);\n }\n\n /** Forgets an image, or every image whose name starts with `prefix` (a sprite's) */\n remove(name: string, prefix = false): void {\n [...this.sources.keys()]\n .filter((key) => (prefix ? key.startsWith(name) : key === name))\n .forEach((key) => {\n this.sources.delete(key);\n this.packed.delete(key);\n });\n this.version += 1;\n }\n\n /** The icon of this name, packed into the atlas on first use; undefined if there is none (`flush` uploads it) */\n get(name: string): Icon | undefined {\n const hit = this.packed.get(name);\n\n if (hit !== undefined) return hit ?? undefined;\n\n const source = this.sources.get(name);\n\n if (!source) return undefined;\n\n const icon = this.pack(source);\n\n this.packed.set(name, icon ?? null);\n\n return icon;\n }\n\n /** Sends the rows changed since the last upload to the engine */\n flush(): void {\n const dirty = this.dirty;\n\n this.dirty = undefined;\n if (!dirty || !this.engine) return;\n\n const [y0, y1] = dirty;\n const row = this.size * 4;\n\n this.engine.updateIconAtlas(0, y0, this.size, y1 - y0, this.data.subarray(y0 * row, y1 * row));\n }\n\n private upload(): void {\n const engine = this.engine;\n\n if (!engine) return;\n engine.setIconAtlas(this.size, this.size);\n\n const used = this.shelves.reduce((m, s) => Math.max(m, s.y + s.height), 0);\n\n if (used > 0) engine.updateIconAtlas(0, 0, this.size, used, this.data.subarray(0, used * this.size * 4));\n }\n\n /** Copies an icon's pixels into the atlas, premultiplied, with a texel of room around it */\n private pack(source: IconSource): Icon | undefined {\n const pixels = source.pixels();\n const { x, y, width: w, height: h } = source;\n\n if (!pixels || !(w > 0 && h > 0) || x < 0 || y < 0 || x + w > pixels.width || y + h > pixels.height) {\n return undefined;\n }\n\n const place = this.place(w + 2, h + 2);\n\n if (!place) return undefined;\n\n const [px, py] = [place[0] + 1, place[1] + 1];\n\n for (let row = 0; row < h; row += 1) {\n for (let col = 0; col < w; col += 1) {\n const from = ((y + row) * pixels.width + x + col) * 4;\n const to = ((py + row) * this.size + px + col) * 4;\n const a = pixels.data[from + 3] ?? 0;\n\n this.data[to] = ((pixels.data[from] ?? 0) * a + 127) / 255;\n this.data[to + 1] = ((pixels.data[from + 1] ?? 0) * a + 127) / 255;\n this.data[to + 2] = ((pixels.data[from + 2] ?? 0) * a + 127) / 255;\n this.data[to + 3] = a;\n }\n }\n\n const [d0, d1] = this.dirty ?? [place[1], place[1]];\n\n this.dirty = [Math.min(d0, place[1]), Math.max(d1, place[1] + h + 2)];\n\n const { pixelRatio, sdf, stretchX, stretchY, content } = source.options;\n\n return {\n x: px,\n y: py,\n width: w,\n height: h,\n pixelRatio: pixelRatio && pixelRatio > 0 ? pixelRatio : 1,\n sdf: sdf === true,\n stretchX: Array.isArray(stretchX) ? stretchX : undefined,\n stretchY: Array.isArray(stretchY) ? stretchY : undefined,\n content: Array.isArray(content) && content.length === 4 ? content : undefined,\n };\n }\n\n /** A free place of `w` × `h` texels (shelves, the atlas doubled when full); undefined once it cannot grow */\n private place(w: number, h: number): [number, number] | undefined {\n for (;;) {\n const shelf = this.shelves.find((s) => s.height >= h && s.height <= h + 8 && s.x + w <= this.size);\n\n if (shelf) {\n shelf.x += w;\n\n return [shelf.x - w, shelf.y];\n }\n\n const last = this.shelves.at(-1);\n const y = last ? last.y + last.height : 0;\n\n if (y + h <= this.size && w <= this.size) {\n this.shelves.push({ y, height: h, x: w });\n\n return [0, y];\n }\n if (this.size * 2 > this.maxSize) {\n if (!this.full) console.warn(`isard: the icon atlas is full (${this.size} × ${this.size})`);\n this.full = true;\n\n return undefined;\n }\n this.grow();\n }\n }\n\n /** Doubles the atlas; the icons keep their places (texels) */\n private grow(): void {\n const size = this.size * 2;\n const data = new Uint8Array(size * size * 4);\n\n for (let row = 0; row < this.size; row += 1) {\n data.set(this.data.subarray(row * this.size * 4, (row + 1) * this.size * 4), row * size * 4);\n }\n this.size = size;\n this.data = data;\n this.dirty = undefined;\n this.upload();\n }\n}\n\n/** How an icon is laid out around its anchor */\nexport interface IconLayoutOptions {\n /** Scale of the image (`icon-size`) */\n size: number;\n anchor: Anchor;\n /** CSS pixels at size 1 */\n offset: [number, number];\n /** Degrees, clockwise */\n rotate: number;\n /** Stretched around the text: its width, its height, both (`icon-text-fit`) */\n fit: 'none' | 'width' | 'height' | 'both';\n /** Room around the text when fitted: top, right, bottom, left (CSS pixels) */\n padding: [number, number, number, number];\n /** The text's box around the anchor (CSS pixels), if it has one */\n text?: [number, number, number, number] | undefined;\n}\n\n/** An icon laid out: its quads (x, y, width, height in CSS pixels from the anchor, atlas u0, v0, u1, v1 in texels, -1\n * or -2 for a distance field, turn in radians) and its box from the anchor */\nexport interface IconLayout {\n quads: number[][];\n box: [number, number, number, number];\n}\n\n/** Pieces of an image along one axis: image start, end, laid out start, end */\ntype Pieces = [number, number, number, number][];\n\n/**\n * An axis of an icon fitted to `lo`…`hi` (CSS pixels): its content (the whole image by default) spans them, its\n * stretchable zones (the whole image by default) taking the room the fixed parts (at `scale` CSS pixels per image\n * pixel) leave\n */\nexport const stretch = (\n length: number,\n zones: readonly [number, number][] | undefined,\n content: [number, number] | undefined,\n lo: number,\n hi: number,\n scale: number,\n): Pieces => {\n const within = (v: number) => clamp(Number(v) || 0, 0, length);\n const whole: [number, number][] = [[0, length]];\n const spans = (zones?.length ? zones : whole)\n .map(([a, b]): [number, number] => [within(Math.min(a, b)), within(Math.max(a, b))])\n .filter(([a, b]) => b > a);\n const cuts = [...new Set([0, length, ...spans.flat()])].sort((a, b) => a - b);\n const pieces = cuts.slice(1).map((b, i): [number, number, boolean] => {\n const a = cuts[i] ?? 0;\n\n return [a, b, spans.some(([s, e]) => s <= a && b <= e)];\n });\n const [c0, c1] = content ? [within(content[0]), within(content[1])] : [0, length];\n const overlap = (a: number, b: number) => Math.max(0, Math.min(b, c1) - Math.max(a, c0));\n const stretchable = pieces.reduce((n, [a, b, s]) => n + (s ? overlap(a, b) : 0), 0);\n const fixed = c1 - c0 - stretchable;\n // CSS pixels per stretchable image pixel: what the fixed parts of the content leave of the room\n const k = stretchable > 0 ? Math.max(0, (hi - lo - fixed * scale) / stretchable) : scale;\n // Laid out position of an image coordinate\n const at = (x: number) => pieces.reduce((n, [a, b, s]) => n + Math.max(0, Math.min(x, b) - a) * (s ? k : scale), 0);\n const origin = lo - at(c0);\n\n return pieces.map(([a, b]) => [a, b, origin + at(a), origin + at(b)]);\n};\n\n/** Where an anchor's side lies along an axis of the icon: at its start 0, at its end 1, else the middle */\nconst align = (start: boolean, end: boolean): number => {\n if (start) return 0;\n\n return end ? 1 : 0.5;\n};\n\n/** Lays an icon out around its anchor: placed by its anchor and offset, or fitted to its text */\nexport const layoutIcon = (icon: Icon, options: IconLayoutOptions): IconLayout => {\n const { size, anchor, offset, rotate, fit, padding, text } = options;\n const { width: w, height: h, pixelRatio } = icon;\n const [xs, ys] = ((): [Pieces, Pieces] => {\n if (fit !== 'none' && text) {\n const [top, right, bottom, left] = padding;\n const [x0, y0, x1, y1] = [text[0] - left, text[1] - top, text[2] + right, text[3] + bottom];\n // The fixed parts at the image's own size; an axis not fitted at the icon's size, centered on the text\n const own = 1 / pixelRatio;\n const scaled = size / pixelRatio;\n const centered = (length: number, lo: number, hi: number): Pieces => {\n const c = (lo + hi) / 2;\n\n return [[0, length, c - (length * scaled) / 2, c + (length * scaled) / 2]];\n };\n const content = icon.content;\n\n return [\n fit === 'height'\n ? centered(w, x0, x1)\n : stretch(w, icon.stretchX, content && [content[0], content[2]], x0, x1, own),\n fit === 'width'\n ? centered(h, y0, y1)\n : stretch(h, icon.stretchY, content && [content[1], content[3]], y0, y1, own),\n ];\n }\n\n const [dw, dh] = [(w / pixelRatio) * size, (h / pixelRatio) * size];\n const ax = align(anchor.includes('left'), anchor.includes('right'));\n const ay = align(anchor.startsWith('top'), anchor.startsWith('bottom'));\n const [left, top] = [offset[0] * size - dw * ax, offset[1] * size - dh * ay];\n\n return [[[0, w, left, left + dw]], [[0, h, top, top + dh]]];\n })();\n const angle = (Number(rotate) || 0) * RAD;\n const kind = icon.sdf ? -2 : -1;\n const quads: number[][] = [];\n const [cs, sn] = [Math.cos(angle), Math.sin(angle)];\n const box: [number, number, number, number] = [\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n ];\n\n ys.forEach(([v0, v1, top, bottom]) => {\n xs.forEach(([u0, u1, left, right]) => {\n if (right <= left || bottom <= top) return;\n quads.push([\n left,\n top,\n right - left,\n bottom - top,\n icon.x + u0,\n icon.y + v0,\n icon.x + u1,\n icon.y + v1,\n kind,\n angle,\n ]);\n\n // The box of the turned corners\n const corners: [number, number][] = [\n [left, top],\n [right, top],\n [left, bottom],\n [right, bottom],\n ];\n\n corners.forEach(([px, py]) => {\n const [rx, ry] = [px * cs - py * sn, px * sn + py * cs];\n\n box[0] = Math.min(box[0], rx);\n box[1] = Math.min(box[1], ry);\n box[2] = Math.max(box[2], rx);\n box[3] = Math.max(box[3], ry);\n });\n });\n });\n\n return { quads, box: quads.length ? box : [0, 0, 0, 0] };\n};\n"]}
|
package/dist/layers/layers.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* the map recreates its engine and every layer in order, with the same handle (its id is updated). Also the page's
|
|
4
|
-
* own 3D content: custom layers (its WebGL code called in every frame) and glTF models drawn at positions.
|
|
5
|
-
*/
|
|
6
|
-
import type { GeoMap } from '../map.ts';
|
|
7
|
-
import type { LonLat, NetworkStyle, RasterStyle, Tiles3dStyle } from '../types.ts';
|
|
8
|
-
import type { Camera, NetworkStats, Tiles3dStats } from '../wasm/isard.js';
|
|
1
|
+
/** The base of the handles of the layers added to a map: its id in the engine, created again after a context
|
|
2
|
+
* loss with the same handle; its companions, its place, its removal */
|
|
9
3
|
export declare abstract class Layer {
|
|
10
4
|
#private;
|
|
11
5
|
/** Id of the layer in the engine */
|
|
@@ -19,194 +13,3 @@ export declare abstract class Layer {
|
|
|
19
13
|
/** Moves the layer under `other`, or on top of every layer (above the labels of a vector basemap too) */
|
|
20
14
|
moveBefore(other: Layer | undefined): void;
|
|
21
15
|
}
|
|
22
|
-
/** Raster tiles (basemaps, overlays) */
|
|
23
|
-
export declare class RasterLayer extends Layer {
|
|
24
|
-
private readonly options;
|
|
25
|
-
/** Changes the opacity or saturation, the other kept */
|
|
26
|
-
setStyle(style: Partial<RasterStyle>): void;
|
|
27
|
-
}
|
|
28
|
-
/** Line network colored by a value per node (travel time, water depth…) */
|
|
29
|
-
export declare class NetworkLayer extends Layer {
|
|
30
|
-
private geometry;
|
|
31
|
-
private costs;
|
|
32
|
-
private style;
|
|
33
|
-
private edgeWidths;
|
|
34
|
-
private values;
|
|
35
|
-
/** Node and line positions in Mercator, kept for a context loss: f32 offsets from an origin (exact to the centimetre
|
|
36
|
-
* across a region, half the memory of f64) */
|
|
37
|
-
private kept;
|
|
38
|
-
/** One value per node, in node order; negative (or 1e30 and above) = unreached. Costs one texture upload, drawn
|
|
39
|
-
* next frame. */
|
|
40
|
-
setValues(values: Float32Array): void;
|
|
41
|
-
/** Costs of the edges, A → B then B → A (see `NetworkOptions.costs`), when the way the network is travelled
|
|
42
|
-
* changes; undefined: values interpolated along the edges. The geometry stays on the graphics card. */
|
|
43
|
-
setCosts(costs: Float32Array | undefined): void;
|
|
44
|
-
setStyle(style: Partial<NetworkStyle>): void;
|
|
45
|
-
/** Width factor of each edge (undefined: 1 for all) */
|
|
46
|
-
setEdgeWidths(widths: Float32Array | undefined): void;
|
|
47
|
-
/** Pieces in all and drawn in the last frame */
|
|
48
|
-
stats(): NetworkStats | undefined;
|
|
49
|
-
}
|
|
50
|
-
/** Textured meshes in 3D Tiles */
|
|
51
|
-
export declare class Tiles3dLayer extends Layer {
|
|
52
|
-
private readonly url;
|
|
53
|
-
private readonly geoid;
|
|
54
|
-
private style;
|
|
55
|
-
setStyle(style: Partial<Tiles3dStyle>): void;
|
|
56
|
-
/** Loading counters; undefined once the layer is removed, and while the engine with 3D Tiles loads (see
|
|
57
|
-
* `GeoMapOptions.tiles3d`) */
|
|
58
|
-
stats(): Tiles3dStats | undefined;
|
|
59
|
-
private applyStyle;
|
|
60
|
-
}
|
|
61
|
-
/** A texture of a ground layer (see `GroundLayer`) */
|
|
62
|
-
export interface GroundTexture {
|
|
63
|
-
/** `r8`, `r8ui`, `r16ui`, `r16i`, `r32ui`, `r32f`, `rg16ui`, `rg32f`, `rgba8`, `rgba8ui`, `rgba16ui`, `rgba32f`:
|
|
64
|
-
* integer formats are read with `usampler2D` / `isampler2D` and `texelFetch` */
|
|
65
|
-
format: string;
|
|
66
|
-
width: number;
|
|
67
|
-
height: number;
|
|
68
|
-
/** Layers of a 2D array (`sampler2DArray`, `usampler2DArray`…); 0 or undefined: a 2D texture */
|
|
69
|
-
depth?: number;
|
|
70
|
-
/** Linear filtering (non-integer formats); default nearest */
|
|
71
|
-
linear?: boolean;
|
|
72
|
-
/** Texels row after row (layer after layer), any typed array; undefined: left empty */
|
|
73
|
-
data?: ArrayBufferView;
|
|
74
|
-
}
|
|
75
|
-
export interface GroundOptions {
|
|
76
|
-
/**
|
|
77
|
-
* GLSL ES 3.0 defining `vec4 ground(vec2 offset)`: the color of the ground (premultiplied alpha, 0 for nothing) at
|
|
78
|
-
* `offset`, the Mercator offset of the pixel from `anchor` (times `ISARD_CIRCUMFERENCE`: metres of EPSG:3857), exact to
|
|
79
|
-
* the millimetre at any zoom. The code declares its own uniforms and samplers; also there: `u_zoom`,
|
|
80
|
-
* `u_pixel_ratio`
|
|
81
|
-
*/
|
|
82
|
-
code: string;
|
|
83
|
-
/** Where the offsets are taken from */
|
|
84
|
-
anchor: LonLat;
|
|
85
|
-
/** Box it shows in, `[west, south, east, north]` (default the world): only the ground there is drawn again */
|
|
86
|
-
bounds?: [west: number, south: number, east: number, north: number];
|
|
87
|
-
textures?: Record<string, GroundTexture>;
|
|
88
|
-
uniforms?: Record<string, number | readonly number[]>;
|
|
89
|
-
}
|
|
90
|
-
/** The application's fragment shader run over the ground, draped on the relief (water depth, heat maps…) */
|
|
91
|
-
export declare class GroundLayer extends Layer {
|
|
92
|
-
private readonly options;
|
|
93
|
-
private readonly textures;
|
|
94
|
-
private readonly uniforms;
|
|
95
|
-
private visible;
|
|
96
|
-
/** Creates or replaces a texture of the code's sampler `name` */
|
|
97
|
-
setTexture(name: string, texture: GroundTexture): void;
|
|
98
|
-
/**
|
|
99
|
-
* Replaces a region of a texture: `data` holds `width` × `height` texels for (`x`, `y`) of `layer` (2D arrays).
|
|
100
|
-
* Keep the texture's own `data` up to date too if it must survive a WebGL context loss.
|
|
101
|
-
*/
|
|
102
|
-
updateTexture(name: string, data: ArrayBufferView, region: {
|
|
103
|
-
x?: number;
|
|
104
|
-
y?: number;
|
|
105
|
-
layer?: number;
|
|
106
|
-
width: number;
|
|
107
|
-
height: number;
|
|
108
|
-
}): void;
|
|
109
|
-
/** A uniform of the code: a number, or numbers for vectors, arrays and matrices (column major) */
|
|
110
|
-
setUniform(name: string, value: number | readonly number[]): void;
|
|
111
|
-
setBounds(bounds: [west: number, south: number, east: number, north: number]): void;
|
|
112
|
-
setVisible(visible: boolean): void;
|
|
113
|
-
private sendTexture;
|
|
114
|
-
}
|
|
115
|
-
/** What a custom layer gets to draw a frame (`CustomLayerInterface.render`) */
|
|
116
|
-
export interface CustomFrame {
|
|
117
|
-
/**
|
|
118
|
-
* The model-view-projection matrix of a local frame at a position and altitude (metres above the ellipsoid, as the
|
|
119
|
-
* relief is drawn: times its exaggeration), column-major for `uniformMatrix4fv` or a three.js camera: x east, y
|
|
120
|
-
* north, z up, in metres. Made in double precision relative to the camera, so that what is drawn stays exact at
|
|
121
|
-
* any zoom; draw within a few kilometres of the position (or take one matrix per object far apart). Only during
|
|
122
|
-
* `render`.
|
|
123
|
-
*/
|
|
124
|
-
matrixAt(lonLat: LonLat, altitude?: number): Float32Array;
|
|
125
|
-
/** The camera of the frame */
|
|
126
|
-
readonly camera: Camera;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* A layer drawn by the page with its own WebGL code, as MapLibre's `CustomLayerInterface`: `render` is called at the
|
|
130
|
-
* layer's place in every frame drawn. It starts with the canvas bound, its viewport set, blending on (`SRC_ALPHA`,
|
|
131
|
-
* `ONE_MINUS_SRC_ALPHA`), no culling, and in `'3d'` mode the depth test on (`LEQUAL`, depth written): the relief, the
|
|
132
|
-
* buildings and the 3D Tiles hide what it draws and what it draws hides them. Whatever WebGL state it changes is set
|
|
133
|
-
* back afterwards; a library that caches the WebGL state (three.js) must forget it first (`renderer.resetState()`).
|
|
134
|
-
*
|
|
135
|
-
* The map is busy drawing meanwhile: `render` reads the frame, not the map (`getCamera` excepted); it may call
|
|
136
|
-
* `requestRender` for an animation.
|
|
137
|
-
*/
|
|
138
|
-
export interface CustomLayerInterface {
|
|
139
|
-
/** A name for the application (the map numbers its layers) */
|
|
140
|
-
id?: string;
|
|
141
|
-
/** `'2d'` (the default): drawn over what is under it; `'3d'`: with the depth buffer of the 3D layers */
|
|
142
|
-
renderingMode?: '2d' | '3d';
|
|
143
|
-
/** Creates the WebGL objects: once added, and again after the WebGL context was lost and restored */
|
|
144
|
-
onAdd?(gl: WebGL2RenderingContext, map: GeoMap): void;
|
|
145
|
-
render(gl: WebGL2RenderingContext, frame: CustomFrame): void;
|
|
146
|
-
/** Frees the WebGL objects: the layer is removed, or the map destroyed */
|
|
147
|
-
onRemove?(gl: WebGL2RenderingContext, map: GeoMap): void;
|
|
148
|
-
}
|
|
149
|
-
/** A layer drawn by the page's WebGL code (see `CustomLayerInterface`) */
|
|
150
|
-
export declare class CustomLayer extends Layer {
|
|
151
|
-
/** The application's object */
|
|
152
|
-
readonly implementation: CustomLayerInterface;
|
|
153
|
-
private readonly canvas;
|
|
154
|
-
private readonly owner;
|
|
155
|
-
/** The map's WebGL context, and whether `onAdd` made the layer's objects there (until `onRemove`) */
|
|
156
|
-
private readonly gl;
|
|
157
|
-
private added;
|
|
158
|
-
/** The context was lost since `onAdd`: its objects are gone */
|
|
159
|
-
private stale;
|
|
160
|
-
private readonly lost;
|
|
161
|
-
private readonly frame;
|
|
162
|
-
/** Called by the engine at the layer's place in the frame; the page's errors are reported, the frame goes on */
|
|
163
|
-
private readonly draw;
|
|
164
|
-
remove(): void;
|
|
165
|
-
}
|
|
166
|
-
/** Where and how a model stands */
|
|
167
|
-
export interface ModelInstance {
|
|
168
|
-
lonLat: LonLat;
|
|
169
|
-
/** Metres above the ground (or above the ellipsoid, `altitudeReference: 'sea'`); 0 by default */
|
|
170
|
-
altitude?: number;
|
|
171
|
-
/** Degrees clockwise from the north of the model's front (glTF +Z); 0 by default */
|
|
172
|
-
heading?: number;
|
|
173
|
-
/** Degrees, nose up */
|
|
174
|
-
pitch?: number;
|
|
175
|
-
/** Degrees, right side down */
|
|
176
|
-
roll?: number;
|
|
177
|
-
/** 1 by default: the model's metres */
|
|
178
|
-
scale?: number;
|
|
179
|
-
}
|
|
180
|
-
export interface ModelOptions {
|
|
181
|
-
/** URL of a glTF binary (`.glb`): meshes, textures, Draco, meshopt, KTX2, as in 3D Tiles; or its bytes (`data`) */
|
|
182
|
-
url?: string;
|
|
183
|
-
data?: ArrayBuffer | ArrayBufferView<ArrayBuffer>;
|
|
184
|
-
instances: readonly ModelInstance[];
|
|
185
|
-
/** What the altitudes are above: `'ground'` (the relief, the default) or `'sea'` (the ellipsoid) */
|
|
186
|
-
altitudeReference?: 'ground' | 'sea';
|
|
187
|
-
}
|
|
188
|
-
/** The numbers of instances for the engine: longitude, latitude, altitude, heading, pitch, roll, scale */
|
|
189
|
-
export declare const instanceNumbers: (instances: readonly ModelInstance[]) => Float64Array;
|
|
190
|
-
/** A glTF model drawn at positions, in one instanced draw; `pickFeature` gives the instance's index */
|
|
191
|
-
export declare class ModelLayer extends Layer {
|
|
192
|
-
private readonly url;
|
|
193
|
-
/** The `blob:` URL of the page's bytes, revoked once the layer is gone */
|
|
194
|
-
private readonly blob;
|
|
195
|
-
private instances;
|
|
196
|
-
/** Its glow at night (`setGlow`) */
|
|
197
|
-
private glow;
|
|
198
|
-
/** Its feature highlighted (`setHighlight`) */
|
|
199
|
-
private highlight;
|
|
200
|
-
private ground;
|
|
201
|
-
/** Replaces the instances (and what their altitudes are above, kept if not given) */
|
|
202
|
-
setInstances(instances: readonly ModelInstance[], altitudeReference?: 'ground' | 'sea'): void;
|
|
203
|
-
/** Lights at night the part of the model from `from` metres above its foot (a street lamp's head) in a CSS color;
|
|
204
|
-
* none without a color */
|
|
205
|
-
setGlow(from: number, color?: string): void;
|
|
206
|
-
/** Highlights a feature of the model (an IFC model's element, `hit.index` of a pick) in a CSS color (amber by
|
|
207
|
-
* default); none without a feature */
|
|
208
|
-
setHighlight(feature?: number, color?: string): void;
|
|
209
|
-
private sendHighlight;
|
|
210
|
-
private sendGlow;
|
|
211
|
-
remove(): void;
|
|
212
|
-
}
|