leaflet-city-mapper 0.0.9 → 0.1.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/README.md +6 -46
- package/dist/README.md +18 -0
- package/dist/leaflet-city-mapper-src.js +279 -110
- package/dist/leaflet-city-mapper-src.js.map +4 -4
- package/dist/leaflet-city-mapper-worker-src.js.map +2 -2
- package/dist/leaflet-city-mapper-worker.js.map +2 -2
- package/dist/leaflet-city-mapper.js +5 -5
- package/dist/leaflet-city-mapper.js.map +4 -4
- package/libs/README.md +18 -0
- package/libs/leaflet.js +1 -1
- package/package.json +1 -1
- package/src/README.md +148 -0
- package/src/animations/README.md +30 -0
- package/src/animations/cancelCameraAnimation.js +11 -9
- package/src/animations/cancelGridFade.js +5 -3
- package/src/animations/endZoom.js +0 -5
- package/src/animations/mapAnimateCamera.js +13 -3
- package/src/animations/mapStopPitchBearingAnimation.js +9 -2
- package/src/animations/onZoomAnim.js +5 -4
- package/src/animations/renderPendingZoomAnimation.js +1 -4
- package/src/animations/runCameraAnimations.js +7 -4
- package/src/animations/runGridFades.js +1 -4
- package/src/animations/runMarkerPanFrame.js +1 -1
- package/src/animations/scheduleCameraAnimation.js +11 -9
- package/src/animations/scheduleGridFade.js +5 -4
- package/src/animations/scheduleMarkerPan.js +10 -6
- package/src/animations/startZoom.js +0 -3
- package/src/animations/synchronizeZoomView.js +6 -1
- package/src/animations/updateZoomCamera.js +9 -5
- package/src/archives/README.md +28 -0
- package/src/archives/decodeDirectory.js +13 -2
- package/src/archives/decodeHeader.js +9 -2
- package/src/archives/decompress.js +10 -0
- package/src/archives/findDirectoryEntry.js +8 -0
- package/src/archives/findTile.js +14 -0
- package/src/archives/getDirectoryEntries.js +13 -2
- package/src/archives/getHeader.js +7 -2
- package/src/archives/getTileData.js +13 -0
- package/src/archives/getZxy.js +11 -3
- package/src/archives/loadDirectory.js +10 -0
- package/src/archives/loadSource.js +12 -3
- package/src/archives/readArchiveRange.js +18 -4
- package/src/archives/readVarint.js +11 -2
- package/src/archives/tileId.js +11 -2
- package/src/astronomy/README.md +25 -0
- package/src/astronomy/horizontalPosition.js +11 -0
- package/src/astronomy/moonPosition.js +9 -2
- package/src/astronomy/solarPosition.js +9 -2
- package/src/astronomy/solarTime.js +11 -1
- package/src/camera/README.md +30 -0
- package/src/camera/cameraMapReady.js +4 -6
- package/src/camera/cleanupCameraMap.js +6 -8
- package/src/camera/constrainCameraToBounds.js +1 -0
- package/src/camera/createSceneCamera.js +5 -1
- package/src/camera/fitCameraBounds.js +9 -1
- package/src/camera/getBearing.js +5 -0
- package/src/camera/getPitch.js +5 -0
- package/src/camera/initializeCameraMap.js +1 -3
- package/src/camera/mapCamera.js +0 -2
- package/src/camera/mapContainerPointToLayerPoint.js +7 -2
- package/src/camera/mapGetBearing.js +7 -2
- package/src/camera/mapGetBounds.js +5 -2
- package/src/camera/mapGetBoundsCenterZoom.js +13 -6
- package/src/camera/mapGetBoundsZoom.js +9 -2
- package/src/camera/mapGetCenterLayerPoint.js +5 -1
- package/src/camera/mapGetPitch.js +7 -2
- package/src/camera/mapLayerPointToContainerPoint.js +7 -1
- package/src/camera/mapLimitCenter.js +9 -2
- package/src/camera/mapLimitOffset.js +13 -7
- package/src/camera/mapPanBy.js +12 -5
- package/src/camera/mapPanInside.js +8 -2
- package/src/camera/mapResetNorth.js +8 -0
- package/src/camera/mapResetNorthPitch.js +8 -0
- package/src/camera/mapSetBearing.js +10 -0
- package/src/camera/mapSetPitch.js +10 -0
- package/src/camera/mapSetPitchAndBearing.js +12 -3
- package/src/camera/mapSetZoomAround.js +9 -1
- package/src/camera/mapTryAnimatedPan.js +8 -1
- package/src/camera/mapUpdateCameraOverlays.js +6 -0
- package/src/camera/setBearing.js +8 -0
- package/src/camera/setPitch.js +8 -0
- package/src/camera/updateMapCamera.js +6 -4
- package/src/camera/updateSceneCamera.js +7 -1
- package/src/camera/updateSky.js +1 -3
- package/src/cog/README.md +29 -0
- package/src/cog/decodeCogTile.js +13 -0
- package/src/cog/finiteCogValues.js +7 -0
- package/src/cog/getCogAssetEntry.js +11 -0
- package/src/cog/getCogBase.js +12 -0
- package/src/cog/getCogHeader.js +7 -0
- package/src/cog/getCogProfile.js +9 -0
- package/src/cog/getCogTile.js +13 -0
- package/src/cog/getColorTile.js +13 -0
- package/src/cog/getElevationTile.js +13 -0
- package/src/cog/hasCogProjection.js +7 -0
- package/src/cog/initCog.js +6 -0
- package/src/cog/invalidCogFullResponse.js +7 -0
- package/src/cog/openCog.js +11 -1
- package/src/cog/openCogAsset.js +8 -0
- package/src/cog/readCog.js +14 -0
- package/src/cog/readCogBlock.js +11 -0
- package/src/cog/readCogBody.js +10 -0
- package/src/cog/readCogDirectories.js +12 -0
- package/src/cog/readCogDirectory.js +13 -0
- package/src/cog/readCogLevel.js +9 -0
- package/src/cog/readCogTag.js +13 -0
- package/src/cog/validCogDimensions.js +9 -0
- package/src/cog/validCogEncoding.js +13 -0
- package/src/cog/validCogGeoArrays.js +9 -0
- package/src/cog/validCogGrid.js +13 -0
- package/src/cog/validCogTileCoordinates.js +9 -0
- package/src/cog/validateCogContainer.js +8 -0
- package/src/cog/validateCogContentRange.js +10 -0
- package/src/cog/validateCogOffsets.js +9 -0
- package/src/cog/validateCogRange.js +9 -0
- package/src/cog/validateCogResponse.js +11 -0
- package/src/collision/README.md +28 -0
- package/src/collision/advanceFeature.js +13 -0
- package/src/collision/boxNormal.js +29 -0
- package/src/collision/cachedCollider.js +18 -0
- package/src/collision/collectIntersections.js +28 -3
- package/src/collision/collectMeshes.js +6 -0
- package/src/collision/collideTrip.js +56 -0
- package/src/collision/collider.js +28 -18
- package/src/collision/countCrossings.js +35 -15
- package/src/collision/enclosesOrigin.js +13 -0
- package/src/collision/flipsNormal.js +15 -0
- package/src/collision/hiddenLightHit.js +11 -0
- package/src/collision/horizontalRay.js +13 -1
- package/src/collision/indexTriangle.js +7 -0
- package/src/collision/insideMesh.js +16 -2
- package/src/collision/insideWalker.js +7 -1
- package/src/collision/intersectMeshes.js +9 -1
- package/src/collision/localRay.js +10 -0
- package/src/collision/mergeHits.js +8 -0
- package/src/collision/missesBox.js +13 -0
- package/src/collision/rayBounds.js +9 -0
- package/src/collision/readTriangle.js +9 -0
- package/src/collision/slabDistance.js +14 -0
- package/src/collision/slabMiss.js +14 -0
- package/src/collision/sortCrossings.js +17 -0
- package/src/collision/sortHits.js +9 -1
- package/src/collision/trafficBounds.js +24 -0
- package/src/collision/trafficCollision.js +24 -49
- package/src/collision/trafficRay.js +21 -0
- package/src/collision/transformTriangle.js +9 -0
- package/src/collision/transformVertices.js +18 -0
- package/src/collision/triangleDistance.js +14 -1
- package/src/collision/vertexCount.js +8 -0
- package/src/collision/worldHit.js +12 -0
- package/src/colors/README.md +25 -0
- package/src/colors/formatRGB.js +7 -0
- package/src/colors/hslChannel.js +10 -0
- package/src/colors/mixColor.js +10 -0
- package/src/colors/parseColor.js +4 -1
- package/src/colors/toSRGB.js +7 -0
- package/src/controls/README.md +26 -0
- package/src/controls/acceptPitchDrag.js +7 -0
- package/src/controls/acceptRotateDrag.js +7 -0
- package/src/controls/addCameraHandler.js +7 -0
- package/src/controls/adjustCameraDrag.js +6 -8
- package/src/controls/cameraControls.js +5 -4
- package/src/controls/cameraDragClick.js +5 -1
- package/src/controls/cameraDragContextMenu.js +7 -3
- package/src/controls/cameraDragDown.js +5 -2
- package/src/controls/cameraDragEnd.js +8 -4
- package/src/controls/cameraDragMove.js +12 -8
- package/src/controls/changeCameraTouch.js +6 -8
- package/src/controls/cleanupCameraTouch.js +1 -4
- package/src/controls/compassAddHooks.js +1 -0
- package/src/controls/compassOrientation.js +7 -1
- package/src/controls/compassRemoveHooks.js +1 -0
- package/src/controls/containerResizeAddHooks.js +1 -0
- package/src/controls/containerResizeRemoveHooks.js +1 -0
- package/src/controls/dragCamera.js +11 -2
- package/src/controls/endAllCameraDrags.js +1 -2
- package/src/controls/endAllCameraTouches.js +1 -2
- package/src/controls/endCameraTouch.js +6 -0
- package/src/controls/endCameraTouchEvent.js +5 -2
- package/src/controls/failCompassPermission.js +6 -0
- package/src/controls/finishCameraDrag.js +6 -0
- package/src/controls/finishCompassPermission.js +7 -0
- package/src/controls/isEditableTarget.js +7 -0
- package/src/controls/loadCameraControls.js +9 -0
- package/src/controls/moveCameraTouch.js +9 -6
- package/src/controls/notifyCameraTouchChange.js +1 -0
- package/src/controls/pitchDragAddHooks.js +1 -1
- package/src/controls/pitchDragRemoveHooks.js +1 -0
- package/src/controls/refreshRotateControl.js +2 -0
- package/src/controls/refreshRotateFocus.js +3 -2
- package/src/controls/removeCameraDrag.js +15 -12
- package/src/controls/resizeMap.js +5 -0
- package/src/controls/rotateButtonClick.js +6 -1
- package/src/controls/rotateButtonKeydown.js +10 -4
- package/src/controls/rotateControl.js +9 -1
- package/src/controls/rotateOnAdd.js +7 -1
- package/src/controls/rotateOnRemove.js +5 -0
- package/src/controls/shiftRotateAddHooks.js +1 -1
- package/src/controls/shiftRotateRemoveHooks.js +1 -0
- package/src/controls/shiftRotateWheel.js +9 -4
- package/src/controls/startCameraTouch.js +5 -2
- package/src/core/README.md +28 -0
- package/src/core/adjustCameraMarkerPan.js +7 -2
- package/src/core/cameraCircleBounds.js +5 -1
- package/src/core/cameraMarkerDrag.js +1 -2
- package/src/core/cameraMarkerOnDrag.js +7 -4
- package/src/core/closestCameraLayerPoint.js +7 -1
- package/src/core/constructLayer.js +7 -0
- package/src/core/extendLeafletClass.js +7 -0
- package/src/core/extendTerrainPixelBounds.js +10 -0
- package/src/core/fireRasterLoad.js +1 -1
- package/src/core/gridlayerGetEvents.js +5 -2
- package/src/core/gridlayerGetTiledPixelBounds.js +7 -1
- package/src/core/initializeGridContainer.js +1 -1
- package/src/core/initializeNativeLayer.js +1 -4
- package/src/core/layerAddInitHook.js +5 -0
- package/src/core/layerCallInitHooks.js +1 -2
- package/src/core/layerMergeOptions.js +7 -0
- package/src/core/markerGetEvents.js +5 -2
- package/src/core/markerInitInteraction.js +8 -5
- package/src/core/markerSetIcon.js +11 -6
- package/src/core/markerSetPos.js +5 -2
- package/src/core/markerSetRotation.js +10 -0
- package/src/core/markerUpdateZIndex.js +6 -4
- package/src/core/popupAdjustPan.js +5 -2
- package/src/core/popupGetEvents.js +5 -1
- package/src/core/popupUpdatePosition.js +1 -2
- package/src/core/projectNativePath.js +7 -0
- package/src/core/redrawPath.js +5 -0
- package/src/core/removeLayer.js +10 -7
- package/src/core/setRotation.js +7 -0
- package/src/core/tooltipGetEvents.js +5 -1
- package/src/core/tooltipSetPosition.js +5 -2
- package/src/core/updateGridOpacity.js +2 -1
- package/src/core/whenReady.js +9 -6
- package/src/geometry/README.md +29 -0
- package/src/geometry/addBridges.js +8 -6
- package/src/geometry/addGeneratedTriangle.js +8 -4
- package/src/geometry/appendAreaTriangle.js +15 -0
- package/src/geometry/appendNativeTriangle.js +14 -0
- package/src/geometry/appendRouteDash.js +18 -0
- package/src/geometry/appendRouteSegment.js +13 -0
- package/src/geometry/assembleAreaGeometry.js +7 -0
- package/src/geometry/boundsQuad.js +8 -0
- package/src/geometry/box.js +10 -0
- package/src/geometry/bridgeEdge.js +7 -0
- package/src/geometry/bridgeElevation.js +8 -1
- package/src/geometry/bridgeFaces.js +7 -0
- package/src/geometry/bridgePaths.js +8 -0
- package/src/geometry/bridgePolygon.js +6 -0
- package/src/geometry/bridgeSides.js +7 -0
- package/src/geometry/buildGeometryParts.js +7 -0
- package/src/geometry/buildProjectedPoint.js +11 -0
- package/src/geometry/buildProjectedPolygon.js +9 -0
- package/src/geometry/circleAt.js +15 -2
- package/src/geometry/circleGeometry.js +6 -0
- package/src/geometry/clipLine.js +8 -1
- package/src/geometry/clipSegment.js +9 -0
- package/src/geometry/computeBounds.js +5 -2
- package/src/geometry/conformModelToTerrain.js +6 -3
- package/src/geometry/createLampRing.js +8 -0
- package/src/geometry/createModelGeometry.js +11 -1
- package/src/geometry/createRasterQuadGeometry.js +7 -1
- package/src/geometry/createTreeRing.js +8 -1
- package/src/geometry/crossVector.js +8 -0
- package/src/geometry/dashValues.js +9 -0
- package/src/geometry/dashedSegment.js +12 -0
- package/src/geometry/disk.js +9 -0
- package/src/geometry/diskAt.js +14 -2
- package/src/geometry/emitter.js +10 -0
- package/src/geometry/fillNativePolygon.js +8 -0
- package/src/geometry/generateTreeGeometry.js +11 -5
- package/src/geometry/indexBridge.js +8 -2
- package/src/geometry/instanceAreaGeometry.js +7 -1
- package/src/geometry/interpolateRoute.js +10 -2
- package/src/geometry/lampPostGeometry.js +9 -2
- package/src/geometry/lightGeometry.js +9 -2
- package/src/geometry/line.js +7 -0
- package/src/geometry/lineJoin.js +9 -0
- package/src/geometry/markerImageBounds.js +9 -0
- package/src/geometry/markerQuadCorners.js +9 -3
- package/src/geometry/meshShadowBounds.js +9 -0
- package/src/geometry/nativeGeometry.js +9 -1
- package/src/geometry/offsetBelowGround.js +7 -0
- package/src/geometry/polygon.js +7 -0
- package/src/geometry/quad.js +14 -0
- package/src/geometry/restoreGeometry.js +6 -0
- package/src/geometry/roofCoverage.js +12 -5
- package/src/geometry/roofFootprint.js +12 -4
- package/src/geometry/routeGeometry.js +7 -2
- package/src/geometry/samePoint.js +8 -0
- package/src/geometry/segment.js +9 -0
- package/src/geometry/setVertexColor.js +1 -1
- package/src/geometry/shadowBounds.js +8 -0
- package/src/geometry/subtractRoofTile.js +9 -0
- package/src/geometry/subtractVector.js +8 -0
- package/src/geometry/surface.js +11 -1
- package/src/geometry/terrainBuffers.js +10 -3
- package/src/geometry/terrainGrid.js +7 -2
- package/src/geometry/terrainTileGeometry.js +13 -4
- package/src/geometry/treeGeometry.js +7 -4
- package/src/geometry/triangle.js +11 -0
- package/src/geometry/validateTree.js +12 -0
- package/src/geometry/vertexNormals.js +8 -2
- package/src/geometry/visitNativeCoordinates.js +7 -0
- package/src/globals/CELL.js +6 -2
- package/src/globals/Compass.js +5 -0
- package/src/globals/ContainerResize.js +5 -0
- package/src/globals/HEIGHT.js +5 -0
- package/src/globals/L.js +5 -0
- package/src/globals/PitchDrag.js +5 -0
- package/src/globals/README.md +28 -0
- package/src/globals/ShiftRotate.js +5 -0
- package/src/globals/TILE_RADIUS.js +5 -0
- package/src/globals/TILE_SIZE.js +5 -0
- package/src/globals/TouchMode.js +5 -0
- package/src/globals/alphaBlend.js +5 -0
- package/src/globals/archiveDecoder.js +5 -0
- package/src/globals/archiveNorthWest.js +5 -0
- package/src/globals/archiveSouthEast.js +5 -0
- package/src/globals/atmosphereColor.js +5 -0
- package/src/globals/atmosphereStops.js +5 -0
- package/src/globals/blobParts.js +5 -0
- package/src/globals/cameraAngles.js +5 -0
- package/src/globals/cameraAnimatedOptions.js +5 -0
- package/src/globals/cameraAnimationFrame.js +5 -0
- package/src/globals/cameraAnimations.js +5 -0
- package/src/globals/cameraBearingSensitivity.js +5 -0
- package/src/globals/cameraDragSensitivity.js +5 -0
- package/src/globals/cameraDrags.js +5 -0
- package/src/globals/cameraEmptyOptions.js +5 -0
- package/src/globals/cameraFocusOptions.js +5 -0
- package/src/globals/cameraFov.js +5 -0
- package/src/globals/cameraListenerOptions.js +5 -0
- package/src/globals/cameraTouchStates.js +5 -0
- package/src/globals/cameraZeroPadding.js +5 -0
- package/src/globals/cogTags.js +5 -0
- package/src/globals/colorLayout.js +5 -0
- package/src/globals/colorTexture.js +5 -0
- package/src/globals/coreEventTypes.js +5 -0
- package/src/globals/coreMatrixKeys.js +5 -0
- package/src/globals/coreQuadIndices.js +5 -0
- package/src/globals/coreQuadUV.js +5 -0
- package/src/globals/coreSampler.js +5 -0
- package/src/globals/coreWhite.js +5 -0
- package/src/globals/cosObliquity.js +5 -0
- package/src/globals/coverageTiles.js +5 -0
- package/src/globals/dark.js +5 -0
- package/src/globals/defaultMaterial.js +5 -0
- package/src/globals/degrees.js +5 -0
- package/src/globals/demBuffer.js +5 -0
- package/src/globals/demLayout.js +5 -0
- package/src/globals/demSize.js +5 -0
- package/src/globals/demTarget.js +5 -0
- package/src/globals/demTexture.js +5 -0
- package/src/globals/depthBindGroup.js +5 -0
- package/src/globals/depthTexture.js +5 -0
- package/src/globals/directoryReader.js +5 -0
- package/src/globals/disabledShadow.js +5 -0
- package/src/globals/drawEntries.js +5 -0
- package/src/globals/drawFrameEntry.js +5 -0
- package/src/globals/drawMeshEntry.js +5 -0
- package/src/globals/drawSamplerEntries.js +5 -0
- package/src/globals/drawTerrainEntry.js +5 -0
- package/src/globals/drawTextureEntries.js +5 -0
- package/src/globals/earthCirc.js +5 -0
- package/src/globals/elevationWGSL.js +2 -0
- package/src/globals/fragmentShader.js +5 -0
- package/src/globals/frameBuffer.js +5 -0
- package/src/globals/frameCommands.js +5 -0
- package/src/globals/frameLayoutEntry.js +5 -0
- package/src/globals/geometryDecoder.js +5 -0
- package/src/globals/geometryEmpty.js +5 -0
- package/src/globals/geometryImageOptions.js +5 -0
- package/src/globals/geometryPixelStates.js +5 -0
- package/src/globals/geometryQuaternion.js +5 -0
- package/src/globals/geometryScale.js +5 -0
- package/src/globals/geometrySemantics.js +5 -0
- package/src/globals/geometryTranslation.js +5 -0
- package/src/globals/geometryWorkerUrl.js +5 -0
- package/src/globals/glass.js +5 -0
- package/src/globals/gridEvents.js +5 -0
- package/src/globals/gridFadeFrame.js +5 -0
- package/src/globals/halfRadians.js +5 -0
- package/src/globals/headerBounds.js +5 -0
- package/src/globals/headerFlags.js +5 -0
- package/src/globals/headerOffsets.js +5 -0
- package/src/globals/headlight.js +5 -0
- package/src/globals/hull.js +5 -0
- package/src/globals/instanceLayout.js +5 -0
- package/src/globals/lampDirections.js +5 -0
- package/src/globals/layerControlAddItem.js +5 -0
- package/src/globals/layerProto.js +5 -0
- package/src/globals/leafletLayer.js +5 -0
- package/src/globals/lightScale.js +5 -0
- package/src/globals/limbs.js +5 -1
- package/src/globals/loading.js +5 -0
- package/src/globals/mapMethods.js +5 -0
- package/src/globals/markerMethods.js +5 -0
- package/src/globals/markerPanFrame.js +5 -0
- package/src/globals/meshBindGroup.js +5 -0
- package/src/globals/meshBuffer.js +5 -0
- package/src/globals/meshCopySize.js +5 -0
- package/src/globals/meshImage.js +5 -0
- package/src/globals/meshLayoutEntry.js +5 -0
- package/src/globals/meshOffsets.js +5 -0
- package/src/globals/meshPipeline.js +5 -0
- package/src/globals/meshStack.js +5 -0
- package/src/globals/meshTarget.js +5 -0
- package/src/globals/moves.js +5 -1
- package/src/globals/mvtTextDecoder.js +5 -0
- package/src/globals/nativeMethodHandlers.js +5 -0
- package/src/globals/nativeScalableStyleKeys.js +5 -0
- package/src/globals/nextId.js +5 -0
- package/src/globals/normalLayout.js +5 -0
- package/src/globals/paints.js +5 -0
- package/src/globals/parts.js +5 -0
- package/src/globals/pendingGridFades.js +5 -0
- package/src/globals/pendingInitializations.js +5 -0
- package/src/globals/pendingMapChanges.js +5 -0
- package/src/globals/pendingMarkerPan.js +5 -0
- package/src/globals/pendingPlacements.js +5 -0
- package/src/globals/pendingRasterLoads.js +5 -0
- package/src/globals/pendingUpdates.js +5 -0
- package/src/globals/pendingZoomAnimations.js +5 -0
- package/src/globals/pipelineLayout.js +5 -0
- package/src/globals/popupEvents.js +5 -0
- package/src/globals/popupPan.js +5 -0
- package/src/globals/popupPosition.js +5 -0
- package/src/globals/positionLayout.js +5 -0
- package/src/globals/programEntries.js +5 -0
- package/src/globals/programLayout.js +5 -0
- package/src/globals/radians.js +5 -0
- package/src/globals/rasterBuffer.js +5 -0
- package/src/globals/rasterIndices.js +5 -0
- package/src/globals/rasterNormals.js +5 -0
- package/src/globals/rasterPoint.js +5 -0
- package/src/globals/rasterPositions.js +5 -0
- package/src/globals/rasterSampler.js +5 -0
- package/src/globals/rasterTexture.js +5 -0
- package/src/globals/rasterUVs.js +5 -0
- package/src/globals/removeLayer.js +5 -0
- package/src/globals/renderEmpty.js +5 -0
- package/src/globals/ringDirections.js +5 -0
- package/src/globals/roofBindGroup.js +5 -0
- package/src/globals/roofBlitSampler.js +5 -0
- package/src/globals/roofBuffer.js +5 -0
- package/src/globals/roofCommands.js +5 -0
- package/src/globals/roofCopySize.js +5 -0
- package/src/globals/roofImage.js +5 -0
- package/src/globals/roofMin.js +5 -0
- package/src/globals/roofOpacities.js +5 -0
- package/src/globals/roofPass.js +5 -0
- package/src/globals/roofPipeline.js +5 -0
- package/src/globals/roofSampler.js +5 -0
- package/src/globals/roofShader.js +5 -0
- package/src/globals/roofSignatures.js +5 -0
- package/src/globals/roofSize.js +5 -0
- package/src/globals/roofTarget.js +5 -0
- package/src/globals/roofTexture.js +5 -0
- package/src/globals/roofTiles.js +5 -0
- package/src/globals/roundProfile.js +5 -0
- package/src/globals/samplerLayoutEntries.js +5 -0
- package/src/globals/sceneCleanupFields.js +5 -0
- package/src/globals/sceneEmptyOptions.js +5 -0
- package/src/globals/scenePass.js +5 -0
- package/src/globals/sceneSunlightUniforms.js +5 -0
- package/src/globals/sceneTransferFields.js +5 -0
- package/src/globals/sceneWalkHandlers.js +5 -0
- package/src/globals/shadowBindGroup.js +5 -0
- package/src/globals/shadowBounds.js +5 -0
- package/src/globals/shadowCamera.js +5 -0
- package/src/globals/shadowDepthLayout.js +5 -0
- package/src/globals/shadowHigh.js +5 -0
- package/src/globals/shadowInstanceLayouts.js +5 -0
- package/src/globals/shadowLayouts.js +5 -0
- package/src/globals/shadowLow.js +5 -0
- package/src/globals/shadowMeshLayout.js +5 -0
- package/src/globals/shadowOffsets.js +5 -0
- package/src/globals/shadowPass.js +5 -0
- package/src/globals/shadowPipeline.js +5 -0
- package/src/globals/shadowPipelineLayout.js +5 -0
- package/src/globals/shadowShader.js +5 -0
- package/src/globals/shadowTexture.js +5 -0
- package/src/globals/shadowValues.js +5 -0
- package/src/globals/shirt.js +5 -0
- package/src/globals/sinObliquity.js +5 -0
- package/src/globals/sizes.js +5 -0
- package/src/globals/skin.js +5 -0
- package/src/globals/speed.js +5 -1
- package/src/globals/sunBindGroup.js +5 -0
- package/src/globals/taillight.js +5 -0
- package/src/globals/tau.js +5 -0
- package/src/globals/terrainLayoutEntry.js +5 -0
- package/src/globals/textureLayoutEntries.js +5 -0
- package/src/globals/tiledBounds.js +5 -0
- package/src/globals/tooltipEvents.js +5 -0
- package/src/globals/tooltipPosition.js +5 -0
- package/src/globals/trafficClocks.js +5 -0
- package/src/globals/trafficEmptyList.js +5 -0
- package/src/globals/trafficEmptyOptions.js +5 -0
- package/src/globals/trafficRouteMaterial.js +5 -0
- package/src/globals/trafficShader.js +5 -1
- package/src/globals/triangleContexts.js +5 -0
- package/src/globals/trousers.js +5 -0
- package/src/globals/types.js +5 -0
- package/src/globals/tyre.js +5 -0
- package/src/globals/uVLayout.js +5 -0
- package/src/globals/vectorStyleNamedColors.js +5 -0
- package/src/globals/vectorTileEvents.js +5 -0
- package/src/globals/vehicles.js +2 -0
- package/src/globals/vertexShader.js +5 -0
- package/src/globals/wantedTiles.js +5 -0
- package/src/globals/white.js +5 -0
- package/src/globals/workerCogSource.js +5 -0
- package/src/gpu/README.md +29 -0
- package/src/gpu/initializeRendererResources.js +6 -1
- package/src/gpu/initializeSharedRenderer.js +15 -8
- package/src/gpu/mountRenderer.js +7 -1
- package/src/gpu/releaseRenderer.js +8 -0
- package/src/gpu/rendererDeviceError.js +5 -3
- package/src/gpu/rendererDeviceLost.js +5 -3
- package/src/gpu/reportShaderCompilation.js +8 -0
- package/src/gpu/requestAdapter.js +8 -0
- package/src/gpu/requestDevice.js +9 -0
- package/src/gpu/showWebGPUWarning.js +5 -0
- package/src/index.js +0 -2
- package/src/layer-controls/README.md +25 -0
- package/src/layer-controls/layerControlInputId.js +7 -0
- package/src/layer-controls/layerCountTitle.js +10 -0
- package/src/layer-controls/placeEntry.js +9 -0
- package/src/layer-controls/placeEntryElement.js +7 -0
- package/src/layer-controls/placeUnderEntry.js +7 -0
- package/src/layer-controls/removeEntry.js +1 -0
- package/src/layer-controls/renderLayerCount.js +9 -1
- package/src/layer-controls/replaceEntry.js +1 -2
- package/src/layer-controls/runPlacements.js +1 -2
- package/src/layer-controls/underEntry.js +6 -2
- package/src/layer-controls/updateLayerCount.js +5 -1
- package/src/lighting/README.md +28 -0
- package/src/lighting/cacheLightGrid.js +9 -1
- package/src/lighting/collectLightMeshes.js +7 -1
- package/src/lighting/lightGrid.js +10 -1
- package/src/lighting/updatePointLights.js +7 -3
- package/src/lighting/visitLightCells.js +14 -1
- package/src/lighting/visitLightGridCells.js +11 -0
- package/src/lighting/worldLights.js +8 -1
- package/src/lighting/writeLightCell.js +9 -0
- package/src/materials/README.md +28 -0
- package/src/materials/createProgram.js +8 -4
- package/src/materials/createProgramLayout.js +8 -0
- package/src/materials/createProgramUniforms.js +7 -0
- package/src/materials/modelMaterialFor.js +8 -0
- package/src/materials/prepareMeshCutout.js +9 -0
- package/src/materials/terrainRasterProgram.js +15 -8
- package/src/materials/validateRoofMaterial.js +7 -0
- package/src/models/README.md +27 -0
- package/src/models/applyModelTransform.js +6 -2
- package/src/models/buildModelNodes.js +10 -0
- package/src/models/createModelContext.js +9 -0
- package/src/models/decodeModel.js +13 -2
- package/src/models/hasUnsupportedPrimitives.js +7 -0
- package/src/models/loadBuffer.js +10 -0
- package/src/models/loadModel.js +10 -7
- package/src/models/loadModelResources.js +8 -0
- package/src/models/modelNode.js +11 -1
- package/src/models/normalizeAccessor.js +10 -0
- package/src/models/prepareModel.js +10 -0
- package/src/models/prepareModelGeometry.js +10 -0
- package/src/models/prepareModelPrimitive.js +8 -0
- package/src/models/readAccessor.js +10 -4
- package/src/models/readAccessorValue.js +9 -0
- package/src/models/readAccessorValues.js +17 -0
- package/src/models/readModelAttributes.js +12 -0
- package/src/models/readModelIndices.js +12 -0
- package/src/models/readSparseAccessor.js +12 -0
- package/src/models/releaseModelResources.js +5 -0
- package/src/mvt/README.md +28 -0
- package/src/mvt/addMvtCrossings.js +6 -0
- package/src/mvt/appendMvtBandTriangles.js +11 -0
- package/src/mvt/appendMvtCoordinates.js +9 -0
- package/src/mvt/appendMvtPolygonTriangles.js +10 -0
- package/src/mvt/beginMvtPath.js +10 -0
- package/src/mvt/closeMvtPath.js +9 -0
- package/src/mvt/collectMvtEdges.js +10 -0
- package/src/mvt/createMvtReader.js +7 -0
- package/src/mvt/decodeVectorTile.js +7 -0
- package/src/mvt/expectMvtWire.js +8 -0
- package/src/mvt/finishMvtPath.js +9 -0
- package/src/mvt/finiteMvtCoordinate.js +7 -0
- package/src/mvt/groupMvtPolygons.js +10 -0
- package/src/mvt/isMvtFallbackError.js +7 -0
- package/src/mvt/mergeMvtActiveEdges.js +9 -0
- package/src/mvt/mvtEdgeX.js +8 -0
- package/src/mvt/mvtPathsVertices.js +7 -0
- package/src/mvt/mvtPolygonPaths.js +7 -0
- package/src/mvt/numericMvtValue.js +7 -0
- package/src/mvt/readMvtFeature.js +12 -0
- package/src/mvt/readMvtField.js +9 -0
- package/src/mvt/readMvtGeometry.js +13 -0
- package/src/mvt/readMvtInteger.js +10 -0
- package/src/mvt/readMvtKnownValue.js +9 -0
- package/src/mvt/readMvtLayer.js +9 -0
- package/src/mvt/readMvtMessage.js +8 -0
- package/src/mvt/readMvtNumber.js +9 -0
- package/src/mvt/readMvtNumbers.js +7 -0
- package/src/mvt/readMvtString.js +8 -0
- package/src/mvt/readMvtValue.js +10 -0
- package/src/mvt/skipMvtField.js +8 -0
- package/src/mvt/sortMvtActiveEdges.js +5 -0
- package/src/mvt/sortedMvtLevels.js +7 -0
- package/src/mvt/takeMvtBytes.js +10 -0
- package/src/mvt/tessellateVectorRings.js +7 -0
- package/src/mvt/triangulateVectorRings.js +4 -0
- package/src/native/README.md +27 -0
- package/src/native/beforeNativeRender.js +5 -0
- package/src/native/bypassNativeEvent.js +10 -0
- package/src/native/canScaleNativeStyle.js +9 -0
- package/src/native/compareNativeHits.js +8 -0
- package/src/native/createNativeMesh.js +15 -0
- package/src/native/disposeNativeLayer.js +3 -2
- package/src/native/forwardNativeError.js +5 -0
- package/src/native/getGridTerrainTile.js +13 -0
- package/src/native/gridTerrainElevation.js +8 -0
- package/src/native/handleNativeMapEvent.js +9 -4
- package/src/native/hideTargets.js +6 -0
- package/src/native/initNativeGPU.js +6 -3
- package/src/native/isCurrentNativeLayer.js +9 -4
- package/src/native/loadGridTerrain.js +10 -0
- package/src/native/nativeAddLatLng.js +7 -0
- package/src/native/nativeBringToBack.js +7 -0
- package/src/native/nativeBringToFront.js +7 -0
- package/src/native/nativeEventSource.js +9 -0
- package/src/native/nativeEvents.js +5 -4
- package/src/native/nativeLayer.js +10 -6
- package/src/native/nativeLayerMethod.js +9 -2
- package/src/native/nativeProgram.js +8 -0
- package/src/native/nativeRedraw.js +7 -0
- package/src/native/nativeSetBounds.js +7 -0
- package/src/native/nativeSetIcon.js +7 -0
- package/src/native/nativeSetLatLng.js +7 -0
- package/src/native/nativeSetLatLngs.js +7 -0
- package/src/native/nativeSetOpacity.js +7 -0
- package/src/native/nativeSetRadius.js +7 -0
- package/src/native/nativeSetStyle.js +7 -0
- package/src/native/nativeSetUrl.js +7 -0
- package/src/native/nativeSetZIndex.js +7 -0
- package/src/native/nativeSetZIndexOffset.js +7 -0
- package/src/native/nativeTerrainElevation.js +11 -0
- package/src/native/nativeVectorGeometry.js +7 -0
- package/src/native/orderNativeGridLayer.js +6 -0
- package/src/native/prepareGridTerrainRequests.js +7 -0
- package/src/native/pruneNativeResources.js +5 -0
- package/src/native/putNativeMesh.js +14 -0
- package/src/native/quadNativeMesh.js +11 -1
- package/src/native/readyNativeGPU.js +10 -6
- package/src/native/refreshNativeEvent.js +5 -0
- package/src/native/refreshNativeLayer.js +5 -3
- package/src/native/refreshNativeLayerContract.js +5 -2
- package/src/native/rejectNativeReady.js +5 -0
- package/src/native/removeNativeEvents.js +7 -3
- package/src/native/removeTargets.js +5 -2
- package/src/native/reorderNativeLayer.js +5 -3
- package/src/native/resolveNativeReady.js +3 -0
- package/src/native/restoreNativeEvents.js +3 -0
- package/src/native/retainGridTerrain.js +5 -0
- package/src/native/styleNativeMesh.js +11 -5
- package/src/native/syncGridLayer.js +5 -1
- package/src/native/syncGridTile.js +10 -0
- package/src/native/syncImageOverlay.js +8 -3
- package/src/native/syncMarker.js +5 -0
- package/src/native/syncNativeStrokeAnchors.js +6 -0
- package/src/native/syncNativeStrokeZoom.js +5 -0
- package/src/native/syncTerrainGridTile.js +10 -0
- package/src/native/syncVectorLayer.js +5 -0
- package/src/native/synchronizeNativeLayer.js +5 -3
- package/src/native/terrainGridMesh.js +13 -0
- package/src/native/updateNativeHover.js +8 -0
- package/src/native/updateNativeLayerView.js +3 -3
- package/src/native/updateNativeStrokeRadius.js +5 -0
- package/src/picking/README.md +29 -0
- package/src/picking/collectVisibleMesh.js +8 -0
- package/src/picking/findFeature.js +4 -4
- package/src/picking/hit.js +14 -7
- package/src/picking/hitColliderCell.js +10 -0
- package/src/picking/hitMesh.js +8 -2
- package/src/picking/onClick.js +6 -5
- package/src/picking/onPointerLeave.js +5 -5
- package/src/picking/onPointerMove.js +6 -5
- package/src/picking/pointerClick.js +5 -0
- package/src/picking/pointerLeave.js +1 -0
- package/src/picking/pointerMove.js +5 -0
- package/src/picking/raycast.js +2 -4
- package/src/picking/setHighlight.js +6 -5
- package/src/picking/shouldSkipOther.js +8 -2
- package/src/picking/showFeature.js +7 -4
- package/src/picking/validateCameraInverse.js +7 -0
- package/src/projections/README.md +28 -0
- package/src/projections/cameraAngles.js +8 -1
- package/src/projections/displayContainerPoint.js +9 -0
- package/src/projections/groundBounds.js +9 -1
- package/src/projections/localPixel.js +8 -0
- package/src/projections/localPixelForGeometry.js +8 -1
- package/src/projections/localPosition.js +8 -2
- package/src/projections/markerCameraIconPoint.js +9 -1
- package/src/projections/projectBridgePoint.js +13 -1
- package/src/projections/projectCameraPoint.js +11 -1
- package/src/projections/projectCelestialBody.js +11 -2
- package/src/projections/projectRing.js +11 -1
- package/src/projections/projectTreePoint.js +9 -1
- package/src/projections/toPoint.js +9 -1
- package/src/projections/transformZoomAnimationPoint.js +12 -5
- package/src/projections/verticalGroundY.js +11 -0
- package/src/projections/walkerLocalPosition.js +7 -0
- package/src/raster/README.md +28 -0
- package/src/raster/addRasterTile.js +10 -2
- package/src/raster/comparePendingTiles.js +8 -0
- package/src/raster/createRasterMesh.js +6 -5
- package/src/raster/finishRasterAttachment.js +9 -4
- package/src/raster/finishRasterTile.js +11 -2
- package/src/raster/getRasterEvents.js +7 -0
- package/src/raster/getRasterTileSize.js +5 -1
- package/src/raster/initRaster.js +6 -3
- package/src/raster/isRasterLoading.js +7 -3
- package/src/raster/loadRasterTile.js +8 -3
- package/src/raster/onPMTileAdd.js +6 -3
- package/src/raster/onPMTileRemove.js +6 -3
- package/src/raster/pruneRasterTiles.js +7 -3
- package/src/raster/pumpRasterTiles.js +5 -4
- package/src/raster/rasterTileRange.js +9 -0
- package/src/raster/readyRaster.js +8 -3
- package/src/raster/registerTerrainTile.js +9 -3
- package/src/raster/releaseRasterTile.js +6 -3
- package/src/raster/releaseRasterTiles.js +5 -3
- package/src/raster/removeRasterTile.js +6 -3
- package/src/raster/reportRasterError.js +8 -0
- package/src/raster/retainRasterTiles.js +7 -2
- package/src/raster/setPMTileOpacity.js +8 -0
- package/src/raster/setPMTileZIndex.js +8 -0
- package/src/raster/setRasterOpacity.js +6 -3
- package/src/raster/setRasterTerrain.js +6 -3
- package/src/raster/setRasterZIndex.js +6 -3
- package/src/raster/updateAttachedTiles.js +9 -3
- package/src/raster/updateRasterTiles.js +5 -5
- package/src/rendering/README.md +32 -0
- package/src/rendering/collectFrameMeshes.js +7 -3
- package/src/rendering/collectMeshes.js +11 -0
- package/src/rendering/collectVisibleMesh.js +9 -0
- package/src/rendering/compareMeshDepth.js +8 -0
- package/src/rendering/compareMeshes.js +10 -1
- package/src/rendering/createMesh.js +8 -5
- package/src/rendering/disposeMesh.js +6 -0
- package/src/rendering/drawGeometry.js +9 -2
- package/src/rendering/drawPipeline.js +10 -0
- package/src/rendering/drawSceneMeshes.js +9 -3
- package/src/rendering/nativeStrokeExpansion.js +7 -0
- package/src/rendering/prepareFrameBuffer.js +8 -2
- package/src/rendering/prepareFrameMeshes.js +10 -3
- package/src/rendering/prepareFrameUniforms.js +8 -3
- package/src/rendering/prepareMeshUniforms.js +10 -1
- package/src/rendering/render.js +2 -5
- package/src/rendering/resizeRenderer.js +6 -3
- package/src/rendering/revealRoofMesh.js +10 -1
- package/src/scene/README.md +36 -0
- package/src/scene/addRegisteredLayer.js +5 -4
- package/src/scene/addSceneLayer.js +9 -3
- package/src/scene/attachLayer.js +8 -3
- package/src/scene/attachSharedScene.js +6 -1
- package/src/scene/callLayer.js +11 -5
- package/src/scene/cancelUpdate.js +5 -3
- package/src/scene/createLayer.js +8 -2
- package/src/scene/createSceneNode.js +5 -1
- package/src/scene/emptyEvents.js +5 -0
- package/src/scene/failAttachment.js +9 -3
- package/src/scene/get3DEvents.js +7 -3
- package/src/scene/getLocation.js +8 -4
- package/src/scene/init3D.js +6 -3
- package/src/scene/initializeLayer.js +9 -2
- package/src/scene/initializerFor.js +8 -0
- package/src/scene/isNativeLayer.js +8 -2
- package/src/scene/layerInitialize.js +7 -4
- package/src/scene/onAdd3DLayer.js +6 -4
- package/src/scene/onMapChange.js +0 -5
- package/src/scene/onRemove3DLayer.js +6 -5
- package/src/scene/ready3D.js +9 -3
- package/src/scene/releaseSharedScene.js +6 -2
- package/src/scene/removeLayerEvents.js +1 -3
- package/src/scene/removeSceneLayer.js +9 -3
- package/src/scene/renderPendingMapChange.js +1 -4
- package/src/scene/renderPendingUpdates.js +5 -4
- package/src/scene/reportLayerError.js +6 -0
- package/src/scene/resolveNextInitialization.js +5 -2
- package/src/scene/restoreObject.js +6 -3
- package/src/scene/scheduleSceneUpdate.js +7 -6
- package/src/scene/setParent.js +6 -2
- package/src/scene/traverse.js +7 -2
- package/src/shaders/README.md +29 -0
- package/src/shaders/materialBaseShader.js +9 -0
- package/src/shaders/materialShaders.js +9 -1
- package/src/shaders/materialSurfaceShader.js +13 -0
- package/src/shaders/materialVertexShader.js +22 -10
- package/src/shaders/nativeStrokeShader.js +7 -0
- package/src/shaders/roofVertexShader.js +7 -0
- package/src/shadows/README.md +28 -0
- package/src/shadows/bindSunlight.js +5 -3
- package/src/shadows/drawShadowMeshes.js +7 -2
- package/src/shadows/ensureShadowPipeline.js +7 -0
- package/src/shadows/renderSunlight.js +8 -4
- package/src/shadows/resizeSunlight.js +6 -3
- package/src/shadows/shadowCacheMatches.js +11 -1
- package/src/shadows/shadowMatrix.js +8 -1
- package/src/shadows/shadowMeshMatches.js +8 -0
- package/src/sources/README.md +33 -0
- package/src/sources/attachAreaMesh.js +5 -4
- package/src/sources/buildArea.js +13 -2
- package/src/sources/buildAreaFeature.js +7 -1
- package/src/sources/buildAreaFeatures.js +9 -0
- package/src/sources/compareAreaDistance.js +8 -0
- package/src/sources/extrusionStyle.js +11 -0
- package/src/sources/featureAnchor.js +12 -0
- package/src/sources/groundOffset.js +7 -0
- package/src/sources/initVectorTiles.js +6 -0
- package/src/sources/initializeGeoJSON.js +6 -3
- package/src/sources/isVectorTileSource.js +7 -0
- package/src/sources/matchesAreaTile.js +10 -0
- package/src/sources/pendingSourceAreas.js +9 -2
- package/src/sources/prepareAreaGeometryJob.js +10 -0
- package/src/sources/projectAreaPolygons.js +10 -0
- package/src/sources/pumpSourceAreas.js +6 -6
- package/src/sources/readyVectorTiles.js +7 -0
- package/src/sources/releaseArea.js +6 -4
- package/src/sources/setGeoJSONData.js +8 -3
- package/src/sources/setGeoJSONLayerData.js +7 -0
- package/src/sources/sourceAreaContext.js +9 -2
- package/src/sources/updateArea.js +5 -5
- package/src/sources/updateSourceStatus.js +6 -3
- package/src/sunlight/README.md +28 -0
- package/src/sunlight/addTimeControlToMap.js +8 -1
- package/src/sunlight/addTimeLayer.js +9 -4
- package/src/sunlight/atmosphere.js +9 -2
- package/src/sunlight/createSun.js +7 -0
- package/src/sunlight/initSunlight.js +5 -0
- package/src/sunlight/initializeTimeControl.js +8 -6
- package/src/sunlight/onAddSun.js +11 -2
- package/src/sunlight/onAddTimeControl.js +7 -0
- package/src/sunlight/onRemoveSun.js +1 -1
- package/src/sunlight/removeSun.js +7 -5
- package/src/sunlight/removeTimeControl.js +7 -1
- package/src/sunlight/removeTimeLayer.js +8 -5
- package/src/sunlight/requestSunlightRender.js +6 -3
- package/src/sunlight/styleTimeControl.js +6 -0
- package/src/sunlight/tickSun.js +5 -0
- package/src/sunlight/updateCelestialDisc.js +11 -0
- package/src/sunlight/updateSky.js +5 -3
- package/src/sunlight/updateSun.js +6 -4
- package/src/sunlight/useLiveTime.js +5 -0
- package/src/sunlight/useSelectedTime.js +6 -4
- package/src/terrain/README.md +30 -0
- package/src/terrain/applyTerrain.js +10 -4
- package/src/terrain/clearLayerTerrain.js +5 -3
- package/src/terrain/copyTerrainTile.js +8 -0
- package/src/terrain/getElevation.js +8 -5
- package/src/terrain/initTerrain.js +5 -3
- package/src/terrain/loadReadyTerrain.js +1 -0
- package/src/terrain/loadTerrain.js +10 -2
- package/src/terrain/loadTerrainTiles.js +10 -3
- package/src/terrain/mapElevationOf.js +8 -0
- package/src/terrain/onTerrainAdd.js +8 -4
- package/src/terrain/onTerrainChange.js +5 -5
- package/src/terrain/onTerrainRemove.js +6 -3
- package/src/terrain/readBridges.js +9 -0
- package/src/terrain/readyTerrainOf.js +7 -0
- package/src/terrain/sampleTerrainTile.js +9 -0
- package/src/terrain/setLayerTerrain.js +5 -3
- package/src/terrain/setTerrainHeight.js +5 -4
- package/src/terrain/terrainAtlas.js +8 -2
- package/src/terrain/terrainElevation.js +8 -2
- package/src/terrain/terrainTileQueue.js +10 -3
- package/src/textures/README.md +29 -0
- package/src/textures/addImageState.js +7 -2
- package/src/textures/attachRasterImage.js +1 -2
- package/src/textures/bindMeshTextures.js +7 -0
- package/src/textures/collectRoofTiles.js +9 -2
- package/src/textures/compareRoofTiles.js +8 -0
- package/src/textures/composeRoofAtlas.js +11 -3
- package/src/textures/destroyTexture.js +6 -4
- package/src/textures/destroyTextureAfterSubmission.js +9 -0
- package/src/textures/ensureRoofBlit.js +5 -0
- package/src/textures/loadModelImage.js +12 -2
- package/src/textures/modelTextureFor.js +12 -4
- package/src/textures/modelTextureSampler.js +7 -2
- package/src/textures/nativeImageError.js +5 -1
- package/src/textures/nativeImageRefresh.js +5 -2
- package/src/textures/nativeTextureFor.js +11 -3
- package/src/textures/prepareMeshTextures.js +8 -0
- package/src/textures/rebuildRoofAtlas.js +8 -3
- package/src/textures/removeImageState.js +8 -3
- package/src/textures/resizeRoofTexture.js +9 -2
- package/src/textures/restoreMaterialTextures.js +6 -0
- package/src/textures/textureBinding.js +9 -0
- package/src/textures/updateRoofAtlas.js +10 -4
- package/src/textures/updateRoofRaster.js +8 -0
- package/src/textures/uploadCanvasTexture.js +15 -0
- package/src/textures/uploadMeshTexture.js +6 -0
- package/src/textures/uploadNativeImage.js +13 -0
- package/src/textures/uploadRoofTile.js +6 -0
- package/src/traffic/README.md +30 -0
- package/src/traffic/addTraffic.js +5 -2
- package/src/traffic/clockMinutes.js +7 -0
- package/src/traffic/compareDepartures.js +8 -0
- package/src/traffic/createTrafficMesh.js +13 -2
- package/src/traffic/destroyTrafficGpu.js +5 -0
- package/src/traffic/disposeTrafficObject.js +13 -10
- package/src/traffic/drawTrafficRoute.js +5 -1
- package/src/traffic/failTraffic.js +6 -0
- package/src/traffic/failedTrafficLoad.js +10 -3
- package/src/traffic/featuresToTrafficLanes.js +8 -0
- package/src/traffic/fetchTrafficLanes.js +11 -0
- package/src/traffic/groundTraffic.js +5 -1
- package/src/traffic/initTraffic.js +17 -15
- package/src/traffic/loadTraffic.js +5 -0
- package/src/traffic/loadedTrafficLanes.js +11 -4
- package/src/traffic/locateTraffic.js +9 -0
- package/src/traffic/moveTraffic.js +6 -0
- package/src/traffic/placeTraffic.js +5 -0
- package/src/traffic/prepareTraffic.js +5 -3
- package/src/traffic/readyTraffic.js +7 -2
- package/src/traffic/rebaseTraffic.js +5 -3
- package/src/traffic/rebuildTrafficMesh.js +5 -1
- package/src/traffic/refreshTrafficTrips.js +10 -0
- package/src/traffic/removeTraffic.js +5 -2
- package/src/traffic/routeColor.js +7 -0
- package/src/traffic/scheduledTrips.js +5 -2
- package/src/traffic/startTraffic.js +7 -2
- package/src/traffic/tickTraffic.js +5 -3
- package/src/traffic/trafficBounds.js +5 -0
- package/src/traffic/trafficNow.js +9 -4
- package/src/traffic/trafficStatusText.js +8 -0
- package/src/traffic/trafficStorage.js +8 -0
- package/src/traffic/trafficTooltip.js +7 -0
- package/src/traffic/tripsAt.js +9 -2
- package/src/traffic/updateTraffic.js +10 -7
- package/src/traffic/updateTrafficLights.js +5 -0
- package/src/traffic/updateTrafficPose.js +7 -0
- package/src/traffic/updateTrafficTerrain.js +10 -5
- package/src/traffic/uploadTrafficLanes.js +6 -0
- package/src/traffic/vehicleOffsets.js +9 -3
- package/src/transforms/README.md +27 -0
- package/src/transforms/composeLocalTransform.js +7 -0
- package/src/transforms/modelNodeMatrix.js +7 -2
- package/src/transforms/transformNativePoint.js +12 -0
- package/src/transforms/updateWorldMatrix.js +5 -2
- package/src/transforms/worldMatrixChanged.js +8 -0
- package/src/triangulation/README.md +26 -0
- package/src/triangulation/area.js +7 -0
- package/src/triangulation/clean.js +9 -0
- package/src/triangulation/clipEars.js +9 -0
- package/src/triangulation/connectHole.js +12 -0
- package/src/triangulation/containsVertex.js +10 -0
- package/src/triangulation/cross.js +9 -0
- package/src/triangulation/crossesBoundary.js +10 -0
- package/src/triangulation/crossesRing.js +9 -0
- package/src/triangulation/equal.js +8 -0
- package/src/triangulation/inside.js +8 -0
- package/src/triangulation/insideHole.js +8 -0
- package/src/triangulation/intersects.js +10 -0
- package/src/triangulation/isClockWise.js +4 -1
- package/src/triangulation/mergeHoles.js +8 -0
- package/src/triangulation/minimumX.js +7 -0
- package/src/triangulation/on.js +9 -0
- package/src/triangulation/polygonRings.js +8 -0
- package/src/triangulation/sortHoles.js +7 -0
- package/src/triangulation/triangulate.js +3 -2
- package/src/triangulation/validateArea.js +9 -0
- package/src/utils/README.md +16 -0
- package/src/utils/compareDistance.js +8 -0
- package/src/utils/noOperation.js +1 -0
- package/src/utils/wrap.js +7 -0
- package/src/utils/yieldTask.js +7 -0
- package/src/vector-style/README.md +27 -0
- package/src/vector-style/appendQuotedStyleCharacter.js +8 -0
- package/src/vector-style/arrayContainsRange.js +10 -0
- package/src/vector-style/evaluateBoolean.js +13 -0
- package/src/vector-style/evaluateCoalesceOrCase.js +13 -0
- package/src/vector-style/evaluateComparison.js +13 -0
- package/src/vector-style/evaluateIExpression.js +13 -0
- package/src/vector-style/evaluateInput.js +10 -0
- package/src/vector-style/evaluateInterpolate.js +9 -0
- package/src/vector-style/evaluateMatch.js +9 -0
- package/src/vector-style/evaluateMath.js +12 -0
- package/src/vector-style/evaluateMembership.js +11 -0
- package/src/vector-style/evaluateNegation.js +13 -0
- package/src/vector-style/evaluatePrimitive.js +12 -0
- package/src/vector-style/evaluateStep.js +9 -0
- package/src/vector-style/evaluateStyle.js +10 -0
- package/src/vector-style/evaluateToExpression.js +13 -0
- package/src/vector-style/fillVectorPaint.js +9 -0
- package/src/vector-style/lineVectorPaint.js +10 -0
- package/src/vector-style/parseFunctionalColor.js +9 -0
- package/src/vector-style/parseHexColor.js +7 -0
- package/src/vector-style/parseVectorStyle.js +7 -0
- package/src/vector-style/readPaintValue.js +11 -0
- package/src/vector-style/removeTrailingCommas.js +7 -0
- package/src/vector-style/scaleDashArray.js +12 -0
- package/src/vector-style/skipStyleComment.js +11 -0
- package/src/vector-style/stripStyleComments.js +7 -0
- package/src/vector-style/styleColor.js +7 -0
- package/src/vector-style/validateVectorLayers.js +8 -0
- package/src/vector-style/vectorPaint.js +9 -0
- package/src/vector-style/visibleStyle.js +9 -0
- package/src/vector-tiles/README.md +30 -0
- package/src/vector-tiles/appendVectorBatch.js +12 -0
- package/src/vector-tiles/attachVectorTileBatch.js +8 -0
- package/src/vector-tiles/attachVectorTileBatches.js +11 -0
- package/src/vector-tiles/compareVectorLabelPriority.js +8 -0
- package/src/vector-tiles/compareVectorTileDistance.js +8 -0
- package/src/vector-tiles/configureVectorTileLayer.js +8 -0
- package/src/vector-tiles/createVectorLabel.js +15 -0
- package/src/vector-tiles/forwardVectorTileError.js +5 -0
- package/src/vector-tiles/loadVectorSprite.js +9 -0
- package/src/vector-tiles/loadVectorTile.js +9 -0
- package/src/vector-tiles/onVectorTileAdd.js +5 -0
- package/src/vector-tiles/onVectorTileMessage.js +5 -0
- package/src/vector-tiles/onVectorTileRemove.js +5 -0
- package/src/vector-tiles/onVectorTileWorkerError.js +5 -0
- package/src/vector-tiles/paintVectorTileBatch.js +6 -0
- package/src/vector-tiles/prepareVectorLabel.js +9 -0
- package/src/vector-tiles/prepareVectorStyleLayer.js +8 -0
- package/src/vector-tiles/prepareVectorTile.js +13 -0
- package/src/vector-tiles/projectVectorPaths.js +10 -0
- package/src/vector-tiles/projectVectorPoint.js +9 -0
- package/src/vector-tiles/projectVectorTriangles.js +10 -0
- package/src/vector-tiles/pruneVectorTiles.js +3 -0
- package/src/vector-tiles/pumpVectorTiles.js +3 -0
- package/src/vector-tiles/readTileJSON.js +10 -0
- package/src/vector-tiles/readVectorStyle.js +11 -0
- package/src/vector-tiles/refreshVectorTiles.js +3 -0
- package/src/vector-tiles/reserveVectorLabelCells.js +8 -0
- package/src/vector-tiles/retireVectorTileGroup.js +7 -0
- package/src/vector-tiles/revokeVectorWorkerUrl.js +5 -0
- package/src/vector-tiles/rotateVectorLabel.js +7 -0
- package/src/vector-tiles/rotateVectorLabels.js +3 -0
- package/src/vector-tiles/simplifyVectorPath.js +8 -0
- package/src/vector-tiles/updateVectorLabelMarker.js +9 -0
- package/src/vector-tiles/updateVectorLabelStyle.js +6 -0
- package/src/vector-tiles/updateVectorTileLabels.js +5 -0
- package/src/vector-tiles/updateVectorTilePaint.js +5 -0
- package/src/vector-tiles/updateVectorTiles.js +3 -0
- package/src/vector-tiles/validateVectorTileZooms.js +9 -0
- package/src/vector-tiles/vectorFeaturePaint.js +10 -0
- package/src/vector-tiles/vectorFeaturePaths.js +10 -0
- package/src/vector-tiles/vectorFeatureZoom.js +10 -0
- package/src/vector-tiles/vectorLabelAnchors.js +8 -1
- package/src/vector-tiles/vectorLabelCandidates.js +7 -0
- package/src/vector-tiles/vectorLabelCells.js +9 -0
- package/src/vector-tiles/vectorLabelIcon.js +8 -0
- package/src/vector-tiles/vectorLabelProperty.js +9 -0
- package/src/vector-tiles/vectorLabelText.js +9 -0
- package/src/vector-tiles/vectorSpriteIcon.js +8 -0
- package/src/vector-tiles/vectorStraightRun.js +10 -1
- package/src/vector-tiles/vectorStyleDependencies.js +7 -0
- package/src/vector-tiles/vectorStyleValue.js +11 -0
- package/src/vector-tiles/vectorStyleZoom.js +7 -1
- package/src/vector-tiles/vectorTileAwaited.js +8 -0
- package/src/vector-tiles/vectorTileOverlaps.js +8 -0
- package/src/vector-tiles/vectorTilePaint.js +8 -0
- package/src/vector-tiles/vectorTileSettings.js +10 -0
- package/src/vector-tiles/vectorTilesIdle.js +8 -0
- package/src/vector-tiles/vectorTolerance.js +8 -1
- package/src/vector-tiles/wrapVectorLabel.js +7 -1
- package/src/vehicles/README.md +27 -0
- package/src/vehicles/bicycleModel.js +7 -1
- package/src/vehicles/boatBenches.js +5 -0
- package/src/vehicles/boatModel.js +8 -8
- package/src/vehicles/buildCarriage.js +9 -1
- package/src/vehicles/busModel.js +11 -3
- package/src/vehicles/carModel.js +12 -11
- package/src/vehicles/metroModel.js +8 -0
- package/src/vehicles/mirrorVehiclePart.js +11 -0
- package/src/vehicles/pedestrianModel.js +7 -1
- package/src/vehicles/tramModel.js +8 -0
- package/src/walk/README.md +30 -0
- package/src/walk/animateWalker.js +5 -4
- package/src/walk/createWalk.js +6 -3
- package/src/walk/initWalk.js +5 -0
- package/src/walk/initializeWalkControl.js +6 -1
- package/src/walk/isWalkBlocked.js +9 -0
- package/src/walk/landWalker.js +12 -8
- package/src/walk/moveWalker.js +17 -4
- package/src/walk/onAddWalkControl.js +9 -0
- package/src/walk/onRemoveWalkControl.js +5 -0
- package/src/walk/onWalkBlur.js +1 -0
- package/src/walk/onWalkKey.js +5 -2
- package/src/walk/onWalkPointer.js +6 -0
- package/src/walk/onWalkTerrain.js +4 -3
- package/src/walk/placeWalker.js +1 -2
- package/src/walk/resolveWalkerPosition.js +5 -0
- package/src/walk/startWalking.js +1 -1
- package/src/walk/stepWalkerHeight.js +7 -0
- package/src/walk/stopWalking.js +1 -0
- package/src/walk/toggleWalking.js +5 -4
- package/src/walk/updateWalkerFrame.js +10 -0
- package/src/walk/updateWalkerView.js +9 -0
- package/src/weakmaps/README.md +33 -0
- package/src/weakmaps/addedByLayer.js +5 -0
- package/src/weakmaps/archiveHeaderByLayer.js +5 -0
- package/src/weakmaps/areasByLayer.js +5 -0
- package/src/weakmaps/boundsMethods.js +5 -0
- package/src/weakmaps/bridgeMeshByLayer.js +5 -0
- package/src/weakmaps/bridgesByLayer.js +5 -0
- package/src/weakmaps/cameraAnimationByMap.js +5 -0
- package/src/weakmaps/cameraBearingByMap.js +5 -0
- package/src/weakmaps/cameraByLayer.js +5 -0
- package/src/weakmaps/cameraDraggableByMap.js +5 -0
- package/src/weakmaps/cameraFields.js +5 -0
- package/src/weakmaps/cameraFrameByMap.js +5 -0
- package/src/weakmaps/cameraHandlersByMap.js +5 -0
- package/src/weakmaps/cameraMaps.js +5 -0
- package/src/weakmaps/cameraPitchByMap.js +5 -0
- package/src/weakmaps/cameraReadyByMap.js +5 -0
- package/src/weakmaps/cameraTouchStateByMap.js +5 -0
- package/src/weakmaps/cameraViewByMap.js +5 -0
- package/src/weakmaps/cameraZIndexOffsetByLayer.js +5 -0
- package/src/weakmaps/closestMethods.js +5 -0
- package/src/weakmaps/colliders.js +5 -0
- package/src/weakmaps/containerByLayer.js +5 -0
- package/src/weakmaps/controlByLayer.js +5 -0
- package/src/weakmaps/countStatusByLayer.js +5 -0
- package/src/weakmaps/cursorByLayer.js +5 -0
- package/src/weakmaps/demByLayer.js +5 -0
- package/src/weakmaps/directoriesByLayer.js +5 -0
- package/src/weakmaps/dragByHandler.js +5 -0
- package/src/weakmaps/dragStates.js +5 -0
- package/src/weakmaps/etagByLayer.js +5 -0
- package/src/weakmaps/eventMapByLayer.js +5 -0
- package/src/weakmaps/eventsByLayer.js +5 -0
- package/src/weakmaps/fadeFrameByLayer.js +5 -0
- package/src/weakmaps/fadeVersionByLayer.js +5 -0
- package/src/weakmaps/frameByLayer.js +5 -0
- package/src/weakmaps/geojsonByLayer.js +5 -0
- package/src/weakmaps/geometryWorkersByMap.js +5 -0
- package/src/weakmaps/gridInitializers.js +5 -0
- package/src/weakmaps/groupByLayer.js +5 -0
- package/src/weakmaps/headerByLayer.js +5 -0
- package/src/weakmaps/highlightedFeatureByLayer.js +5 -0
- package/src/weakmaps/hoveredFeatureByLayer.js +5 -0
- package/src/weakmaps/imageStates.js +5 -0
- package/src/weakmaps/inflightByLayer.js +5 -0
- package/src/weakmaps/kindByLayer.js +5 -0
- package/src/weakmaps/layersByLayer.js +5 -0
- package/src/weakmaps/loadingTilesByLayer.js +5 -0
- package/src/weakmaps/locationByLayer.js +5 -0
- package/src/weakmaps/modelByLayer.js +5 -0
- package/src/weakmaps/modelUrlByLayer.js +5 -0
- package/src/weakmaps/nativeEventMaps.js +5 -0
- package/src/weakmaps/nativeGPUBackByMap.js +5 -0
- package/src/weakmaps/nativeGPUByLayer.js +5 -0
- package/src/weakmaps/nativeGPUOrderByMap.js +5 -0
- package/src/weakmaps/nativeProgramsByRenderer.js +5 -0
- package/src/weakmaps/nativeRenderByLayer.js +5 -0
- package/src/weakmaps/pathProjectionByMap.js +5 -0
- package/src/weakmaps/pitchSkyByMap.js +5 -0
- package/src/weakmaps/pointerEventsByLayer.js +5 -0
- package/src/weakmaps/pruneAfterByLayer.js +5 -0
- package/src/weakmaps/pruneVersionByLayer.js +5 -0
- package/src/weakmaps/pruneWantedByLayer.js +5 -0
- package/src/weakmaps/queuedByLayer.js +5 -0
- package/src/weakmaps/rasterGeometryByLayer.js +5 -0
- package/src/weakmaps/rasterProgramByLayer.js +5 -0
- package/src/weakmaps/rasterTilesByLayer.js +5 -0
- package/src/weakmaps/rasterVersionByLayer.js +5 -0
- package/src/weakmaps/raycasterByLayer.js +5 -0
- package/src/weakmaps/readyByLayer.js +5 -0
- package/src/weakmaps/rendererByLayer.js +5 -0
- package/src/weakmaps/rendererDevices.js +5 -0
- package/src/weakmaps/rendererReadyByLayer.js +5 -0
- package/src/weakmaps/renderers.js +5 -0
- package/src/weakmaps/roofRasterByLayer.js +5 -0
- package/src/weakmaps/roofRastersByLayer.js +5 -0
- package/src/weakmaps/rootByLayer.js +5 -0
- package/src/weakmaps/rotateControlByMap.js +5 -0
- package/src/weakmaps/sceneByLayer.js +5 -0
- package/src/weakmaps/sceneFields.js +5 -0
- package/src/weakmaps/sceneLayers.js +5 -0
- package/src/weakmaps/sceneOriginByLayer.js +5 -0
- package/src/weakmaps/shadowMeshesByLayer.js +5 -0
- package/src/weakmaps/sharedByLayer.js +5 -0
- package/src/weakmaps/sizeByLayer.js +5 -0
- package/src/weakmaps/state3dByLayer.js +5 -0
- package/src/weakmaps/streamTerrainByLayer.js +5 -0
- package/src/weakmaps/streamTerrainByMap.js +5 -0
- package/src/weakmaps/sunByMap.js +5 -0
- package/src/weakmaps/sunlightByControl.js +5 -0
- package/src/weakmaps/sunlightByMap.js +5 -0
- package/src/weakmaps/terrain3DByLayer.js +5 -0
- package/src/weakmaps/terrain3DByMap.js +5 -0
- package/src/weakmaps/terrainArchiveByLayer.js +5 -0
- package/src/weakmaps/terrainBaseYByLayer.js +5 -0
- package/src/weakmaps/terrainBoundsByLayer.js +5 -0
- package/src/weakmaps/terrainControllerByLayer.js +5 -0
- package/src/weakmaps/terrainGridsByLayer.js +5 -0
- package/src/weakmaps/terrainLoadingByLayer.js +5 -0
- package/src/weakmaps/terrainOriginElevationByLayer.js +5 -0
- package/src/weakmaps/terrainPromiseByLayer.js +5 -0
- package/src/weakmaps/terrainReadyByLayer.js +5 -0
- package/src/weakmaps/terrainRequestByLayer.js +5 -0
- package/src/weakmaps/terrainSourceByLayer.js +5 -0
- package/src/weakmaps/terrainTilesByLayer.js +5 -0
- package/src/weakmaps/terrainZoomByLayer.js +5 -0
- package/src/weakmaps/tileZoomByLayer.js +5 -0
- package/src/weakmaps/timeControlByMap.js +5 -0
- package/src/weakmaps/tooltipByLayer.js +5 -0
- package/src/weakmaps/touchByContainer.js +5 -0
- package/src/weakmaps/touchPitchByMap.js +5 -0
- package/src/weakmaps/touchRotateByMap.js +5 -0
- package/src/weakmaps/trafficByLayer.js +5 -0
- package/src/weakmaps/typeByLayer.js +5 -0
- package/src/weakmaps/urlByLayer.js +5 -0
- package/src/weakmaps/vectorTileOptionsByLayer.js +5 -0
- package/src/weakmaps/vectorWorkerByLayer.js +5 -0
- package/src/weakmaps/visibleMeshesByLayer.js +5 -0
- package/src/weakmaps/walkByMap.js +5 -0
- package/src/weakmaps/walkerByLayer.js +5 -0
- package/src/weakmaps/wantedRasterTilesByLayer.js +5 -0
- package/src/weakmaps/workerMapByLayer.js +5 -0
- package/src/weakmaps/zoomLevelByLayer.js +5 -0
- package/src/weakmaps/zoomTransitionsByLayer.js +5 -0
- package/src/weakmaps/zoomViewByLayer.js +5 -0
- package/src/workers/README.md +33 -0
- package/src/workers/acquireGeometryWorker.js +10 -0
- package/src/workers/buildAreaInWorker.js +8 -0
- package/src/workers/closeGeometryWorkers.js +5 -0
- package/src/workers/cogWorker.js +7 -0
- package/src/workers/createGeometryWorker.js +10 -0
- package/src/workers/geometryWorker.js +5 -0
- package/src/workers/getCogInWorker.js +11 -0
- package/src/workers/modelWorker.js +7 -0
- package/src/workers/openCogInWorker.js +8 -0
- package/src/workers/runSourceWorker.js +12 -0
- package/src/workers/settleGeometryWorker.js +6 -0
- package/src/workers/startGeometryWorker.js +7 -0
- package/src/workers/vectorTileWorker.js +5 -0
- package/src/collision/setTrafficNormal.js +0 -9
package/libs/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Example and compatibility helpers
|
|
2
|
+
|
|
3
|
+
[Project README](../README.md) | [Examples](../examples/) | [Build guide](../build/README.md)
|
|
4
|
+
|
|
5
|
+
```mermaid
|
|
6
|
+
flowchart LR
|
|
7
|
+
Loader["Demo loader"] --> Leaflet["Leaflet"]
|
|
8
|
+
Loader --> OL["OpenLayers + compatibility bindings"]
|
|
9
|
+
Leaflet --> Plugin["City Mapper"]
|
|
10
|
+
OL --> Plugin
|
|
11
|
+
Plugin --> Lens["Optional raster lens control"]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
[leaflet.js](./leaflet.js) is a demo loader, not required by applications.
|
|
15
|
+
[openlayers-bindings.js](./openlayers-bindings.js) supplies Leaflet-compatible
|
|
16
|
+
classes backed by OpenLayers; its minified bundle is generated by
|
|
17
|
+
[build.js](../build/build.js). [leaflet-lens.js](./leaflet-lens.js) adds an
|
|
18
|
+
optional control for comparing two raster layers.
|
package/libs/leaflet.js
CHANGED
|
@@ -11,7 +11,7 @@ const openlayers = new URLSearchParams(location.search).get('engine') === 'openl
|
|
|
11
11
|
document.write((openlayers
|
|
12
12
|
? '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol@10.6.1/ol.css">' +
|
|
13
13
|
'<script src="https://cdn.jsdelivr.net/npm/ol@10.6.1/dist/ol.js"><\/script>' +
|
|
14
|
-
'<script src="https://unpkg.com/leaflet-city-mapper@0.0
|
|
14
|
+
'<script src="https://unpkg.com/leaflet-city-mapper@0.1.0/libs/openlayers-bindings.min.js"><\/script>'
|
|
15
15
|
: '<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9/dist/leaflet.css"><script src="https://unpkg.com/leaflet@1.9/dist/leaflet-src.js"><\/script>'));
|
|
16
16
|
|
|
17
17
|
const engineStyle = document.createElement('style');
|
package/package.json
CHANGED
package/src/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Source guide
|
|
2
|
+
|
|
3
|
+
[Project README](../README.md) | [Entry point](./index.js)
|
|
4
|
+
|
|
5
|
+
Internal architecture and contributor navigation. For the public API, see the
|
|
6
|
+
[project README](../README.md).
|
|
7
|
+
|
|
8
|
+
## From a layer to a frame
|
|
9
|
+
|
|
10
|
+
```mermaid
|
|
11
|
+
sequenceDiagram
|
|
12
|
+
participant App
|
|
13
|
+
participant Layer as L.Layer / scene
|
|
14
|
+
participant Source as Source loader
|
|
15
|
+
participant Worker
|
|
16
|
+
participant Frame as Shared renderer
|
|
17
|
+
App->>Layer: new L.Layer({source})
|
|
18
|
+
App->>Layer: addTo(map)
|
|
19
|
+
Layer->>Frame: attach root / create renderer
|
|
20
|
+
Layer->>Source: request visible data
|
|
21
|
+
Source->>Worker: decode or assemble (where applicable)
|
|
22
|
+
Worker-->>Source: prepared data
|
|
23
|
+
Source->>Layer: attach result and schedule update
|
|
24
|
+
Layer->>Frame: render next frame
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Not every source uses this exact worker path: vector tiles have their own
|
|
28
|
+
loading and presentation lifecycle, and a native Leaflet layer is synchronized
|
|
29
|
+
through [native](./native/README.md). See [scene](./scene/README.md) for source
|
|
30
|
+
routing, shared ownership and removal.
|
|
31
|
+
|
|
32
|
+
## Ownership and debugging
|
|
33
|
+
|
|
34
|
+
[weakmaps](./weakmaps/README.md) holds per-object state;
|
|
35
|
+
[globals](./globals/README.md) also contains shared scratch buffers and queues.
|
|
36
|
+
On source failures, inspect the layer's `error` and `progress` events.
|
|
37
|
+
|
|
38
|
+
## Where to start a change
|
|
39
|
+
|
|
40
|
+
| Change | Follow the code | Existing scenarios |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| Source routing or scene ownership | [scene](./scene/README.md) → relevant source guide → [workers](./workers/README.md) | [scene](../test/features/scene.feature), [workers](../test/features/workers.feature) |
|
|
43
|
+
| GeoJSON extrusions or feature hits | [sources](./sources/README.md) → [geometry](./geometry/README.md) → [picking](./picking/README.md) | [geojson](../test/features/geojson.feature), [picking](../test/features/picking.feature) |
|
|
44
|
+
| Tile formats or terrain | [archives](./archives/README.md) / [cog](./cog/README.md) → [raster](./raster/README.md) / [terrain](./terrain/README.md) | [pmtiles](../test/features/pmtiles.feature), [cog](../test/features/cog.feature), [terrain](../test/features/terrain.feature) |
|
|
45
|
+
| Vector tile styles and labels | [mvt](./mvt/README.md) → [vector-style](./vector-style/README.md) → [vector-tiles](./vector-tiles/README.md) | [vector tiles](../test/features/vector-tiles.feature), [unit cases](../test/features/vector-tile-unit.feature) |
|
|
46
|
+
| Camera or walking | [camera](./camera/README.md) / [controls](./controls/README.md) → [walk](./walk/README.md) / [collision](./collision/README.md) | [camera](../test/features/camera.feature), [walk](../test/features/walk.feature) |
|
|
47
|
+
| GPU drawing or lighting | [rendering](./rendering/README.md) → [materials](./materials/README.md) / [shaders](./shaders/README.md) → [lighting](./lighting/README.md) / [shadows](./shadows/README.md) | [webgpu](../test/features/webgpu.feature), [night lights](../test/features/night-lights.feature), [sunlight](../test/features/sunlight.feature) |
|
|
48
|
+
|
|
49
|
+
The [build guide](../README.md#build-guide) explains the normal build and test
|
|
50
|
+
commands. The test runner builds and runs Cucumber with both Leaflet versions;
|
|
51
|
+
the feature files above are useful starting points for finding behavior and
|
|
52
|
+
regressions specific to a change.
|
|
53
|
+
|
|
54
|
+
## Subsystem map
|
|
55
|
+
|
|
56
|
+
This diagram is an overview, not an exhaustive dependency graph.
|
|
57
|
+
|
|
58
|
+
```mermaid
|
|
59
|
+
flowchart LR
|
|
60
|
+
Leaflet["Leaflet layer"] --> Scene["scene: source routing"]
|
|
61
|
+
Scene --> Sources["sources / vector-tiles"]
|
|
62
|
+
Scene --> Raster["raster / terrain"]
|
|
63
|
+
Sources --> Workers["workers: decoding and geometry"]
|
|
64
|
+
Raster --> Archives["archives / cog"]
|
|
65
|
+
Workers --> Geometry["geometry / models"]
|
|
66
|
+
Geometry --> Render["rendering / GPU"]
|
|
67
|
+
Raster --> Render
|
|
68
|
+
Native["native Leaflet layers"] --> Render
|
|
69
|
+
Camera["camera / controls"] --> Render
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Source layout
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
src/
|
|
76
|
+
index.js Public entry point and source registration
|
|
77
|
+
globals/ One shared constant or mutable cell per module
|
|
78
|
+
weakmaps/ One private WeakMap per map/layer state field
|
|
79
|
+
mvt/ PBF vector tile decoding and tessellation
|
|
80
|
+
vector-style/ Safe vector style parsing and expressions
|
|
81
|
+
vector-tiles/ Native vector tile lifecycle and worker preparation
|
|
82
|
+
camera/ Leaflet camera API and scene camera state
|
|
83
|
+
controls/ Compass, dragging, touch and resizing
|
|
84
|
+
core/ Leaflet hooks, camera-aware overlays and readiness
|
|
85
|
+
native/ Native Leaflet layers rendered through WebGPU
|
|
86
|
+
layer-controls/ Layer entry placement and progress indicators
|
|
87
|
+
scene/ Source routing, lifecycle and graph nodes
|
|
88
|
+
sources/ GeoJSON and streamed source loading and assembly
|
|
89
|
+
workers/ Geometry, MVT, COG and model tasks sharing one CDN-compatible worker
|
|
90
|
+
picking/ Raycasting, highlighting and feature interaction
|
|
91
|
+
rendering/ Frame stages, draw pipelines and mesh lifecycle
|
|
92
|
+
gpu/ Device initialization, renderer resources and diagnostics
|
|
93
|
+
materials/ Material programs, uniforms, glTF materials and cutouts
|
|
94
|
+
textures/ Image loading, texture upload/binding and roof atlases
|
|
95
|
+
animations/ Camera transitions, zoom synchronization and tile fading
|
|
96
|
+
shadows/ Directional shadow maps and cache
|
|
97
|
+
lighting/ Point lights and spatial light grids
|
|
98
|
+
shaders/ Material shader generation
|
|
99
|
+
geometry/ Mesh construction, bounds, grids, vectors and route geometry
|
|
100
|
+
projections/ Map, screen and local coordinate conversion
|
|
101
|
+
transforms/ Local/world matrices and glTF node transforms
|
|
102
|
+
triangulation/ Polygon triangulation and ring operations
|
|
103
|
+
collision/ Mesh intersection and collision queries
|
|
104
|
+
models/ glTF loading, decoding and scene assembly
|
|
105
|
+
archives/ PMTiles archive reading and decompression
|
|
106
|
+
cog/ Supported GeoTIFF directories, byte ranges and tile decoding
|
|
107
|
+
raster/ Raster tile loading, attachment and lifecycle
|
|
108
|
+
traffic/ Routes, scheduling, simulation, loading and rendering
|
|
109
|
+
vehicles/ Vehicle model geometry
|
|
110
|
+
terrain/ Terrain loading and sampling
|
|
111
|
+
astronomy/ Sun/moon position and observer/date validation
|
|
112
|
+
sunlight/ Sky, celestial display and time controls
|
|
113
|
+
walk/ First-person walking
|
|
114
|
+
colors/ Colour parsing, conversion, interpolation and formatting
|
|
115
|
+
utils/ Shared numeric and no-op helpers
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Layer lifecycle and data
|
|
119
|
+
|
|
120
|
+
- [scene](./scene/README.md): routing, attachment and shared scene lifecycle.
|
|
121
|
+
- [sources](./sources/README.md): GeoJSON and source area loading.
|
|
122
|
+
- [archives](./archives/README.md), [cog](./cog/README.md), [raster](./raster/README.md), [terrain](./terrain/README.md): archived data, raster imagery and elevation.
|
|
123
|
+
- [mvt](./mvt/README.md), [vector-style](./vector-style/README.md), [vector-tiles](./vector-tiles/README.md): vector tile decoding, styling and display.
|
|
124
|
+
- [models](./models/README.md), [workers](./workers/README.md): glTF loading and background jobs.
|
|
125
|
+
- [native](./native/README.md): GPU representation of native Leaflet layers.
|
|
126
|
+
|
|
127
|
+
## Rendering and geometry
|
|
128
|
+
|
|
129
|
+
- [gpu](./gpu/README.md), [rendering](./rendering/README.md), [materials](./materials/README.md), [shaders](./shaders/README.md), [textures](./textures/README.md): GPU resources and frame rendering.
|
|
130
|
+
- [geometry](./geometry/README.md), [triangulation](./triangulation/README.md), [transforms](./transforms/README.md), [projections](./projections/README.md): mesh construction and coordinate transformations.
|
|
131
|
+
- [lighting](./lighting/README.md), [shadows](./shadows/README.md), [colors](./colors/README.md): lighting, shadow maps and color conversion.
|
|
132
|
+
- [picking](./picking/README.md), [collision](./collision/README.md): interaction and collision queries.
|
|
133
|
+
|
|
134
|
+
## Map behavior
|
|
135
|
+
|
|
136
|
+
- [core](./core/README.md), [camera](./camera/README.md), [controls](./controls/README.md), [animations](./animations/README.md): Leaflet integration and camera interactions.
|
|
137
|
+
- [layer-controls](./layer-controls/README.md): layer control placement and status.
|
|
138
|
+
- [astronomy](./astronomy/README.md), [sunlight](./sunlight/README.md): celestial positions and time controls.
|
|
139
|
+
- [walk](./walk/README.md), [traffic](./traffic/README.md), [vehicles](./vehicles/README.md): walking, traffic simulation and model geometry.
|
|
140
|
+
|
|
141
|
+
## Shared state and helpers
|
|
142
|
+
|
|
143
|
+
- [globals](./globals/README.md): shared constants, descriptors and mutable cells.
|
|
144
|
+
- [weakmaps](./weakmaps/README.md): private state associated with maps, layers and other objects.
|
|
145
|
+
- [utils](./utils/README.md): small shared helpers.
|
|
146
|
+
|
|
147
|
+
Each source directory has a README; the source documentation test checks this
|
|
148
|
+
invariant for new directories as well.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Animations
|
|
2
|
+
|
|
3
|
+
[Source guide](../README.md) | [Project README](../../README.md)
|
|
4
|
+
|
|
5
|
+
Schedules camera transitions, zoom synchronization, marker panning and grid tile fades.
|
|
6
|
+
Shared queues allow multiple layers or maps to use the same animation frame.
|
|
7
|
+
|
|
8
|
+
## Timing and cancellation
|
|
9
|
+
|
|
10
|
+
```mermaid
|
|
11
|
+
flowchart LR
|
|
12
|
+
Camera["Camera target"] --> Cancel["Cancel previous animation"]
|
|
13
|
+
Cancel --> Motion{"Animate?"}
|
|
14
|
+
Motion -->|yes| Arc["Shortest bearing arc + frames"]
|
|
15
|
+
Motion -->|no / reduced motion| Direct["Apply target"]
|
|
16
|
+
Fade["Grid fade request"] --> Revision["Record layer revision"]
|
|
17
|
+
Revision --> Frame["Shared animation frame"]
|
|
18
|
+
Frame --> Current{"Revision current?"}
|
|
19
|
+
Current -->|yes| Opacity["Update tile opacity"]
|
|
20
|
+
Current -->|no| Ignore["Ignore stale entry"]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Zoom synchronization has its own intermediate view:
|
|
24
|
+
[synchronizeZoomView.js](./synchronizeZoomView.js).
|
|
25
|
+
|
|
26
|
+
- [mapAnimateCamera.js](./mapAnimateCamera.js): start a camera transition.
|
|
27
|
+
- [runGridFades.js](./runGridFades.js): advance queued tile fades only for current revisions.
|
|
28
|
+
- [synchronizeZoomView.js](./synchronizeZoomView.js): coordinate map zoom animations with the scene.
|
|
29
|
+
|
|
30
|
+
Related: [camera](../camera/README.md), [core](../core/README.md), [rendering](../rendering/README.md).
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { cameraAnimationByMap } from '../weakmaps/cameraAnimationByMap.js';
|
|
2
|
-
import { cameraFrameByMap } from '../weakmaps/cameraFrameByMap.js';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { cameraAnimationByMap } from '../weakmaps/cameraAnimationByMap.js';
|
|
2
|
+
import { cameraFrameByMap } from '../weakmaps/cameraFrameByMap.js';
|
|
3
|
+
import { cameraAnimations } from '../globals/cameraAnimations.js';
|
|
4
|
+
import { cameraAnimationFrame } from '../globals/cameraAnimationFrame.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Remove a map's camera animation and cancel the shared frame if no animations remain.
|
|
8
|
+
*
|
|
9
|
+
* @param {L.Map} map Map whose animation should stop.
|
|
10
|
+
*/
|
|
9
11
|
export function cancelCameraAnimation(map) {
|
|
10
12
|
cameraAnimations.delete(map);
|
|
11
13
|
cameraAnimationByMap.set(map, null);
|
|
@@ -14,4 +16,4 @@ export function cancelCameraAnimation(map) {
|
|
|
14
16
|
cancelAnimationFrame(cameraAnimationFrame.value);
|
|
15
17
|
cameraAnimationFrame.value = null;
|
|
16
18
|
}
|
|
17
|
-
}
|
|
19
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { fadeFrameByLayer } from '../weakmaps/fadeFrameByLayer.js';
|
|
2
|
-
|
|
3
2
|
import { pendingGridFades } from '../globals/pendingGridFades.js';
|
|
4
3
|
import { gridFadeFrame } from '../globals/gridFadeFrame.js';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Remove a layer's pending fade and cancel the shared frame if no fades remain.
|
|
7
|
+
*
|
|
8
|
+
* @param {L.GridLayer} layer Layer whose fade should stop.
|
|
9
|
+
*/
|
|
8
10
|
export function cancelGridFade(layer) {
|
|
9
11
|
pendingGridFades.delete(layer);
|
|
10
12
|
fadeFrameByLayer.set(layer, null);
|
|
@@ -2,15 +2,10 @@ import { zoomLevelByLayer } from '../weakmaps/zoomLevelByLayer.js';
|
|
|
2
2
|
import { zoomTransitionsByLayer } from '../weakmaps/zoomTransitionsByLayer.js';
|
|
3
3
|
import { zoomViewByLayer } from '../weakmaps/zoomViewByLayer.js';
|
|
4
4
|
import { cameraViewByMap } from '../weakmaps/cameraViewByMap.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
5
|
import { mapUpdateCameraOverlays } from '../camera/mapUpdateCameraOverlays.js';
|
|
9
|
-
|
|
10
6
|
import { update } from '../scene/scheduleSceneUpdate.js';
|
|
11
7
|
|
|
12
8
|
/** Stop using the outgoing level after zoomend; the next redraw uses current tiles. */
|
|
13
|
-
|
|
14
9
|
export function endZoom() {
|
|
15
10
|
const layer = this;
|
|
16
11
|
let animation;
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import { cameraAnimationByMap } from '../weakmaps/cameraAnimationByMap.js';
|
|
2
|
-
|
|
3
2
|
import { cameraEmptyOptions } from '../globals/cameraEmptyOptions.js';
|
|
4
3
|
import { mapSetPitchAndBearing } from '../camera/mapSetPitchAndBearing.js';
|
|
5
4
|
import { mapGetPitch } from '../camera/mapGetPitch.js';
|
|
6
5
|
import { mapGetBearing } from '../camera/mapGetBearing.js';
|
|
7
|
-
|
|
8
6
|
import { cancelCameraAnimation } from './cancelCameraAnimation.js';
|
|
9
7
|
import { scheduleCameraAnimation } from './scheduleCameraAnimation.js';
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Set camera angles immediately or animate toward them along the shortest bearing arc.
|
|
11
|
+
*
|
|
12
|
+
* @param {L.Map} map Map whose camera should move.
|
|
13
|
+
* @param {number} pitch Target pitch in degrees.
|
|
14
|
+
* @param {number} bearing Target bearing in degrees.
|
|
15
|
+
* @param {Object} [options] Animation settings, including duration in seconds.
|
|
16
|
+
*
|
|
17
|
+
* @returns {L.Map} The updated map.
|
|
18
|
+
*
|
|
19
|
+
* @throws {TypeError} If either camera angle is not finite.
|
|
20
|
+
* @throws {TypeError} If an animated duration is negative or not finite.
|
|
21
|
+
*/
|
|
12
22
|
export function mapAnimateCamera(map, pitch, bearing, options = cameraEmptyOptions) {
|
|
13
23
|
cancelCameraAnimation(map);
|
|
14
24
|
if (!Number.isFinite(pitch) || !Number.isFinite(bearing)) throw /* alloc */ new TypeError('Camera angles must be finite numbers');
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { cancelCameraAnimation } from './cancelCameraAnimation.js';
|
|
2
|
-
|
|
1
|
+
import { cancelCameraAnimation } from './cancelCameraAnimation.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stop the map's current pitch and bearing animation.
|
|
5
|
+
*
|
|
6
|
+
* @param {L.Map} map Map whose animation should stop.
|
|
7
|
+
*
|
|
8
|
+
* @returns {L.Map} The supplied map.
|
|
9
|
+
*/
|
|
3
10
|
export function mapStopPitchBearingAnimation(map) {
|
|
4
11
|
cancelCameraAnimation(map);
|
|
5
12
|
return map;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { zoomViewByLayer } from '../weakmaps/zoomViewByLayer.js';
|
|
2
|
-
|
|
3
2
|
import { pendingZoomAnimations } from '../globals/pendingZoomAnimations.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
import { render } from "../rendering/render.js";
|
|
7
|
-
|
|
8
4
|
import { renderPendingZoomAnimation } from './renderPendingZoomAnimation.js';
|
|
9
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Capture the initial and target zoom view, then queue a render for this layer.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} [event] Leaflet zoom event containing the target center and zoom.
|
|
10
|
+
*/
|
|
10
11
|
export function onZoomAnim(event) {
|
|
11
12
|
const map = this._map;
|
|
12
13
|
if (event && !zoomViewByLayer.get(this)) {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { rendererByLayer } from '../weakmaps/rendererByLayer.js';
|
|
2
2
|
import { sharedByLayer } from '../weakmaps/sharedByLayer.js';
|
|
3
|
-
|
|
4
3
|
import { pendingZoomAnimations } from '../globals/pendingZoomAnimations.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
4
|
import { render } from '../rendering/render.js';
|
|
9
5
|
|
|
6
|
+
/** Render the next queued zoom layer if it owns an initialized renderer. */
|
|
10
7
|
export function renderPendingZoomAnimation() {
|
|
11
8
|
const layer = pendingZoomAnimations.shift();
|
|
12
9
|
if (sharedByLayer.get(layer) === layer && rendererByLayer.get(layer)) render(layer);
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { cameraAnimationByMap } from '../weakmaps/cameraAnimationByMap.js';
|
|
2
2
|
import { cameraFrameByMap } from '../weakmaps/cameraFrameByMap.js';
|
|
3
|
-
|
|
4
3
|
import { cameraAnimationFrame } from '../globals/cameraAnimationFrame.js';
|
|
5
4
|
import { cameraAnimations } from '../globals/cameraAnimations.js';
|
|
6
|
-
|
|
7
5
|
import { mapSetPitchAndBearing } from '../camera/mapSetPitchAndBearing.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
6
|
import { scheduleCameraAnimation } from './scheduleCameraAnimation.js';
|
|
11
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Advance pending camera animations and reschedule those still active.
|
|
10
|
+
*
|
|
11
|
+
* @param {number} now Animation-frame timestamp in milliseconds.
|
|
12
|
+
*
|
|
13
|
+
* @throws {*} The first error caught while updating a camera.
|
|
14
|
+
*/
|
|
12
15
|
export function runCameraAnimations(now) {
|
|
13
16
|
cameraAnimationFrame.value = null;
|
|
14
17
|
const pending = /* alloc */ [...cameraAnimations];
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { fadeFrameByLayer } from '../weakmaps/fadeFrameByLayer.js';
|
|
2
|
-
|
|
3
2
|
import { gridFadeFrame } from '../globals/gridFadeFrame.js';
|
|
4
3
|
import { pendingGridFades } from '../globals/pendingGridFades.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
4
|
import { updateGridOpacity } from '../core/updateGridOpacity.js';
|
|
9
5
|
|
|
6
|
+
/** Advance queued grid fades whose scheduled versions are still current. */
|
|
10
7
|
export function runGridFades() {
|
|
11
8
|
gridFadeFrame.value = null;
|
|
12
9
|
const layers = /* alloc */ [...pendingGridFades];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { markerPanFrame } from '../globals/markerPanFrame.js';
|
|
2
2
|
import { pendingMarkerPan } from '../globals/pendingMarkerPan.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/** Apply the latest queued pan event for each marker drag. */
|
|
5
5
|
export function runMarkerPanFrame() {
|
|
6
6
|
markerPanFrame.value = null;
|
|
7
7
|
const pending = /* alloc */ [...pendingMarkerPan];
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { cameraFrameByMap } from '../weakmaps/cameraFrameByMap.js';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { cameraFrameByMap } from '../weakmaps/cameraFrameByMap.js';
|
|
2
|
+
import { cameraAnimations } from '../globals/cameraAnimations.js';
|
|
3
|
+
import { cameraAnimationFrame } from '../globals/cameraAnimationFrame.js';
|
|
4
|
+
import { runCameraAnimations } from './runCameraAnimations.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Queue a map's camera animation on the shared animation frame.
|
|
8
|
+
*
|
|
9
|
+
* @param {L.Map} map Map whose camera should animate.
|
|
10
|
+
* @param {Object} animation Camera animation state.
|
|
11
|
+
*/
|
|
10
12
|
export function scheduleCameraAnimation(map, animation) {
|
|
11
13
|
cameraAnimations.set(map, animation);
|
|
12
14
|
if (cameraAnimationFrame.value === null) cameraAnimationFrame.value = requestAnimationFrame(runCameraAnimations);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { fadeFrameByLayer } from '../weakmaps/fadeFrameByLayer.js';
|
|
2
2
|
import { fadeVersionByLayer } from '../weakmaps/fadeVersionByLayer.js';
|
|
3
|
-
|
|
4
3
|
import { pendingGridFades } from '../globals/pendingGridFades.js';
|
|
5
4
|
import { gridFadeFrame } from '../globals/gridFadeFrame.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
5
|
import { runGridFades } from './runGridFades.js';
|
|
10
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Queue the latest fade version for a layer on the shared animation frame.
|
|
9
|
+
*
|
|
10
|
+
* @param {L.GridLayer} layer Layer whose tiles should fade.
|
|
11
|
+
*/
|
|
11
12
|
export function scheduleGridFade(layer) {
|
|
12
13
|
fadeVersionByLayer.set(layer, (fadeVersionByLayer.get(layer) || 0) + 1);
|
|
13
14
|
pendingGridFades.set(layer, fadeVersionByLayer.get(layer));
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { pendingMarkerPan } from '../globals/pendingMarkerPan.js';
|
|
2
|
-
import { markerPanFrame } from '../globals/markerPanFrame.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { pendingMarkerPan } from '../globals/pendingMarkerPan.js';
|
|
2
|
+
import { markerPanFrame } from '../globals/markerPanFrame.js';
|
|
3
|
+
import { runMarkerPanFrame } from './runMarkerPanFrame.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Queue the latest marker drag event for the shared pan frame.
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} drag Leaflet marker drag handler.
|
|
9
|
+
* @param {Object} event Drag event passed to the pan adjustment.
|
|
10
|
+
*/
|
|
7
11
|
export function scheduleMarkerPan(drag, event) {
|
|
8
12
|
pendingMarkerPan.set(drag, event);
|
|
9
13
|
if (markerPanFrame.value === null) markerPanFrame.value = requestAnimationFrame(runMarkerPanFrame);
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { zoomTransitionsByLayer } from '../weakmaps/zoomTransitionsByLayer.js';
|
|
2
2
|
import { zoomViewByLayer } from '../weakmaps/zoomViewByLayer.js';
|
|
3
|
-
|
|
4
3
|
import { meshStack } from '../globals/meshStack.js';
|
|
5
4
|
import { updateZoomCamera } from './updateZoomCamera.js';
|
|
6
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Pause zoom transitions and advance them with the rendered camera frame.
|
|
8
|
+
*
|
|
9
|
+
* @param {L.Layer} layer Layer whose map zoom is being synchronized.
|
|
10
|
+
* @param {number} now Current frame timestamp in milliseconds.
|
|
11
|
+
*/
|
|
7
12
|
export function synchronizeZoomView(layer, now) {
|
|
8
13
|
const map = layer._map;
|
|
9
14
|
let animation, time, start;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { zoomTransitionsByLayer } from '../weakmaps/zoomTransitionsByLayer.js';
|
|
2
|
-
import { zoomViewByLayer } from '../weakmaps/zoomViewByLayer.js';
|
|
3
|
-
import { cameraViewByMap } from '../weakmaps/cameraViewByMap.js';
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { zoomTransitionsByLayer } from '../weakmaps/zoomTransitionsByLayer.js';
|
|
2
|
+
import { zoomViewByLayer } from '../weakmaps/zoomViewByLayer.js';
|
|
3
|
+
import { cameraViewByMap } from '../weakmaps/cameraViewByMap.js';
|
|
6
4
|
import { mapUpdateCameraOverlays } from '../camera/mapUpdateCameraOverlays.js';
|
|
7
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Interpolate the map's camera view from the current zoom transition.
|
|
8
|
+
*
|
|
9
|
+
* @param {L.Layer} layer Layer whose map view is being animated.
|
|
10
|
+
* @param {number} now Current frame timestamp in milliseconds.
|
|
11
|
+
*/
|
|
8
12
|
export function updateZoomCamera(layer, now) {
|
|
9
13
|
const map = layer._map;
|
|
10
14
|
const view = zoomViewByLayer.get(layer);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Archives
|
|
2
|
+
|
|
3
|
+
[Source guide](../README.md) | [Project README](../../README.md)
|
|
4
|
+
|
|
5
|
+
Reads PMTiles headers, directories and tile byte ranges, including decompression
|
|
6
|
+
and cached directory lookups.
|
|
7
|
+
|
|
8
|
+
## Tile lookup
|
|
9
|
+
|
|
10
|
+
```mermaid
|
|
11
|
+
flowchart LR
|
|
12
|
+
XYZ["XYZ request"] --> ID["Hilbert tile ID"]
|
|
13
|
+
ID --> Header["Cached header promise"]
|
|
14
|
+
Header --> Directory["Root / leaf directories"]
|
|
15
|
+
Directory --> Tile["Tile byte range + decompression"]
|
|
16
|
+
Directory -->|missing| Miss["No tile"]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
An external provider can implement `getHeader` and `getZxy`. Range reads
|
|
20
|
+
validate length and ETag; changed archives fail rather than mixing versions.
|
|
21
|
+
Traversal rejects cycles, invalid leaves and excessive nesting. For GeoJSON,
|
|
22
|
+
[loadSource.js](./loadSource.js) accepts inline data or a URL, but not both.
|
|
23
|
+
|
|
24
|
+
- [getHeader.js](./getHeader.js): obtain an archive header.
|
|
25
|
+
- [getZxy.js](./getZxy.js): look up a tile by zoom, column and row.
|
|
26
|
+
- [decodeDirectory.js](./decodeDirectory.js): decode directory entries.
|
|
27
|
+
|
|
28
|
+
Related: [cog](../cog/README.md), [sources](../sources/README.md), [raster](../raster/README.md).
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { directoryReader } from '../globals/directoryReader.js';
|
|
2
2
|
import { varint } from './readVarint.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Decode delta/varint directory columns, rejecting malformed entries.
|
|
6
|
+
*
|
|
7
|
+
* @param {ArrayBuffer} data Encoded PMTiles directory.
|
|
8
|
+
*
|
|
9
|
+
* @returns {Object[]} Decoded directory entries.
|
|
10
|
+
*
|
|
11
|
+
* @throws {Error} If the directory entry count is invalid.
|
|
12
|
+
* @throws {Error} If tile IDs are invalid or not increasing.
|
|
13
|
+
* @throws {Error} If an entry has zero length.
|
|
14
|
+
* @throws {Error} If the first entry has an implicit offset.
|
|
15
|
+
* @throws {Error} If data remains after the directory entries.
|
|
16
|
+
*/
|
|
6
17
|
export function decodeDirectory(data) {
|
|
7
18
|
const reader = directoryReader;
|
|
8
19
|
const bytes = /* alloc */ new Uint8Array(data);
|
|
@@ -2,8 +2,15 @@ import { headerOffsets } from '../globals/headerOffsets.js';
|
|
|
2
2
|
import { headerFlags } from '../globals/headerFlags.js';
|
|
3
3
|
import { headerBounds } from '../globals/headerBounds.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Decode the PMTiles v3 header.
|
|
7
|
+
*
|
|
8
|
+
* @param {ArrayBuffer} data Header bytes.
|
|
9
|
+
*
|
|
10
|
+
* @returns {Object} Archive offsets, flags, bounds and center.
|
|
11
|
+
*
|
|
12
|
+
* @throws {Error} If the header is too short or not PMTiles version 3.
|
|
13
|
+
*/
|
|
7
14
|
export function decodeHeader(data) {
|
|
8
15
|
const view = data.byteLength >= 127
|
|
9
16
|
? /* alloc */ new DataView(data) : null;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return uncompressed data or decompress gzip data.
|
|
3
|
+
*
|
|
4
|
+
* @param {ArrayBuffer} data Archive data.
|
|
5
|
+
* @param {number} compression PMTiles compression code.
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<ArrayBuffer>} Uncompressed bytes.
|
|
8
|
+
*
|
|
9
|
+
* @throws {Error} If the compression code is unsupported.
|
|
10
|
+
*/
|
|
1
11
|
export async function decompress(data, compression) {
|
|
2
12
|
if (compression === 1) return data;
|
|
3
13
|
if (compression !== 2) {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the last directory entry whose tile ID does not exceed the requested ID.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object[]} entries Entries sorted by tile ID.
|
|
5
|
+
* @param {number} id Requested tile ID.
|
|
6
|
+
*
|
|
7
|
+
* @returns {Object|undefined} Matching entry, if any.
|
|
8
|
+
*/
|
|
1
9
|
export function findDirectoryEntry(entries, id) {
|
|
2
10
|
let low = 0, high = entries.length - 1, mid;
|
|
3
11
|
while (low <= high) {
|
package/src/archives/findTile.js
CHANGED
|
@@ -2,6 +2,20 @@ import { getDirectoryEntries } from './getDirectoryEntries.js';
|
|
|
2
2
|
import { findDirectoryEntry } from './findDirectoryEntry.js';
|
|
3
3
|
import { getTileData } from './getTileData.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Follow root and leaf directories to find an archive tile.
|
|
7
|
+
*
|
|
8
|
+
* @param {L.Layer} layer Archive layer.
|
|
9
|
+
* @param {Object} header Decoded archive header.
|
|
10
|
+
* @param {number} id Cumulative Hilbert tile ID.
|
|
11
|
+
* @param {AbortSignal} [signal] Request cancellation signal.
|
|
12
|
+
*
|
|
13
|
+
* @returns {Promise<Object|undefined>} Tile data, or undefined if not found.
|
|
14
|
+
*
|
|
15
|
+
* @throws {Error} If directory offsets form a cycle.
|
|
16
|
+
* @throws {Error} If a leaf directory extends outside its section.
|
|
17
|
+
* @throws {Error} If directory nesting exceeds four levels.
|
|
18
|
+
*/
|
|
5
19
|
export async function findTile(layer, header, id, signal) {
|
|
6
20
|
let offset = header.rootDirectoryOffset, length = header.rootDirectoryLength;
|
|
7
21
|
let firstOffset = -1, secondOffset = -1, thirdOffset = -1;
|