@sakuzu/maplibre-gl-draw 1.0.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 +43 -0
- package/LICENSE +661 -0
- package/README.ja.md +248 -0
- package/README.md +255 -0
- package/THIRD_PARTY_NOTICES.md +275 -0
- package/dist/api/api.d.ts +1259 -0
- package/dist/api/api.js +86 -0
- package/dist/api/context.d.ts +173 -0
- package/dist/api/context.js +193 -0
- package/dist/api/display-api.d.ts +1 -0
- package/dist/api/display-api.js +23 -0
- package/dist/api/event-api.d.ts +13 -0
- package/dist/api/event-api.js +17 -0
- package/dist/api/extension-api.d.ts +46 -0
- package/dist/api/extension-api.js +85 -0
- package/dist/api/feature-api.d.ts +11 -0
- package/dist/api/feature-api.js +101 -0
- package/dist/api/geometry/apply.d.ts +51 -0
- package/dist/api/geometry/apply.js +114 -0
- package/dist/api/geometry/boolean.d.ts +28 -0
- package/dist/api/geometry/boolean.js +65 -0
- package/dist/api/geometry/buffer.d.ts +11 -0
- package/dist/api/geometry/buffer.js +105 -0
- package/dist/api/geometry/split.d.ts +16 -0
- package/dist/api/geometry/split.js +75 -0
- package/dist/api/geometry/targets.d.ts +76 -0
- package/dist/api/geometry/targets.js +158 -0
- package/dist/api/geometry/types.d.ts +31 -0
- package/dist/api/geometry/types.js +3 -0
- package/dist/api/geometry-operations.d.ts +162 -0
- package/dist/api/geometry-operations.js +94 -0
- package/dist/api/group-api.d.ts +10 -0
- package/dist/api/group-api.js +78 -0
- package/dist/api/import-export/constants.d.ts +29 -0
- package/dist/api/import-export/constants.js +40 -0
- package/dist/api/import-export/embedded-file.d.ts +13 -0
- package/dist/api/import-export/embedded-file.js +31 -0
- package/dist/api/import-export/file-name.d.ts +10 -0
- package/dist/api/import-export/file-name.js +20 -0
- package/dist/api/import-export/format-detection.d.ts +12 -0
- package/dist/api/import-export/format-detection.js +29 -0
- package/dist/api/import-export/geojson-export.d.ts +19 -0
- package/dist/api/import-export/geojson-export.js +262 -0
- package/dist/api/import-export/geojson-import.d.ts +34 -0
- package/dist/api/import-export/geojson-import.js +538 -0
- package/dist/api/import-export/geometry-validation.d.ts +20 -0
- package/dist/api/import-export/geometry-validation.js +107 -0
- package/dist/api/import-export/image-import.d.ts +12 -0
- package/dist/api/import-export/image-import.js +53 -0
- package/dist/api/import-export/index.d.ts +9 -0
- package/dist/api/import-export/index.js +107 -0
- package/dist/api/import-export/native-format.d.ts +15 -0
- package/dist/api/import-export/native-format.js +126 -0
- package/dist/api/import-export/native-validation.d.ts +28 -0
- package/dist/api/import-export/native-validation.js +212 -0
- package/dist/api/import-export/own-property.d.ts +10 -0
- package/dist/api/import-export/own-property.js +19 -0
- package/dist/api/import-export/style-validation.d.ts +27 -0
- package/dist/api/import-export/style-validation.js +49 -0
- package/dist/api/import-export/types.d.ts +26 -0
- package/dist/api/import-export/types.js +3 -0
- package/dist/api/index.d.ts +15 -0
- package/dist/api/index.js +3 -0
- package/dist/api/input-api.d.ts +158 -0
- package/dist/api/input-api.js +144 -0
- package/dist/api/instance-api.d.ts +38 -0
- package/dist/api/instance-api.js +136 -0
- package/dist/api/layer-api.d.ts +12 -0
- package/dist/api/layer-api.js +62 -0
- package/dist/api/selection-api.d.ts +7 -0
- package/dist/api/selection-api.js +78 -0
- package/dist/api/snapping-api.d.ts +125 -0
- package/dist/api/snapping-api.js +50 -0
- package/dist/api/topology-api.d.ts +30 -0
- package/dist/api/topology-api.js +16 -0
- package/dist/api/tracing-api.d.ts +31 -0
- package/dist/api/tracing-api.js +16 -0
- package/dist/dispatcher/hit-test/box-strategies.d.ts +19 -0
- package/dist/dispatcher/hit-test/box-strategies.js +275 -0
- package/dist/dispatcher/hit-test/box-strategy.d.ts +59 -0
- package/dist/dispatcher/hit-test/box-strategy.js +37 -0
- package/dist/dispatcher/hit-test/globe-shape.d.ts +46 -0
- package/dist/dispatcher/hit-test/globe-shape.js +70 -0
- package/dist/dispatcher/hit-test/index.d.ts +14 -0
- package/dist/dispatcher/hit-test/index.js +9 -0
- package/dist/dispatcher/hit-test/local-frame.d.ts +77 -0
- package/dist/dispatcher/hit-test/local-frame.js +112 -0
- package/dist/dispatcher/hit-test/segment-grid.d.ts +32 -0
- package/dist/dispatcher/hit-test/segment-grid.js +79 -0
- package/dist/dispatcher/hit-test/service.d.ts +120 -0
- package/dist/dispatcher/hit-test/service.js +333 -0
- package/dist/dispatcher/hit-test/strategies/base.d.ts +136 -0
- package/dist/dispatcher/hit-test/strategies/base.js +66 -0
- package/dist/dispatcher/hit-test/strategies/circle.d.ts +10 -0
- package/dist/dispatcher/hit-test/strategies/circle.js +56 -0
- package/dist/dispatcher/hit-test/strategies/image.d.ts +22 -0
- package/dist/dispatcher/hit-test/strategies/image.js +115 -0
- package/dist/dispatcher/hit-test/strategies/index.d.ts +11 -0
- package/dist/dispatcher/hit-test/strategies/index.js +10 -0
- package/dist/dispatcher/hit-test/strategies/line.d.ts +17 -0
- package/dist/dispatcher/hit-test/strategies/line.js +30 -0
- package/dist/dispatcher/hit-test/strategies/multi.d.ts +44 -0
- package/dist/dispatcher/hit-test/strategies/multi.js +141 -0
- package/dist/dispatcher/hit-test/strategies/point.d.ts +20 -0
- package/dist/dispatcher/hit-test/strategies/point.js +29 -0
- package/dist/dispatcher/hit-test/strategies/polygon.d.ts +52 -0
- package/dist/dispatcher/hit-test/strategies/polygon.js +138 -0
- package/dist/dispatcher/hit-test/topmost.d.ts +48 -0
- package/dist/dispatcher/hit-test/topmost.js +157 -0
- package/dist/dispatcher/hit-test/visibility-lookup.d.ts +23 -0
- package/dist/dispatcher/hit-test/visibility-lookup.js +40 -0
- package/dist/dispatcher/index.d.ts +15 -0
- package/dist/dispatcher/index.js +3 -0
- package/dist/dispatcher/input-router.d.ts +1 -0
- package/dist/dispatcher/input-router.js +288 -0
- package/dist/dispatcher/normalizer.d.ts +1 -0
- package/dist/dispatcher/normalizer.js +513 -0
- package/dist/dispatcher/types.d.ts +144 -0
- package/dist/dispatcher/types.js +15 -0
- package/dist/display/chunk-set.d.ts +24 -0
- package/dist/display/chunk-set.js +533 -0
- package/dist/display/chunk.d.ts +1 -0
- package/dist/display/chunk.js +104 -0
- package/dist/display/columnar/index.d.ts +12 -0
- package/dist/display/columnar/index.js +13 -0
- package/dist/display/columnar/prepare.d.ts +42 -0
- package/dist/display/columnar/prepare.js +116 -0
- package/dist/display/columnar/source.d.ts +1 -0
- package/dist/display/columnar/source.js +531 -0
- package/dist/display/columnar/table.d.ts +1 -0
- package/dist/display/columnar/table.js +471 -0
- package/dist/display/columnar/types.d.ts +223 -0
- package/dist/display/columnar/types.js +3 -0
- package/dist/display/dataset.d.ts +2 -0
- package/dist/display/dataset.js +891 -0
- package/dist/display/index.d.ts +13 -0
- package/dist/display/index.js +3 -0
- package/dist/display/interaction.d.ts +1 -0
- package/dist/display/interaction.js +90 -0
- package/dist/display/manager.d.ts +1 -0
- package/dist/display/manager.js +440 -0
- package/dist/display/packed-rtree.d.ts +1 -0
- package/dist/display/packed-rtree.js +244 -0
- package/dist/display/partition.d.ts +1 -0
- package/dist/display/partition.js +226 -0
- package/dist/display/provider.d.ts +1 -0
- package/dist/display/provider.js +342 -0
- package/dist/display/retained.d.ts +40 -0
- package/dist/display/retained.js +898 -0
- package/dist/display/selection.d.ts +13 -0
- package/dist/display/selection.js +226 -0
- package/dist/display/source.d.ts +1 -0
- package/dist/display/source.js +119 -0
- package/dist/display/spatial.d.ts +1 -0
- package/dist/display/spatial.js +71 -0
- package/dist/display/style.d.ts +1 -0
- package/dist/display/style.js +126 -0
- package/dist/display/thinning.d.ts +65 -0
- package/dist/display/thinning.js +910 -0
- package/dist/display/triangulation.d.ts +1 -0
- package/dist/display/triangulation.js +0 -0
- package/dist/display/types.d.ts +561 -0
- package/dist/display/types.js +43 -0
- package/dist/extension/feature-handler.d.ts +182 -0
- package/dist/extension/feature-handler.js +3 -0
- package/dist/extension/index.d.ts +9 -0
- package/dist/extension/index.js +3 -0
- package/dist/extension/renderers.d.ts +208 -0
- package/dist/extension/renderers.js +3 -0
- package/dist/geometry/angle.d.ts +47 -0
- package/dist/geometry/angle.js +44 -0
- package/dist/geometry/bbox.d.ts +48 -0
- package/dist/geometry/bbox.js +83 -0
- package/dist/geometry/boolean.d.ts +162 -0
- package/dist/geometry/boolean.js +331 -0
- package/dist/geometry/buffer.d.ts +72 -0
- package/dist/geometry/buffer.js +218 -0
- package/dist/geometry/circle.d.ts +55 -0
- package/dist/geometry/circle.js +107 -0
- package/dist/geometry/coords.d.ts +97 -0
- package/dist/geometry/coords.js +149 -0
- package/dist/geometry/distance.d.ts +79 -0
- package/dist/geometry/distance.js +111 -0
- package/dist/geometry/errors.d.ts +74 -0
- package/dist/geometry/errors.js +104 -0
- package/dist/geometry/index.d.ts +28 -0
- package/dist/geometry/index.js +38 -0
- package/dist/geometry/measure.d.ts +81 -0
- package/dist/geometry/measure.js +236 -0
- package/dist/geometry/predicates.d.ts +62 -0
- package/dist/geometry/predicates.js +132 -0
- package/dist/geometry/simplify.d.ts +74 -0
- package/dist/geometry/simplify.js +159 -0
- package/dist/geometry/split.d.ts +68 -0
- package/dist/geometry/split.js +430 -0
- package/dist/geometry/types.d.ts +95 -0
- package/dist/geometry/types.js +3 -0
- package/dist/geometry/units.d.ts +35 -0
- package/dist/geometry/units.js +41 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.js +20 -0
- package/dist/maplibre-gl-draw.d.ts +47 -0
- package/dist/maplibre-gl-draw.js +407 -0
- package/dist/messages.d.ts +64 -0
- package/dist/messages.js +36 -0
- package/dist/modes/cursor.d.ts +1 -0
- package/dist/modes/cursor.js +72 -0
- package/dist/modes/draw/circle.d.ts +1 -0
- package/dist/modes/draw/circle.js +222 -0
- package/dist/modes/draw/commit-layer.d.ts +26 -0
- package/dist/modes/draw/commit-layer.js +31 -0
- package/dist/modes/draw/freehand.d.ts +1 -0
- package/dist/modes/draw/freehand.js +264 -0
- package/dist/modes/draw/image.d.ts +1 -0
- package/dist/modes/draw/image.js +60 -0
- package/dist/modes/draw/index.d.ts +9 -0
- package/dist/modes/draw/index.js +11 -0
- package/dist/modes/draw/line.d.ts +1 -0
- package/dist/modes/draw/line.js +363 -0
- package/dist/modes/draw/point.d.ts +1 -0
- package/dist/modes/draw/point.js +87 -0
- package/dist/modes/draw/polygon.d.ts +1 -0
- package/dist/modes/draw/polygon.js +378 -0
- package/dist/modes/draw/trace-support.d.ts +79 -0
- package/dist/modes/draw/trace-support.js +161 -0
- package/dist/modes/handler.d.ts +285 -0
- package/dist/modes/handler.js +3 -0
- package/dist/modes/index.d.ts +7 -0
- package/dist/modes/index.js +3 -0
- package/dist/modes/manager.d.ts +15 -0
- package/dist/modes/manager.js +196 -0
- package/dist/modes/select/box-selection.d.ts +52 -0
- package/dist/modes/select/box-selection.js +140 -0
- package/dist/modes/select/click-handler.d.ts +32 -0
- package/dist/modes/select/click-handler.js +166 -0
- package/dist/modes/select/cursor-handler.d.ts +15 -0
- package/dist/modes/select/cursor-handler.js +59 -0
- package/dist/modes/select/drag/auxiliary.d.ts +26 -0
- package/dist/modes/select/drag/auxiliary.js +56 -0
- package/dist/modes/select/drag/intermediate-writes.d.ts +1 -0
- package/dist/modes/select/drag/intermediate-writes.js +171 -0
- package/dist/modes/select/drag/move.d.ts +24 -0
- package/dist/modes/select/drag/move.js +59 -0
- package/dist/modes/select/drag/operation.d.ts +30 -0
- package/dist/modes/select/drag/operation.js +18 -0
- package/dist/modes/select/drag/radius.d.ts +15 -0
- package/dist/modes/select/drag/radius.js +49 -0
- package/dist/modes/select/drag/transform.d.ts +17 -0
- package/dist/modes/select/drag/transform.js +155 -0
- package/dist/modes/select/drag/vertex.d.ts +17 -0
- package/dist/modes/select/drag/vertex.js +163 -0
- package/dist/modes/select/drag-handler.d.ts +1 -0
- package/dist/modes/select/drag-handler.js +254 -0
- package/dist/modes/select/hit-helpers.d.ts +40 -0
- package/dist/modes/select/hit-helpers.js +51 -0
- package/dist/modes/select/mode.d.ts +1 -0
- package/dist/modes/select/mode.js +397 -0
- package/dist/modes/select/shortcut-handler.d.ts +40 -0
- package/dist/modes/select/shortcut-handler.js +128 -0
- package/dist/operations/index.d.ts +9 -0
- package/dist/operations/index.js +3 -0
- package/dist/operations/layer-operations.d.ts +1 -0
- package/dist/operations/layer-operations.js +350 -0
- package/dist/operations/resize.d.ts +71 -0
- package/dist/operations/resize.js +252 -0
- package/dist/operations/rotate.d.ts +17 -0
- package/dist/operations/rotate.js +166 -0
- package/dist/operations/selection-operations.d.ts +20 -0
- package/dist/operations/selection-operations.js +159 -0
- package/dist/operations/shared-vertex.d.ts +1 -0
- package/dist/operations/shared-vertex.js +210 -0
- package/dist/operations/trace-graph.d.ts +96 -0
- package/dist/operations/trace-graph.js +283 -0
- package/dist/operations/vertex.d.ts +1 -0
- package/dist/operations/vertex.js +538 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.js +3 -0
- package/dist/plugins/mutation-hooks.d.ts +28 -0
- package/dist/plugins/mutation-hooks.js +84 -0
- package/dist/plugins/plugin-context.d.ts +1 -0
- package/dist/plugins/plugin-context.js +367 -0
- package/dist/plugins/plugin-manager.d.ts +103 -0
- package/dist/plugins/plugin-manager.js +316 -0
- package/dist/plugins/plugin.d.ts +529 -0
- package/dist/plugins/plugin.js +3 -0
- package/dist/shared/config/constants.d.ts +66 -0
- package/dist/shared/config/constants.js +60 -0
- package/dist/shared/config/feature-style.d.ts +155 -0
- package/dist/shared/config/feature-style.js +154 -0
- package/dist/shared/config/index.d.ts +17 -0
- package/dist/shared/config/index.js +8 -0
- package/dist/shared/config/rendering.d.ts +107 -0
- package/dist/shared/config/rendering.js +33 -0
- package/dist/shared/config/selection-highlight.d.ts +29 -0
- package/dist/shared/config/selection-highlight.js +35 -0
- package/dist/shared/config/selection.d.ts +273 -0
- package/dist/shared/config/selection.js +266 -0
- package/dist/shared/config/topology.d.ts +33 -0
- package/dist/shared/config/topology.js +17 -0
- package/dist/shared/config/trace.d.ts +40 -0
- package/dist/shared/config/trace.js +17 -0
- package/dist/shared/math/angle.d.ts +21 -0
- package/dist/shared/math/angle.js +34 -0
- package/dist/shared/math/circle.d.ts +6 -0
- package/dist/shared/math/circle.js +10 -0
- package/dist/shared/math/constants.d.ts +48 -0
- package/dist/shared/math/constants.js +59 -0
- package/dist/shared/math/distance.d.ts +78 -0
- package/dist/shared/math/distance.js +147 -0
- package/dist/shared/math/globe-subdivision.d.ts +62 -0
- package/dist/shared/math/globe-subdivision.js +99 -0
- package/dist/shared/math/index.d.ts +17 -0
- package/dist/shared/math/index.js +21 -0
- package/dist/shared/math/intersection.d.ts +63 -0
- package/dist/shared/math/intersection.js +236 -0
- package/dist/shared/math/longitude.d.ts +20 -0
- package/dist/shared/math/longitude.js +31 -0
- package/dist/shared/math/mercator-plane.d.ts +27 -0
- package/dist/shared/math/mercator-plane.js +26 -0
- package/dist/shared/math/obb.d.ts +65 -0
- package/dist/shared/math/obb.js +107 -0
- package/dist/shared/math/rotation.d.ts +93 -0
- package/dist/shared/math/rotation.js +186 -0
- package/dist/shared/math/segment-grid.d.ts +69 -0
- package/dist/shared/math/segment-grid.js +159 -0
- package/dist/shared/math/transform.d.ts +140 -0
- package/dist/shared/math/transform.js +189 -0
- package/dist/shared/types/events.d.ts +128 -0
- package/dist/shared/types/events.js +3 -0
- package/dist/shared/types/model.d.ts +950 -0
- package/dist/shared/types/model.js +3 -0
- package/dist/shared/types/selection-box.d.ts +23 -0
- package/dist/shared/types/selection-box.js +3 -0
- package/dist/shared/types/style.d.ts +68 -0
- package/dist/shared/types/style.js +3 -0
- package/dist/shared/utils/color.d.ts +49 -0
- package/dist/shared/utils/color.js +180 -0
- package/dist/shared/utils/coordinates.d.ts +52 -0
- package/dist/shared/utils/coordinates.js +75 -0
- package/dist/shared/utils/embedded-image.d.ts +34 -0
- package/dist/shared/utils/embedded-image.js +161 -0
- package/dist/shared/utils/event-emitter.d.ts +262 -0
- package/dist/shared/utils/event-emitter.js +44 -0
- package/dist/shared/utils/feature-bbox.d.ts +8 -0
- package/dist/shared/utils/feature-bbox.js +207 -0
- package/dist/shared/utils/feature-segments.d.ts +23 -0
- package/dist/shared/utils/feature-segments.js +179 -0
- package/dist/shared/utils/id.d.ts +1 -0
- package/dist/shared/utils/id.js +35 -0
- package/dist/shared/utils/image.d.ts +34 -0
- package/dist/shared/utils/image.js +106 -0
- package/dist/shared/utils/index.d.ts +15 -0
- package/dist/shared/utils/index.js +24 -0
- package/dist/shared/utils/map.d.ts +26 -0
- package/dist/shared/utils/map.js +35 -0
- package/dist/shared/utils/name-generator.d.ts +197 -0
- package/dist/shared/utils/name-generator.js +337 -0
- package/dist/shared/utils/pixel-ratio.d.ts +111 -0
- package/dist/shared/utils/pixel-ratio.js +85 -0
- package/dist/shared/utils/property.d.ts +88 -0
- package/dist/shared/utils/property.js +140 -0
- package/dist/shared/utils/vertex-ref.d.ts +23 -0
- package/dist/shared/utils/vertex-ref.js +20 -0
- package/dist/snapping/custom-targets.d.ts +1 -0
- package/dist/snapping/custom-targets.js +21 -0
- package/dist/snapping/geometry.d.ts +1 -0
- package/dist/snapping/geometry.js +61 -0
- package/dist/snapping/index.d.ts +14 -0
- package/dist/snapping/index.js +4 -0
- package/dist/snapping/indicator.d.ts +19 -0
- package/dist/snapping/indicator.js +145 -0
- package/dist/snapping/providers/display.d.ts +72 -0
- package/dist/snapping/providers/display.js +268 -0
- package/dist/snapping/providers/guide.d.ts +69 -0
- package/dist/snapping/providers/guide.js +187 -0
- package/dist/snapping/providers/intersection.d.ts +1 -0
- package/dist/snapping/providers/intersection.js +92 -0
- package/dist/snapping/providers/shared.d.ts +39 -0
- package/dist/snapping/providers/shared.js +146 -0
- package/dist/snapping/providers/store.d.ts +1 -0
- package/dist/snapping/providers/store.js +132 -0
- package/dist/snapping/service.d.ts +1 -0
- package/dist/snapping/service.js +272 -0
- package/dist/snapping/types.d.ts +267 -0
- package/dist/snapping/types.js +66 -0
- package/dist/store/change-merger.d.ts +1 -0
- package/dist/store/change-merger.js +102 -0
- package/dist/store/draw-store.d.ts +1 -0
- package/dist/store/draw-store.js +396 -0
- package/dist/store/event-bridge.d.ts +1 -0
- package/dist/store/event-bridge.js +161 -0
- package/dist/store/index.d.ts +12 -0
- package/dist/store/index.js +4 -0
- package/dist/store/local-visibility.d.ts +21 -0
- package/dist/store/local-visibility.js +27 -0
- package/dist/store/lock.d.ts +67 -0
- package/dist/store/lock.js +54 -0
- package/dist/store/memory/change-bus.d.ts +60 -0
- package/dist/store/memory/change-bus.js +232 -0
- package/dist/store/memory/file-store.d.ts +15 -0
- package/dist/store/memory/file-store.js +33 -0
- package/dist/store/memory/frozen.d.ts +21 -0
- package/dist/store/memory/frozen.js +51 -0
- package/dist/store/memory/ui-state.d.ts +51 -0
- package/dist/store/memory/ui-state.js +223 -0
- package/dist/store/memory.d.ts +26 -0
- package/dist/store/memory.js +708 -0
- package/dist/store/spatial/index.d.ts +6 -0
- package/dist/store/spatial/index.js +4 -0
- package/dist/store/spatial/spatial-index.d.ts +90 -0
- package/dist/store/spatial/spatial-index.js +148 -0
- package/dist/store/spatial/store-spatial-index.d.ts +60 -0
- package/dist/store/spatial/store-spatial-index.js +125 -0
- package/dist/store/store.d.ts +417 -0
- package/dist/store/store.js +3 -0
- package/dist/store/types.d.ts +8 -0
- package/dist/store/types.js +3 -0
- package/dist/store/writable-layer.d.ts +35 -0
- package/dist/store/writable-layer.js +20 -0
- package/dist/view/cache/buffer.d.ts +28 -0
- package/dist/view/cache/buffer.js +176 -0
- package/dist/view/cache/earcut.d.ts +1 -0
- package/dist/view/cache/earcut.js +122 -0
- package/dist/view/cache/style-rule.d.ts +1 -0
- package/dist/view/cache/style-rule.js +97 -0
- package/dist/view/cache/terrain-fill.d.ts +30 -0
- package/dist/view/cache/terrain-fill.js +60 -0
- package/dist/view/cache/texture.d.ts +14 -0
- package/dist/view/cache/texture.js +292 -0
- package/dist/view/coordinator.d.ts +27 -0
- package/dist/view/coordinator.js +72 -0
- package/dist/view/feature-companion.d.ts +173 -0
- package/dist/view/feature-companion.js +108 -0
- package/dist/view/globe-subdivision.d.ts +78 -0
- package/dist/view/globe-subdivision.js +128 -0
- package/dist/view/index.d.ts +47 -0
- package/dist/view/index.js +20 -0
- package/dist/view/layer/attach.d.ts +20 -0
- package/dist/view/layer/attach.js +47 -0
- package/dist/view/layer/blend.d.ts +57 -0
- package/dist/view/layer/blend.js +14 -0
- package/dist/view/layer/custom-layer.d.ts +1 -0
- package/dist/view/layer/custom-layer.js +509 -0
- package/dist/view/layer/depth-state.d.ts +14 -0
- package/dist/view/layer/depth-state.js +44 -0
- package/dist/view/layer/display-list.d.ts +1 -0
- package/dist/view/layer/display-list.js +111 -0
- package/dist/view/layer/drape-planner.d.ts +139 -0
- package/dist/view/layer/drape-planner.js +726 -0
- package/dist/view/layer/frame-render.d.ts +57 -0
- package/dist/view/layer/frame-render.js +209 -0
- package/dist/view/layer/frame-state.d.ts +147 -0
- package/dist/view/layer/frame-state.js +484 -0
- package/dist/view/layer/gl-state.d.ts +77 -0
- package/dist/view/layer/gl-state.js +132 -0
- package/dist/view/layer/index.d.ts +6 -0
- package/dist/view/layer/index.js +5 -0
- package/dist/view/layer/render-scope.d.ts +30 -0
- package/dist/view/layer/render-scope.js +28 -0
- package/dist/view/layer/render.d.ts +87 -0
- package/dist/view/layer/render.js +187 -0
- package/dist/view/layer/renderers.d.ts +81 -0
- package/dist/view/layer/renderers.js +142 -0
- package/dist/view/layer/slot-manager.d.ts +26 -0
- package/dist/view/layer/slot-manager.js +133 -0
- package/dist/view/layer/slots.d.ts +33 -0
- package/dist/view/layer/slots.js +50 -0
- package/dist/view/layer/store-retained-bbox.d.ts +36 -0
- package/dist/view/layer/store-retained-bbox.js +188 -0
- package/dist/view/layer/store-retained-chunk.d.ts +97 -0
- package/dist/view/layer/store-retained-chunk.js +94 -0
- package/dist/view/layer/store-retained-classify.d.ts +34 -0
- package/dist/view/layer/store-retained-classify.js +88 -0
- package/dist/view/layer/store-retained-collect.d.ts +24 -0
- package/dist/view/layer/store-retained-collect.js +121 -0
- package/dist/view/layer/store-retained-coord-patch.d.ts +119 -0
- package/dist/view/layer/store-retained-coord-patch.js +168 -0
- package/dist/view/layer/store-retained-immediate.d.ts +63 -0
- package/dist/view/layer/store-retained-immediate.js +49 -0
- package/dist/view/layer/store-retained-invalidation.d.ts +96 -0
- package/dist/view/layer/store-retained-invalidation.js +192 -0
- package/dist/view/layer/store-retained.d.ts +198 -0
- package/dist/view/layer/store-retained.js +430 -0
- package/dist/view/layer/terrain-resolver.d.ts +1 -0
- package/dist/view/layer/terrain-resolver.js +174 -0
- package/dist/view/renderers/batch-manager.d.ts +61 -0
- package/dist/view/renderers/batch-manager.js +718 -0
- package/dist/view/renderers/draw-factors.d.ts +60 -0
- package/dist/view/renderers/draw-factors.js +35 -0
- package/dist/view/renderers/drawer.d.ts +1 -0
- package/dist/view/renderers/drawer.js +346 -0
- package/dist/view/renderers/image.d.ts +1 -0
- package/dist/view/renderers/image.js +255 -0
- package/dist/view/renderers/line/dash.d.ts +31 -0
- package/dist/view/renderers/line/dash.js +152 -0
- package/dist/view/renderers/line/line-geometry.d.ts +39 -0
- package/dist/view/renderers/line/line-geometry.js +460 -0
- package/dist/view/renderers/line/line-gl.d.ts +1 -0
- package/dist/view/renderers/line/line-gl.js +236 -0
- package/dist/view/renderers/line/line-shader.d.ts +1 -0
- package/dist/view/renderers/line/line-shader.js +364 -0
- package/dist/view/renderers/line/line-types.d.ts +43 -0
- package/dist/view/renderers/line/line-types.js +3 -0
- package/dist/view/renderers/line/line-uniforms.d.ts +1 -0
- package/dist/view/renderers/line/line-uniforms.js +390 -0
- package/dist/view/renderers/line/sdf-line.d.ts +92 -0
- package/dist/view/renderers/line/sdf-line.js +567 -0
- package/dist/view/renderers/point/billboard-depth.d.ts +10 -0
- package/dist/view/renderers/point/billboard-depth.js +56 -0
- package/dist/view/renderers/point/point-instance.d.ts +124 -0
- package/dist/view/renderers/point/point-instance.js +738 -0
- package/dist/view/renderers/point/point-sdf.d.ts +58 -0
- package/dist/view/renderers/point/point-sdf.js +170 -0
- package/dist/view/renderers/point/point-shape.d.ts +99 -0
- package/dist/view/renderers/point/point-shape.js +504 -0
- package/dist/view/renderers/point/point-style.d.ts +1 -0
- package/dist/view/renderers/point/point-style.js +46 -0
- package/dist/view/renderers/polygon/batch.d.ts +26 -0
- package/dist/view/renderers/polygon/batch.js +336 -0
- package/dist/view/renderers/polygon/earcut-input.d.ts +37 -0
- package/dist/view/renderers/polygon/earcut-input.js +55 -0
- package/dist/view/renderers/polygon/earcut-sliced.d.ts +69 -0
- package/dist/view/renderers/polygon/earcut-sliced.js +960 -0
- package/dist/view/renderers/polygon/fill.d.ts +74 -0
- package/dist/view/renderers/polygon/fill.js +251 -0
- package/dist/view/renderers/polygon/sdf-polygon.d.ts +62 -0
- package/dist/view/renderers/polygon/sdf-polygon.js +919 -0
- package/dist/view/renderers/polygon/terrain-cull.d.ts +3 -0
- package/dist/view/renderers/polygon/terrain-cull.js +14 -0
- package/dist/view/renderers/polygon/triangulator.d.ts +41 -0
- package/dist/view/renderers/polygon/triangulator.js +3 -0
- package/dist/view/renderers/retained.d.ts +43 -0
- package/dist/view/renderers/retained.js +3 -0
- package/dist/view/renderers/stroke.d.ts +121 -0
- package/dist/view/renderers/stroke.js +621 -0
- package/dist/view/shaders/frame.d.ts +8 -0
- package/dist/view/shaders/frame.js +37 -0
- package/dist/view/shaders/helpers.d.ts +238 -0
- package/dist/view/shaders/helpers.js +611 -0
- package/dist/view/shaders/initializer.d.ts +27 -0
- package/dist/view/shaders/initializer.js +125 -0
- package/dist/view/shaders/projection.d.ts +123 -0
- package/dist/view/shaders/projection.js +299 -0
- package/dist/view/shaders/quad-grid.d.ts +77 -0
- package/dist/view/shaders/quad-grid.js +128 -0
- package/dist/view/shaders/quad.d.ts +189 -0
- package/dist/view/shaders/quad.js +582 -0
- package/dist/view/shaders/retained-origin.d.ts +50 -0
- package/dist/view/shaders/retained-origin.js +67 -0
- package/dist/view/shaders/terrain-shade.d.ts +23 -0
- package/dist/view/shaders/terrain-shade.js +93 -0
- package/dist/view/style-rule.d.ts +166 -0
- package/dist/view/style-rule.js +300 -0
- package/dist/view/terrain/anchor.d.ts +135 -0
- package/dist/view/terrain/anchor.js +226 -0
- package/dist/view/terrain/context.d.ts +132 -0
- package/dist/view/terrain/context.js +437 -0
- package/dist/view/terrain/dem-atlas.d.ts +97 -0
- package/dist/view/terrain/dem-atlas.js +534 -0
- package/dist/view/terrain/detect.d.ts +126 -0
- package/dist/view/terrain/detect.js +198 -0
- package/dist/view/terrain/drape/bin-store.d.ts +179 -0
- package/dist/view/terrain/drape/bin-store.js +529 -0
- package/dist/view/terrain/drape/binning.d.ts +259 -0
- package/dist/view/terrain/drape/binning.js +604 -0
- package/dist/view/terrain/drape/edge-constrain.d.ts +37 -0
- package/dist/view/terrain/drape/edge-constrain.js +175 -0
- package/dist/view/terrain/drape/geometry.d.ts +95 -0
- package/dist/view/terrain/drape/geometry.js +260 -0
- package/dist/view/terrain/drape/mesh.d.ts +50 -0
- package/dist/view/terrain/drape/mesh.js +86 -0
- package/dist/view/terrain/drape/pass.d.ts +122 -0
- package/dist/view/terrain/drape/pass.js +379 -0
- package/dist/view/terrain/drape/quad-glyphs.d.ts +64 -0
- package/dist/view/terrain/drape/quad-glyphs.js +117 -0
- package/dist/view/terrain/drape/quad.d.ts +249 -0
- package/dist/view/terrain/drape/quad.js +835 -0
- package/dist/view/terrain/drape/renderer.d.ts +184 -0
- package/dist/view/terrain/drape/renderer.js +706 -0
- package/dist/view/terrain/drape/shared.d.ts +80 -0
- package/dist/view/terrain/drape/shared.js +173 -0
- package/dist/view/terrain/drape/stitch.d.ts +155 -0
- package/dist/view/terrain/drape/stitch.js +228 -0
- package/dist/view/terrain/ground.d.ts +72 -0
- package/dist/view/terrain/ground.js +151 -0
- package/dist/view/terrain/metrics.d.ts +180 -0
- package/dist/view/terrain/metrics.js +231 -0
- package/dist/view/terrain/occlusion.d.ts +11 -0
- package/dist/view/terrain/occlusion.js +129 -0
- package/dist/view/terrain/polygon.d.ts +86 -0
- package/dist/view/terrain/polygon.js +301 -0
- package/dist/view/terrain/shade.d.ts +48 -0
- package/dist/view/terrain/shade.js +45 -0
- package/dist/view/terrain/state.d.ts +99 -0
- package/dist/view/terrain/state.js +186 -0
- package/dist/view/terrain/tessellation.d.ts +265 -0
- package/dist/view/terrain/tessellation.js +924 -0
- package/dist/view/terrain/tiling.d.ts +56 -0
- package/dist/view/terrain/tiling.js +155 -0
- package/dist/view/terrain/upstream-terrain.d.ts +82 -0
- package/dist/view/terrain/upstream-terrain.js +116 -0
- package/dist/view/ui/auxiliary-handles.d.ts +151 -0
- package/dist/view/ui/auxiliary-handles.js +22 -0
- package/dist/view/ui/bounds.d.ts +53 -0
- package/dist/view/ui/bounds.js +149 -0
- package/dist/view/ui/box-selection.d.ts +1 -0
- package/dist/view/ui/box-selection.js +83 -0
- package/dist/view/ui/handle-test.d.ts +1 -0
- package/dist/view/ui/handle-test.js +437 -0
- package/dist/view/ui/handle-thinning.d.ts +122 -0
- package/dist/view/ui/handle-thinning.js +430 -0
- package/dist/view/ui/handles.d.ts +25 -0
- package/dist/view/ui/handles.js +673 -0
- package/dist/view/ui/helper.d.ts +19 -0
- package/dist/view/ui/helper.js +76 -0
- package/dist/view/ui/index.d.ts +15 -0
- package/dist/view/ui/index.js +15 -0
- package/dist/view/ui/selection-scope.d.ts +25 -0
- package/dist/view/ui/selection-scope.js +34 -0
- package/dist/view/ui/selection-ui/bounding-box.d.ts +44 -0
- package/dist/view/ui/selection-ui/bounding-box.js +240 -0
- package/dist/view/ui/selection-ui/extension-registry.d.ts +76 -0
- package/dist/view/ui/selection-ui/extension-registry.js +78 -0
- package/dist/view/ui/selection-ui/index.d.ts +12 -0
- package/dist/view/ui/selection-ui/index.js +12 -0
- package/dist/view/ui/selection-ui/renderer.d.ts +29 -0
- package/dist/view/ui/selection-ui/renderer.js +227 -0
- package/dist/view/ui/selection-ui/types.d.ts +55 -0
- package/dist/view/ui/selection-ui/types.js +3 -0
- package/dist/view/ui/selection-ui-drawer.d.ts +52 -0
- package/dist/view/ui/selection-ui-drawer.js +329 -0
- package/dist/view/ui/tentative.d.ts +1 -0
- package/dist/view/ui/tentative.js +320 -0
- package/dist/view/viewport.d.ts +119 -0
- package/dist/view/viewport.js +254 -0
- package/package.json +113 -0
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
import { isLocallyHidden } from '../../store/local-visibility.js';
|
|
4
|
+
import { calculateOffsetUniforms, translateMatrixByLongitude, } from '../shaders/helpers.js';
|
|
5
|
+
import { anchorViewportOf, clearAnchorFrame, setAnchorFrame } from '../terrain/anchor.js';
|
|
6
|
+
import { getCameraMercator, getMapTerrain, getRenderableTerrainTiles, getTerrainMeshSize, getTerrainTileData, } from '../terrain/detect.js';
|
|
7
|
+
import { resolveDrapeLight } from '../terrain/drape/renderer.js';
|
|
8
|
+
import { setQuadDrapeFrame, setTerrainSurfacesFlattened } from '../terrain/state.js';
|
|
9
|
+
import { getSelectedFeatureIds } from '../ui/helper.js';
|
|
10
|
+
import { applyDrawBlendState } from './blend.js';
|
|
11
|
+
import { TERRAIN_ANALYTIC_MIN_ZOOM, } from './drape-planner.js';
|
|
12
|
+
/**
|
|
13
|
+
* The style zoom (the zoom that the rendering reads; a value that absorbs the steps of the
|
|
14
|
+
* elevation settlement)
|
|
15
|
+
*
|
|
16
|
+
* The elevation settlement of maplibre "rewrites the zoom number while keeping the spatial
|
|
17
|
+
* position of the camera fixed". Since the screen does not move by a single pixel, nothing
|
|
18
|
+
* should change size either. This rendering, however, derives the line widths, the labels,
|
|
19
|
+
* the point sizes and the drape factors from the zoom number, so a step in the number is a
|
|
20
|
+
* resize of every element, that is, a jolt that anyone can see. A first version that blended
|
|
21
|
+
* it in with a time-constant smoothing turned into "a 250 ms breath on every settlement" and
|
|
22
|
+
* was rejected.
|
|
23
|
+
*
|
|
24
|
+
* The correct rule is absorption: a change of the zoom number while the camera stays where it
|
|
25
|
+
* is (= a settlement) is not reflected in the style zoom. During a real operation (zoom, pan,
|
|
26
|
+
* inertia) it follows the raw increments. The difference from the settlements (the gap between
|
|
27
|
+
* the style zoom and the raw zoom) is bounded at around ±0.3 as the elevation goes up and down,
|
|
28
|
+
* and it matters more that the apparent sizes keep matching the real scale.
|
|
29
|
+
*
|
|
30
|
+
* A change of the zoom number with no operation in progress is not always a settlement: `jumpTo`
|
|
31
|
+
* and `setZoom` move the camera at once, and the frame after them sees a camera that is not
|
|
32
|
+
* moving. So the position of the camera tells them apart: when it moved, the style zoom takes
|
|
33
|
+
* the raw zoom as it is (absorbing that change would keep every size at the old scale from then
|
|
34
|
+
* on). When the position cannot be read, a change of the zoom number is not absorbed.
|
|
35
|
+
*
|
|
36
|
+
* The rule behind the test is an invariant, not a measurement: a settlement keeps the camera
|
|
37
|
+
* where it is in space and only describes it again (a new zoom number and a new center on the
|
|
38
|
+
* terrain under it), while any change of the zoom at the same pitch moves the camera along its
|
|
39
|
+
* line of sight and changes its altitude by the factor `2^-Δzoom`. The altitude therefore
|
|
40
|
+
* separates the two for any change of the zoom, and the tolerances only have to absorb the
|
|
41
|
+
* floating-point noise of describing the same camera again (see `sameCameraPosition`).
|
|
42
|
+
*
|
|
43
|
+
* How the style zoom returns to the raw zoom follows from the same rule:
|
|
44
|
+
*
|
|
45
|
+
* - `jumpTo`, `setZoom` and any other move of the camera that changes the zoom within one frame:
|
|
46
|
+
* the frame after it sees the camera moved, and the style zoom takes the raw zoom as it is (the
|
|
47
|
+
* gap of earlier settlements is dropped; a jump that keeps the zoom number keeps the gap)
|
|
48
|
+
* - an animated move (`easeTo`, `flyTo`, a gesture, inertia): the frames of the move follow the
|
|
49
|
+
* increments of the raw zoom and keep the gap of earlier settlements, so the sizes do not jump
|
|
50
|
+
* when the move starts; the gap stays after the move ends until a move of the first kind
|
|
51
|
+
* - a settlement: absorbed, and the gap changes by its step (bounded by about ±0.3 as the
|
|
52
|
+
* elevation under the camera goes up and down)
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export class StyleZoom {
|
|
57
|
+
constructor() {
|
|
58
|
+
/** The style zoom. null = not initialized */
|
|
59
|
+
Object.defineProperty(this, "value", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: null
|
|
64
|
+
});
|
|
65
|
+
/** The raw zoom of the previous frame (recorded to follow the increments during an operation) */
|
|
66
|
+
Object.defineProperty(this, "raw", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true,
|
|
70
|
+
value: null
|
|
71
|
+
});
|
|
72
|
+
/** The position of the camera in the previous frame (null = unknown) */
|
|
73
|
+
Object.defineProperty(this, "camera", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
value: null
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Advances by one frame and returns the style zoom of that frame
|
|
82
|
+
*
|
|
83
|
+
* @param camera The position of the camera in this frame (null when it cannot be read)
|
|
84
|
+
*/
|
|
85
|
+
update(rawZoom, cameraBusy, camera = null) {
|
|
86
|
+
if (this.value === null || this.raw === null) {
|
|
87
|
+
this.value = rawZoom;
|
|
88
|
+
}
|
|
89
|
+
else if (cameraBusy) {
|
|
90
|
+
this.value += rawZoom - this.raw;
|
|
91
|
+
}
|
|
92
|
+
else if (rawZoom !== this.raw && !sameCameraPosition(this.camera, camera)) {
|
|
93
|
+
this.value = rawZoom;
|
|
94
|
+
}
|
|
95
|
+
this.raw = rawZoom;
|
|
96
|
+
this.camera = camera;
|
|
97
|
+
return this.value;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Mercator distance under which the camera has not moved sideways (about 40 m on the ground)
|
|
102
|
+
*
|
|
103
|
+
* The camera maplibre reports after a settlement is computed back from the new zoom and center,
|
|
104
|
+
* and its position on the ground drifts by the rounding of that computation (1 to 2 m seen over
|
|
105
|
+
* steep terrain at pitch 60). The altitude is the test that tells a settlement from a jump (any
|
|
106
|
+
* change of the zoom changes it); this bound only keeps a jump far sideways at the same altitude
|
|
107
|
+
* from being taken for a settlement, so it is set well above the drift and far below any jump a
|
|
108
|
+
* host makes on purpose.
|
|
109
|
+
*/
|
|
110
|
+
const CAMERA_STILL_MERCATOR = 1e-6;
|
|
111
|
+
/**
|
|
112
|
+
* Altitude difference (m) under which the camera has not moved up or down, for a camera close to
|
|
113
|
+
* the ground (the floor of the relative tolerance below)
|
|
114
|
+
*/
|
|
115
|
+
const CAMERA_STILL_METERS = 0.01;
|
|
116
|
+
/**
|
|
117
|
+
* The same, relative to the altitude
|
|
118
|
+
*
|
|
119
|
+
* A change of the zoom by Δ changes the altitude by the factor `2^-Δ`, a relative change of about
|
|
120
|
+
* `0.69 * Δ`: this tolerance takes any change of the zoom above about 1.5e-7 for a move of the
|
|
121
|
+
* camera, at every altitude, while the noise of describing the same camera again (float64
|
|
122
|
+
* arithmetic on a few terms) stays orders of magnitude below it.
|
|
123
|
+
*/
|
|
124
|
+
const CAMERA_STILL_RELATIVE = 1e-7;
|
|
125
|
+
/** Whether two positions of the camera are the same place (false when either is unknown) */
|
|
126
|
+
function sameCameraPosition(a, b) {
|
|
127
|
+
if (!a || !b)
|
|
128
|
+
return false;
|
|
129
|
+
const altitudeTolerance = Math.max(CAMERA_STILL_METERS, Math.abs(a[2]) * CAMERA_STILL_RELATIVE);
|
|
130
|
+
return (Math.abs(a[0] - b[0]) <= CAMERA_STILL_MERCATOR &&
|
|
131
|
+
Math.abs(a[1] - b[1]) <= CAMERA_STILL_MERCATOR &&
|
|
132
|
+
Math.abs(a[2] - b[2]) <= altitudeTolerance);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Builds the state of a frame (done once by the first slot)
|
|
136
|
+
*
|
|
137
|
+
* It sets up the shaders and the anchor projection of the frame, plans the analytic drape,
|
|
138
|
+
* picks the features of the immediate path and the selection, and plans the copies of the world.
|
|
139
|
+
*/
|
|
140
|
+
export function buildFrameState(input) {
|
|
141
|
+
const { gl, renderers: r, map, store, terrainContext, drape, renderOptions } = input;
|
|
142
|
+
const { zoom, rawZoom, dpr, terrainState } = input;
|
|
143
|
+
const { shaderData, defaultProjectionData } = renderOptions;
|
|
144
|
+
const mapTerrain = terrainState.active ? getMapTerrain(map) : null;
|
|
145
|
+
// Shader initialization
|
|
146
|
+
const center = map.getCenter();
|
|
147
|
+
const centerLngLat = [center.lng, center.lat];
|
|
148
|
+
r.shaderInitializer.incrementSdfLineFrame();
|
|
149
|
+
r.shaderInitializer.ensureShaders(shaderData);
|
|
150
|
+
r.shaderInitializer.setProjectionData(defaultProjectionData);
|
|
151
|
+
const mainMatrixArray = Array.from(defaultProjectionData.mainMatrix);
|
|
152
|
+
const baseOffsetUniforms = calculateOffsetUniforms(centerLngLat, mainMatrixArray);
|
|
153
|
+
r.shaderInitializer.applyOffsetUniforms(baseOffsetUniforms);
|
|
154
|
+
// Shader initialization of the BoxSelectionRenderer
|
|
155
|
+
r.boxSelectionRenderer.ensureShader(shaderData);
|
|
156
|
+
const boxOffsetUniforms = calculateOffsetUniforms(centerLngLat, mainMatrixArray);
|
|
157
|
+
r.boxSelectionRenderer.setOffsetUniforms(boxOffsetUniforms);
|
|
158
|
+
// Establish the anchor projection (the single source shared by the positions of the points
|
|
159
|
+
// and the handles and by the hit testing) with the values of this frame. The matrix, the
|
|
160
|
+
// offsets and the elevation scale used for rendering are passed through as they are, so the
|
|
161
|
+
// projection on the CPU side uses the same formula and the same branches as the vertex
|
|
162
|
+
// shader. When the terrain is inactive it is removed and hit testing goes back to the project
|
|
163
|
+
// of MapLibre (exactly the same path as before the terrain was introduced).
|
|
164
|
+
if (terrainState.active && mapTerrain) {
|
|
165
|
+
const viewport = anchorViewportOf(map);
|
|
166
|
+
setAnchorFrame(terrainContext, {
|
|
167
|
+
terrain: mapTerrain,
|
|
168
|
+
// The elevation of the surface maplibre draws (terrain/ground.ts)
|
|
169
|
+
elevationQuery: map,
|
|
170
|
+
zoom,
|
|
171
|
+
elevationScale: terrainState.elevationScale,
|
|
172
|
+
mainMatrix: mainMatrixArray,
|
|
173
|
+
offsetUniforms: boxOffsetUniforms,
|
|
174
|
+
width: viewport.width,
|
|
175
|
+
height: viewport.height,
|
|
176
|
+
// Used by the occlusion test of the symbols (ghost) to trace the segment from the camera
|
|
177
|
+
// to the anchor
|
|
178
|
+
cameraMercator: getCameraMercator(map, terrainState.elevationScale),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
clearAnchorFrame(terrainContext);
|
|
183
|
+
}
|
|
184
|
+
// Decide first whether retained mode can draw (whether the renderers support it). Retained
|
|
185
|
+
// mode draws the batches prepared per layer, so neither walking the feature list nor the
|
|
186
|
+
// per-feature viewport filtering is needed. The off-screen thinning is done by renderLayers
|
|
187
|
+
// per chunk (the bbox of the expanded viewport is computed once per frame).
|
|
188
|
+
// Whether the analytic drape can be used (the path that paints features as ground pixels).
|
|
189
|
+
// When it can, the polygons and lines are drawn there and only the rest (points and so on)
|
|
190
|
+
// goes through the previous path (drape-planner.ts).
|
|
191
|
+
const drapeUsable = drape.planFrame({
|
|
192
|
+
gl,
|
|
193
|
+
resolveStyles: () => r.batchManager.getRetainedRenderers()?.styles ?? r.featureDrawer,
|
|
194
|
+
mapTerrain,
|
|
195
|
+
dpr,
|
|
196
|
+
zoom,
|
|
197
|
+
rawZoom,
|
|
198
|
+
});
|
|
199
|
+
const useRetained = !drapeUsable && input.retainedAvailable && r.batchManager.getRetainedRenderers() !== undefined;
|
|
200
|
+
// Viewport filtering. The display list is "the list that should be shown", which
|
|
201
|
+
// excludes the local visibility of this client in addition to the shared visible flag.
|
|
202
|
+
const excluded = drapeUsable ? drape.excluded : null;
|
|
203
|
+
// An image interleaved into the stacking order is drawn between the sections of the drape,
|
|
204
|
+
// so it is excluded from the later layer rendering (drawing it in both would double it)
|
|
205
|
+
const drawnQuadBreaks = drapeUsable ? drape.quadBreaks : [];
|
|
206
|
+
const interleavedQuadIds = new Set();
|
|
207
|
+
for (const brk of drawnQuadBreaks)
|
|
208
|
+
interleavedQuadIds.add(brk.featureId);
|
|
209
|
+
// The features in view come from the spatial index and are put in draw order by the kept
|
|
210
|
+
// display list (display-list.ts), so the cost follows what is on screen
|
|
211
|
+
const features = useRetained
|
|
212
|
+
? []
|
|
213
|
+
: input.displayList
|
|
214
|
+
.inOrder(r.viewportFilter.getVisibleIds())
|
|
215
|
+
.filter((feature) => excluded === null || (excluded.has(feature.id) && !interleavedQuadIds.has(feature.id)));
|
|
216
|
+
// The single source of truth of the selection carries a kind. A group / layer selection is
|
|
217
|
+
// resolved to its members and reflected on the map (getSelectedFeatureIds absorbs
|
|
218
|
+
// feature / group / layer).
|
|
219
|
+
const selectedIds = getSelectedFeatureIds(store);
|
|
220
|
+
const selectedIdSet = new Set(selectedIds);
|
|
221
|
+
// The features for the selection UI are resolved directly from the selected ids. This keeps
|
|
222
|
+
// them independent of the rendering path (retained / immediate mode), so the selection UI is
|
|
223
|
+
// the same either way. They used to be picked from the features after the viewport filter, so
|
|
224
|
+
// a selected feature off the screen got no selection UI. Now it does (it is drawn correctly
|
|
225
|
+
// when part of the selection box reaches into the screen).
|
|
226
|
+
const selectedFeatures = [];
|
|
227
|
+
for (const id of selectedIds) {
|
|
228
|
+
const feature = store.getFeature(id);
|
|
229
|
+
if (!feature?.visible || isLocallyHidden(feature, store))
|
|
230
|
+
continue;
|
|
231
|
+
selectedFeatures.push(feature);
|
|
232
|
+
}
|
|
233
|
+
// Compositing of translucency (alpha blending; the reason is written in blend.ts)
|
|
234
|
+
//
|
|
235
|
+
// This state is a contract for the whole frame. An external renderer (a custom feature type,
|
|
236
|
+
// an overlay) may rewrite the blend function for its own purposes, and if it comes back
|
|
237
|
+
// having left it rewritten, everything drawn afterwards is composited wrongly. This function
|
|
238
|
+
// is called again at the point control comes back, to establish the contract again.
|
|
239
|
+
const restoreBlendState = () => applyDrawBlendState(gl);
|
|
240
|
+
// The degenerate band of a wide view is drawn without depth
|
|
241
|
+
//
|
|
242
|
+
// Over a wide area the relief of the terrain is tiny on screen (at z8.6 a 1,000 m ridge is a
|
|
243
|
+
// dozen or so pixels), so turning off the occlusion hardly changes how the distance looks. On
|
|
244
|
+
// the other hand the vertex displacement path has the property that "the fill sinks into the
|
|
245
|
+
// ground where it disagrees with the terrain mesh", and that punch-through stands out as
|
|
246
|
+
// white dots in areas dense with polygons, such as a city center
|
|
247
|
+
// (repro = 8.60/35.54609/139.46385/0.0/17.0). With the depth off, sinking cannot happen by
|
|
248
|
+
// construction. It is not applied in the band where the analytic drape is running (there the
|
|
249
|
+
// features are ground pixels themselves, so the occlusion works correctly).
|
|
250
|
+
const wideFallback = !drapeUsable && rawZoom <= TERRAIN_ANALYTIC_MIN_ZOOM;
|
|
251
|
+
// In a wide band the polygons and lines are drawn flat (the reason is surfacesFlattened in
|
|
252
|
+
// terrain/context.ts). It is the same band and the same reason as turning off the depth.
|
|
253
|
+
// Symbols (points, handles, text quads) are out of scope, so stopping it here does not
|
|
254
|
+
// break the agreement between the anchor projection and the hit testing.
|
|
255
|
+
setTerrainSurfacesFlattened(terrainContext, terrainState.active && wideFallback);
|
|
256
|
+
const quadDrapeFrame = buildQuadDrapeFrame(input, mapTerrain);
|
|
257
|
+
// Context for the custom renderers
|
|
258
|
+
const customRendererContext = {
|
|
259
|
+
shaderData,
|
|
260
|
+
centerLngLat,
|
|
261
|
+
mainMatrixArray,
|
|
262
|
+
pixelRatio: dpr,
|
|
263
|
+
terrain: terrainContext,
|
|
264
|
+
// An overlay does not belong to a layer. The layer loop passes each layer its own opacity
|
|
265
|
+
opacity: 1,
|
|
266
|
+
sdfLineRenderer: r.sdfLineRenderer,
|
|
267
|
+
fillShaderManager: r.fillShaderManager,
|
|
268
|
+
pointShapeRenderer: r.pointShapeRenderer,
|
|
269
|
+
};
|
|
270
|
+
// Separate the layer-aware overlay renderers from the rest
|
|
271
|
+
const layerAwareRenderers = [];
|
|
272
|
+
const otherRenderers = [];
|
|
273
|
+
for (const renderer of input.overlayRenderers) {
|
|
274
|
+
if ('drawForLayer' in renderer && typeof renderer.drawForLayer === 'function') {
|
|
275
|
+
layerAwareRenderers.push(renderer);
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
otherRenderers.push(renderer);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (drapeUsable)
|
|
282
|
+
drape.reportImmediate(features.length);
|
|
283
|
+
const drapeLight = resolveDrapeLight(map.getBearing());
|
|
284
|
+
const drapeDraws = drape.buildDraws({
|
|
285
|
+
drapeUsable,
|
|
286
|
+
shaderData,
|
|
287
|
+
mapTerrain,
|
|
288
|
+
getProjectionData: renderOptions.getProjectionData,
|
|
289
|
+
});
|
|
290
|
+
// The copies of the world in view
|
|
291
|
+
const baseCopy = {
|
|
292
|
+
lngShift: 0,
|
|
293
|
+
view: undefined,
|
|
294
|
+
projectionData: defaultProjectionData,
|
|
295
|
+
offsetUniforms: baseOffsetUniforms,
|
|
296
|
+
customRendererContext,
|
|
297
|
+
features,
|
|
298
|
+
selectedFeatures,
|
|
299
|
+
terrainState,
|
|
300
|
+
};
|
|
301
|
+
const copies = planCopies(baseCopy, {
|
|
302
|
+
renderers: r,
|
|
303
|
+
displayList: input.displayList,
|
|
304
|
+
center: centerLngLat,
|
|
305
|
+
mainMatrixArray,
|
|
306
|
+
useRetained,
|
|
307
|
+
excluded,
|
|
308
|
+
interleavedQuadIds,
|
|
309
|
+
transition: defaultProjectionData.projectionTransition ?? 0,
|
|
310
|
+
});
|
|
311
|
+
return {
|
|
312
|
+
segments: input.segments.slice(),
|
|
313
|
+
layerOrder: store.getLayerOrder(),
|
|
314
|
+
lastIndex: -1,
|
|
315
|
+
shaderData,
|
|
316
|
+
defaultProjectionData,
|
|
317
|
+
getProjectionData: renderOptions.getProjectionData,
|
|
318
|
+
zoom,
|
|
319
|
+
rawZoom,
|
|
320
|
+
dpr,
|
|
321
|
+
terrainState,
|
|
322
|
+
mapTerrain,
|
|
323
|
+
centerLngLat,
|
|
324
|
+
mainMatrixArray,
|
|
325
|
+
drapeUsable,
|
|
326
|
+
wideFallback,
|
|
327
|
+
useRetained,
|
|
328
|
+
features,
|
|
329
|
+
selectedIdSet,
|
|
330
|
+
selectedFeatures,
|
|
331
|
+
customRendererContext,
|
|
332
|
+
layerAwareRenderers,
|
|
333
|
+
otherRenderers,
|
|
334
|
+
quadDrapeFrame,
|
|
335
|
+
restoreBlendState,
|
|
336
|
+
drapeReady: drapeDraws.ready,
|
|
337
|
+
drapeLight,
|
|
338
|
+
drapeTileDraws: drapeDraws.tileDraws,
|
|
339
|
+
drapeElementsTotal: drape.tileStore.elementCount,
|
|
340
|
+
drapeAboveStoreStart: drape.tileStore.aboveStoreStart,
|
|
341
|
+
drapeEntryStarts: drape.tileStore.entryStarts,
|
|
342
|
+
pendingQuads: drapeDraws.pendingQuads,
|
|
343
|
+
drapeFallbackQuads: drapeDraws.fallbackQuads,
|
|
344
|
+
baseCopy,
|
|
345
|
+
copies,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Installs the entry point that pins the textured quads (Image, the fill of a quad that
|
|
350
|
+
* carries text) to the ground
|
|
351
|
+
*
|
|
352
|
+
* A billboard of four corner vertices always cuts in when the terrain inside pokes out of the
|
|
353
|
+
* plane through those corners. With this entry point present, QuadShader takes the path that
|
|
354
|
+
* pins it as "ground pixels" instead of a billboard. In a frame without it (no terrain, the
|
|
355
|
+
* DEM has not arrived, the shaders cannot be built) it falls back to the subdivision path or
|
|
356
|
+
* to the previous billboard.
|
|
357
|
+
*/
|
|
358
|
+
function buildQuadDrapeFrame(input, mapTerrain) {
|
|
359
|
+
const { terrainState, renderOptions, map } = input;
|
|
360
|
+
if (!terrainState.active || !mapTerrain)
|
|
361
|
+
return null;
|
|
362
|
+
const quadTerrain = mapTerrain;
|
|
363
|
+
const quadDrapeRenderer = input.drape.quadRenderer(input.gl);
|
|
364
|
+
const quadTiles = getRenderableTerrainTiles(quadTerrain);
|
|
365
|
+
if (quadTiles.length === 0)
|
|
366
|
+
return null;
|
|
367
|
+
// The DEM and the ProjectionData are looked up once per tile in this frame (baking them
|
|
368
|
+
// in would keep drawing the coarse elevation of the parent tile)
|
|
369
|
+
const terrainDataCache = new Map();
|
|
370
|
+
const projectionCache = new Map();
|
|
371
|
+
const quadDrapeFrame = {
|
|
372
|
+
renderer: quadDrapeRenderer,
|
|
373
|
+
shaderData: renderOptions.shaderData,
|
|
374
|
+
tiles: quadTiles,
|
|
375
|
+
meshSize: getTerrainMeshSize(quadTerrain),
|
|
376
|
+
light: resolveDrapeLight(map.getBearing()),
|
|
377
|
+
// The depth test stays on through the layer rendering, whether or not the drape was used,
|
|
378
|
+
// and goes off from the foreground on (renderForeground)
|
|
379
|
+
keepDepthTest: true,
|
|
380
|
+
getTerrainData(tile) {
|
|
381
|
+
const hit = terrainDataCache.get(tile.tileID);
|
|
382
|
+
if (hit !== undefined)
|
|
383
|
+
return hit;
|
|
384
|
+
const data = getTerrainTileData(quadTerrain, tile);
|
|
385
|
+
terrainDataCache.set(tile.tileID, data);
|
|
386
|
+
return data;
|
|
387
|
+
},
|
|
388
|
+
getProjectionData(tile) {
|
|
389
|
+
const hit = projectionCache.get(tile.tileID);
|
|
390
|
+
if (hit !== undefined)
|
|
391
|
+
return hit;
|
|
392
|
+
// getProjectionData throws when the shape of tileID does not match. This keeps the
|
|
393
|
+
// whole rendering from failing if it changes between versions.
|
|
394
|
+
let data = null;
|
|
395
|
+
try {
|
|
396
|
+
data = renderOptions.getProjectionData({
|
|
397
|
+
tileID: tile.tileID,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
catch {
|
|
401
|
+
data = null;
|
|
402
|
+
}
|
|
403
|
+
projectionCache.set(tile.tileID, data);
|
|
404
|
+
return data;
|
|
405
|
+
},
|
|
406
|
+
};
|
|
407
|
+
setQuadDrapeFrame(input.terrainContext, quadDrapeFrame);
|
|
408
|
+
return quadDrapeFrame;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Plans the copies of the world drawn in this frame
|
|
412
|
+
*
|
|
413
|
+
* One copy (the base one, unchanged) unless the view crosses the antimeridian. Across it,
|
|
414
|
+
* each copy gets its range of the view, the features of that range, the virtual camera
|
|
415
|
+
* (center and matrix moved by the copy's shift, computed in 64 bits) and the DEM atlas in the
|
|
416
|
+
* frame of that camera. The globe draws with maplibre's projectTile, which has no seam, so it
|
|
417
|
+
* keeps one copy.
|
|
418
|
+
*/
|
|
419
|
+
export function planCopies(baseCopy, options) {
|
|
420
|
+
const filter = options.renderers?.viewportFilter;
|
|
421
|
+
if (!filter || typeof filter.getCopies !== 'function' || options.transition > 0) {
|
|
422
|
+
return [baseCopy];
|
|
423
|
+
}
|
|
424
|
+
const viewCopies = filter.getCopies();
|
|
425
|
+
if (viewCopies.length === 1 && viewCopies[0].lngShift === 0)
|
|
426
|
+
return [baseCopy];
|
|
427
|
+
return viewCopies.map((viewCopy) => {
|
|
428
|
+
let visibleIds = null;
|
|
429
|
+
const getVisibleIds = () => {
|
|
430
|
+
if (!visibleIds)
|
|
431
|
+
visibleIds = filter.getVisibleIdsIn(viewCopy.bounds);
|
|
432
|
+
return visibleIds;
|
|
433
|
+
};
|
|
434
|
+
const view = { bounds: viewCopy.bounds, getVisibleIds };
|
|
435
|
+
const features = options.useRetained
|
|
436
|
+
? []
|
|
437
|
+
: options.displayList
|
|
438
|
+
.inOrder(getVisibleIds())
|
|
439
|
+
.filter((feature) => options.excluded === null ||
|
|
440
|
+
(options.excluded.has(feature.id) && !options.interleavedQuadIds.has(feature.id)));
|
|
441
|
+
const selected = baseCopy.selectedFeatures.filter((feature) => getVisibleIds().has(feature.id));
|
|
442
|
+
const shift = viewCopy.lngShift;
|
|
443
|
+
if (shift === 0) {
|
|
444
|
+
return { ...baseCopy, view, features, selectedFeatures: selected };
|
|
445
|
+
}
|
|
446
|
+
// The virtual camera of this copy
|
|
447
|
+
const matrix = translateMatrixByLongitude(options.mainMatrixArray, shift);
|
|
448
|
+
const center = [options.center[0] - shift, options.center[1]];
|
|
449
|
+
// The same array type as the matrix maplibre hands over (it is uploaded as it is)
|
|
450
|
+
const baseMatrix = baseCopy.projectionData.mainMatrix;
|
|
451
|
+
const projectionData = {
|
|
452
|
+
...baseCopy.projectionData,
|
|
453
|
+
mainMatrix: (baseMatrix instanceof Float32Array
|
|
454
|
+
? new Float32Array(matrix)
|
|
455
|
+
: new Float64Array(matrix)),
|
|
456
|
+
};
|
|
457
|
+
const base = baseCopy.terrainState;
|
|
458
|
+
const terrainState = base.active
|
|
459
|
+
? {
|
|
460
|
+
...base,
|
|
461
|
+
atlasRect: [
|
|
462
|
+
base.atlasRect[0] - shift / 360,
|
|
463
|
+
base.atlasRect[1],
|
|
464
|
+
base.atlasRect[2],
|
|
465
|
+
base.atlasRect[3],
|
|
466
|
+
],
|
|
467
|
+
}
|
|
468
|
+
: base;
|
|
469
|
+
return {
|
|
470
|
+
lngShift: shift,
|
|
471
|
+
view,
|
|
472
|
+
projectionData,
|
|
473
|
+
offsetUniforms: calculateOffsetUniforms(center, matrix),
|
|
474
|
+
customRendererContext: {
|
|
475
|
+
...baseCopy.customRendererContext,
|
|
476
|
+
centerLngLat: center,
|
|
477
|
+
mainMatrixArray: matrix,
|
|
478
|
+
},
|
|
479
|
+
features,
|
|
480
|
+
selectedFeatures: selected,
|
|
481
|
+
terrainState,
|
|
482
|
+
};
|
|
483
|
+
});
|
|
484
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The GL state of a slot
|
|
3
|
+
*
|
|
4
|
+
* maplibre resets the GL state between the slots, so every slot establishes the state its frame
|
|
5
|
+
* assumes when it starts and hands the defaults of maplibre back when it ends. Every switch of
|
|
6
|
+
* the blending, the depth test, the depth function, the depth mask and the polygon offset made
|
|
7
|
+
* by the layer itself (outside the renderers) is here:
|
|
8
|
+
*
|
|
9
|
+
* - `applySegmentGlState` / `restoreSegmentGlState`: the start and the end of a slot
|
|
10
|
+
* - `applySegmentDepthState`: the depth state of the layer rendering, set at the start of a
|
|
11
|
+
* slot and again after the drape
|
|
12
|
+
* - `applyDrapeGlState`: the analytic drape (premultiplied alpha, LEQUAL, no offset)
|
|
13
|
+
* - `enterSymbolGlState`: the foreground, the selection UI and the overlays (always in front)
|
|
14
|
+
*
|
|
15
|
+
* The record of the depth test (depth-state.ts) is updated by every switch, and the blend state
|
|
16
|
+
* of the frame (blend.ts) is re-established through `restoreBlendState`.
|
|
17
|
+
*/
|
|
18
|
+
import type { TerrainContext, TerrainRenderState } from '../terrain/context.js';
|
|
19
|
+
import type { QuadDrapeFrame } from '../terrain/drape/quad.js';
|
|
20
|
+
import type { DrapeLight } from '../terrain/drape/renderer.js';
|
|
21
|
+
/** The parts of the frame that decide the GL state of a slot */
|
|
22
|
+
export interface SegmentGlFrame {
|
|
23
|
+
readonly terrainState: TerrainRenderState;
|
|
24
|
+
readonly drapeLight: DrapeLight;
|
|
25
|
+
readonly wideFallback: boolean;
|
|
26
|
+
readonly quadDrapeFrame: QuadDrapeFrame | null;
|
|
27
|
+
readonly restoreBlendState: () => void;
|
|
28
|
+
}
|
|
29
|
+
/** Establishes the GL state this frame assumes, at the start of the drawing of a slot */
|
|
30
|
+
export declare function applySegmentGlState(gl: WebGL2RenderingContext, terrainContext: TerrainContext, f: SegmentGlFrame): void;
|
|
31
|
+
/**
|
|
32
|
+
* Establishes the depth state of the layer rendering of a slot
|
|
33
|
+
*
|
|
34
|
+
* `applySegmentGlState` sets it at the start of a slot, and the drape of the segment, which
|
|
35
|
+
* changes the depth function and the offset, hands it back with this before the layers are
|
|
36
|
+
* drawn. The layers are therefore drawn in one depth state whether or not the drape was used.
|
|
37
|
+
* What the drape cannot paint (dashed lines, polygons with a dashed outline, the geometry being
|
|
38
|
+
* drawn, the features of extensions, the datasets not handed over to it) is
|
|
39
|
+
* drawn after it by the vertex displacement path and must be hidden by the terrain in the same
|
|
40
|
+
* way. Symbols switch the depth test off themselves (`drawBillboardsWithoutDepth`).
|
|
41
|
+
*/
|
|
42
|
+
export declare function applySegmentDepthState(gl: WebGL2RenderingContext, terrainContext: TerrainContext, f: Pick<SegmentGlFrame, 'terrainState' | 'wideFallback'>): void;
|
|
43
|
+
/** Restores the GL state to the defaults of maplibre at the end of the drawing of a slot */
|
|
44
|
+
export declare function restoreSegmentGlState(gl: WebGL2RenderingContext, f: SegmentGlFrame): void;
|
|
45
|
+
/**
|
|
46
|
+
* Establishes the GL state of the analytic drape
|
|
47
|
+
*
|
|
48
|
+
* Composite with premultiplied alpha (the coverage is evaluated once per pixel, so an overlap
|
|
49
|
+
* is never painted twice).
|
|
50
|
+
*
|
|
51
|
+
* What the drape draws is the ground itself. It coincides with the terrain surface of maplibre
|
|
52
|
+
* at the same height, so on pixels of equal depth the winner wavers and the edges get eaten away
|
|
53
|
+
* (pronounced on a shallow slope; confirmed in the field). The depth function is set to LEQUAL so
|
|
54
|
+
* that equality wins, and the slope-proportional bias (which exists to fill the sinking of the
|
|
55
|
+
* chords of the CPU subdivision) is not applied: the surfaces of the drape are not chords, so it
|
|
56
|
+
* is not needed. The occlusion is carried by the depth test itself, so it must not be turned off.
|
|
57
|
+
*
|
|
58
|
+
* The depth bias (polygonOffset) is not used. The factor is proportional to the screen-space
|
|
59
|
+
* gradient of the depth, so it acts too strongly on a shallow slope, and its unit depends on the
|
|
60
|
+
* resolution of the depth buffer. The drape lifts its vertices ever so slightly to win instead
|
|
61
|
+
* (DRAPE_LIFT_RATIO in drape/renderer.ts).
|
|
62
|
+
*/
|
|
63
|
+
export declare function applyDrapeGlState(gl: WebGL2RenderingContext): void;
|
|
64
|
+
/**
|
|
65
|
+
* Goes back to the drape after an image was interleaved (the blending and the depth test; the
|
|
66
|
+
* depth function and the offset were left as the drape set them)
|
|
67
|
+
*/
|
|
68
|
+
export declare function resumeDrapeGlState(gl: WebGL2RenderingContext): void;
|
|
69
|
+
/**
|
|
70
|
+
* Establishes the GL state of the symbols and the UI (no depth test)
|
|
71
|
+
*
|
|
72
|
+
* From here on it is not "something painted onto the ground" but the symbols and the UI.
|
|
73
|
+
* Points, handles and selection boxes are billboards, so with the depth in effect they disappear
|
|
74
|
+
* entirely as soon as they sink a little into the ground. Measured, enabling the terrain made
|
|
75
|
+
* every point invisible. Symbols are always drawn in front.
|
|
76
|
+
*/
|
|
77
|
+
export declare function enterSymbolGlState(gl: WebGL2RenderingContext): void;
|