leaflet-city-mapper 0.0.6 → 0.0.8
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 +11 -6
- package/cucumber.mjs +1 -3
- package/dist/leaflet-city-mapper-src.js +8574 -7879
- package/dist/leaflet-city-mapper-src.js.map +4 -4
- package/dist/leaflet-city-mapper-worker-src.js +2776 -0
- package/dist/leaflet-city-mapper-worker-src.js.map +4 -4
- package/dist/leaflet-city-mapper-worker.js +1 -1
- package/dist/leaflet-city-mapper-worker.js.map +4 -4
- package/dist/leaflet-city-mapper.js +5 -3
- package/dist/leaflet-city-mapper.js.map +4 -4
- package/libs/leaflet-lens.js +44 -27
- package/libs/leaflet.js +4 -4
- package/libs/openlayers-bindings.js +2 -1
- package/libs/openlayers-bindings.min.js +1 -1
- package/libs/openlayers-bindings.min.js.map +3 -3
- package/package.json +2 -2
- package/src/camera/mapCamera.js +7 -7
- package/src/camera/mapTryAnimatedPan.js +4 -4
- package/src/camera/setBearing.js +5 -0
- package/src/camera/setPitch.js +5 -0
- package/src/camera/updateMapCamera.js +8 -6
- package/src/cog/initCog.js +2 -2
- package/src/controls/cameraControls.js +27 -22
- package/src/core/cameraCircleBounds.js +2 -1
- package/src/core/closestCameraLayerPoint.js +2 -1
- package/src/core/constructLayer.js +9 -0
- package/src/core/extendLeafletClass.js +5 -0
- package/src/core/extendTerrainPixelBounds.js +31 -0
- package/src/core/gridlayerGetTiledPixelBounds.js +12 -4
- package/src/core/layerAddInitHook.js +7 -0
- package/src/core/layerCallInitHooks.js +13 -13
- package/src/core/layerMergeOptions.js +7 -0
- package/src/core/markerSetPos.js +1 -1
- package/src/core/popupGetEvents.js +1 -1
- package/src/core/popupUpdatePosition.js +8 -8
- package/src/core/projectNativePath.js +23 -0
- package/src/core/tooltipGetEvents.js +1 -1
- package/src/core/tooltipSetPosition.js +2 -2
- package/src/geometry/appendNativeTriangle.js +2 -2
- package/src/geometry/circleGeometry.js +4 -3
- package/src/geometry/createModelGeometry.js +2 -9
- package/src/geometry/dashedSegment.js +10 -5
- package/src/geometry/disk.js +1 -1
- package/src/geometry/fillNativePolygon.js +20 -0
- package/src/geometry/lineJoin.js +2 -2
- package/src/geometry/markerQuadCorners.js +6 -0
- package/src/geometry/nativeGeometry.js +1 -1
- package/src/geometry/polygon.js +4 -10
- package/src/geometry/segment.js +4 -3
- package/src/globals/colorTexture.js +6 -0
- package/src/globals/depthTexture.js +1 -0
- package/src/globals/drawMeshEntry.js +1 -1
- package/src/globals/layerControlAddItem.js +3 -0
- package/src/globals/leafletLayer.js +3 -0
- package/src/globals/meshPipeline.js +1 -0
- package/src/globals/mvtTextDecoder.js +1 -0
- package/src/globals/nativeScalableStyleKeys.js +1 -0
- package/src/globals/scenePass.js +1 -0
- package/src/globals/vectorStyleNamedColors.js +8 -0
- package/src/globals/vectorTileEvents.js +1 -0
- package/src/globals/workerCogSource.js +1 -0
- package/src/gpu/initializeRendererResources.js +10 -12
- package/src/gpu/mountRenderer.js +4 -11
- package/src/gpu/releaseRenderer.js +1 -0
- package/src/index.js +31 -22
- package/src/layer-controls/layerControlInputId.js +11 -0
- package/src/layer-controls/placeEntry.js +2 -0
- package/src/materials/createProgram.js +7 -6
- package/src/materials/createProgramUniforms.js +1 -0
- package/src/models/loadModel.js +6 -10
- package/src/models/loadModelResources.js +2 -8
- package/src/models/modelNode.js +3 -7
- package/src/models/prepareModel.js +19 -0
- package/src/models/prepareModelGeometry.js +25 -0
- package/src/models/prepareModelPrimitive.js +17 -0
- package/src/mvt/addMvtCrossings.js +17 -0
- package/src/mvt/appendMvtBandTriangles.js +31 -0
- package/src/mvt/appendMvtCoordinates.js +11 -0
- package/src/mvt/appendMvtPolygonTriangles.js +19 -0
- package/src/mvt/beginMvtPath.js +9 -0
- package/src/mvt/closeMvtPath.js +7 -0
- package/src/mvt/collectMvtEdges.js +19 -0
- package/src/mvt/createMvtReader.js +7 -0
- package/src/mvt/decodeVectorTile.js +32 -0
- package/src/mvt/expectMvtWire.js +3 -0
- package/src/mvt/finishMvtPath.js +5 -0
- package/src/mvt/finiteMvtCoordinate.js +7 -0
- package/src/mvt/groupMvtPolygons.js +25 -0
- package/src/mvt/isMvtFallbackError.js +6 -0
- package/src/mvt/mergeMvtActiveEdges.js +9 -0
- package/src/mvt/mvtEdgeX.js +4 -0
- package/src/mvt/mvtPathsVertices.js +8 -0
- package/src/mvt/mvtPolygonPaths.js +12 -0
- package/src/mvt/numericMvtValue.js +4 -0
- package/src/mvt/readMvtFeature.js +34 -0
- package/src/mvt/readMvtField.js +8 -0
- package/src/mvt/readMvtGeometry.js +29 -0
- package/src/mvt/readMvtInteger.js +12 -0
- package/src/mvt/readMvtKnownValue.js +21 -0
- package/src/mvt/readMvtLayer.js +31 -0
- package/src/mvt/readMvtMessage.js +10 -0
- package/src/mvt/readMvtNumber.js +9 -0
- package/src/mvt/readMvtNumbers.js +11 -0
- package/src/mvt/readMvtString.js +6 -0
- package/src/mvt/readMvtValue.js +19 -0
- package/src/mvt/skipMvtField.js +14 -0
- package/src/mvt/sortMvtActiveEdges.js +15 -0
- package/src/mvt/sortedMvtLevels.js +22 -0
- package/src/mvt/takeMvtBytes.js +8 -0
- package/src/mvt/tessellateVectorRings.js +19 -0
- package/src/mvt/triangulateVectorRings.js +19 -0
- package/src/native/beforeNativeRender.js +6 -0
- package/src/native/canScaleNativeStyle.js +17 -0
- package/src/native/createNativeMesh.js +31 -0
- package/src/native/disposeNativeLayer.js +1 -1
- package/src/native/getGridTerrainTile.js +34 -0
- package/src/native/gridTerrainElevation.js +26 -0
- package/src/native/loadGridTerrain.js +26 -0
- package/src/native/nativeLayer.js +2 -2
- package/src/native/nativeLayerMethod.js +5 -14
- package/src/native/nativeProgram.js +20 -0
- package/src/native/nativeTerrainElevation.js +16 -0
- package/src/native/nativeVectorGeometry.js +23 -0
- package/src/native/orderNativeGridLayer.js +14 -0
- package/src/native/prepareGridTerrainRequests.js +16 -0
- package/src/native/putNativeMesh.js +15 -21
- package/src/native/refreshNativeEvent.js +13 -2
- package/src/native/refreshNativeLayer.js +1 -0
- package/src/native/retainGridTerrain.js +10 -0
- package/src/native/syncGridLayer.js +17 -19
- package/src/native/syncGridTile.js +18 -0
- package/src/native/syncNativeStrokeAnchors.js +12 -0
- package/src/native/syncNativeStrokeZoom.js +29 -0
- package/src/native/syncTerrainGridTile.js +28 -0
- package/src/native/syncVectorLayer.js +15 -13
- package/src/native/terrainGridMesh.js +34 -0
- package/src/native/updateNativeStrokeRadius.js +9 -0
- package/src/projections/displayContainerPoint.js +23 -3
- package/src/projections/groundBounds.js +2 -2
- package/src/projections/localPixel.js +7 -2
- package/src/projections/localPixelForGeometry.js +4 -2
- package/src/projections/projectCameraPoint.js +6 -5
- package/src/rendering/collectVisibleMesh.js +5 -2
- package/src/rendering/drawGeometry.js +11 -11
- package/src/rendering/drawSceneMeshes.js +3 -1
- package/src/rendering/nativeStrokeExpansion.js +4 -0
- package/src/rendering/prepareMeshUniforms.js +2 -0
- package/src/rendering/resizeRenderer.js +20 -10
- package/src/scene/initializerFor.js +4 -5
- package/src/scene/layerInitialize.js +14 -12
- package/src/scene/resolveNextInitialization.js +1 -1
- package/src/shaders/materialShaders.js +1 -0
- package/src/shaders/materialVertexShader.js +7 -2
- package/src/shaders/nativeStrokeShader.js +6 -0
- package/src/shadows/drawShadowMeshes.js +6 -5
- package/src/sources/attachAreaMesh.js +5 -6
- package/src/sources/buildArea.js +4 -5
- package/src/sources/buildAreaFeature.js +3 -19
- package/src/sources/initVectorTiles.js +15 -0
- package/src/sources/isVectorTileSource.js +4 -0
- package/src/sources/pumpSourceAreas.js +1 -1
- package/src/sources/readyVectorTiles.js +10 -0
- package/src/sources/sourceAreaContext.js +1 -6
- package/src/sunlight/createSun.js +0 -1
- package/src/sunlight/initSunlight.js +19 -8
- package/src/terrain/initTerrain.js +7 -1
- package/src/terrain/loadTerrain.js +4 -1
- package/src/terrain/mapElevationOf.js +5 -1
- package/src/terrain/onTerrainAdd.js +11 -1
- package/src/terrain/onTerrainRemove.js +10 -1
- package/src/textures/nativeTextureFor.js +2 -3
- package/src/textures/uploadCanvasTexture.js +11 -2
- package/src/utils/yieldTask.js +5 -0
- package/src/vector-style/appendQuotedStyleCharacter.js +22 -0
- package/src/vector-style/arrayContainsRange.js +8 -0
- package/src/vector-style/evaluateBoolean.js +18 -0
- package/src/vector-style/evaluateCoalesceOrCase.js +21 -0
- package/src/vector-style/evaluateComparison.js +16 -0
- package/src/vector-style/evaluateIExpression.js +8 -0
- package/src/vector-style/evaluateInput.js +6 -0
- package/src/vector-style/evaluateInterpolate.js +27 -0
- package/src/vector-style/evaluateMatch.js +12 -0
- package/src/vector-style/evaluateMath.js +14 -0
- package/src/vector-style/evaluateMembership.js +18 -0
- package/src/vector-style/evaluateNegation.js +13 -0
- package/src/vector-style/evaluatePrimitive.js +9 -0
- package/src/vector-style/evaluateStep.js +11 -0
- package/src/vector-style/evaluateStyle.js +33 -0
- package/src/vector-style/evaluateToExpression.js +14 -0
- package/src/vector-style/fillVectorPaint.js +17 -0
- package/src/vector-style/lineVectorPaint.js +21 -0
- package/src/vector-style/parseFunctionalColor.js +14 -0
- package/src/vector-style/parseHexColor.js +13 -0
- package/src/vector-style/parseVectorStyle.js +13 -0
- package/src/vector-style/readPaintValue.js +6 -0
- package/src/vector-style/removeTrailingCommas.js +12 -0
- package/src/vector-style/scaleDashArray.js +13 -0
- package/src/vector-style/skipStyleComment.js +9 -0
- package/src/vector-style/stripStyleComments.js +21 -0
- package/src/vector-style/styleColor.js +11 -0
- package/src/vector-style/validateVectorLayers.js +10 -0
- package/src/vector-style/vectorPaint.js +8 -0
- package/src/vector-style/visibleStyle.js +7 -0
- package/src/vector-tiles/appendVectorBatch.js +22 -0
- package/src/vector-tiles/attachVectorTileBatch.js +17 -0
- package/src/vector-tiles/attachVectorTileBatches.js +15 -0
- package/src/vector-tiles/compareVectorLabelPriority.js +3 -0
- package/src/vector-tiles/compareVectorTileDistance.js +3 -0
- package/src/vector-tiles/configureVectorTileLayer.js +28 -0
- package/src/vector-tiles/createVectorLabel.js +22 -0
- package/src/vector-tiles/forwardVectorTileError.js +5 -0
- package/src/vector-tiles/loadVectorSprite.js +5 -0
- package/src/vector-tiles/loadVectorTile.js +36 -0
- package/src/vector-tiles/onVectorTileAdd.js +39 -0
- package/src/vector-tiles/onVectorTileMessage.js +10 -0
- package/src/vector-tiles/onVectorTileRemove.js +20 -0
- package/src/vector-tiles/onVectorTileWorkerError.js +11 -0
- package/src/vector-tiles/paintVectorTileBatch.js +12 -0
- package/src/vector-tiles/prepareVectorLabel.js +25 -0
- package/src/vector-tiles/prepareVectorStyleLayer.js +30 -0
- package/src/vector-tiles/prepareVectorTile.js +16 -0
- package/src/vector-tiles/projectVectorPaths.js +15 -0
- package/src/vector-tiles/projectVectorPoint.js +6 -0
- package/src/vector-tiles/projectVectorTriangles.js +18 -0
- package/src/vector-tiles/pruneVectorTiles.js +11 -0
- package/src/vector-tiles/pumpVectorTiles.js +18 -0
- package/src/vector-tiles/readTileJSON.js +17 -0
- package/src/vector-tiles/readVectorStyle.js +17 -0
- package/src/vector-tiles/refreshVectorTiles.js +5 -0
- package/src/vector-tiles/reserveVectorLabelCells.js +6 -0
- package/src/vector-tiles/retireVectorTileGroup.js +13 -0
- package/src/vector-tiles/revokeVectorWorkerUrl.js +9 -0
- package/src/vector-tiles/rotateVectorLabel.js +12 -0
- package/src/vector-tiles/rotateVectorLabels.js +6 -0
- package/src/vector-tiles/simplifyVectorPath.js +21 -0
- package/src/vector-tiles/updateVectorLabelMarker.js +27 -0
- package/src/vector-tiles/updateVectorLabelStyle.js +8 -0
- package/src/vector-tiles/updateVectorTileLabels.js +28 -0
- package/src/vector-tiles/updateVectorTilePaint.js +20 -0
- package/src/vector-tiles/updateVectorTiles.js +29 -0
- package/src/vector-tiles/validateVectorTileZooms.js +6 -0
- package/src/vector-tiles/vectorFeaturePaint.js +15 -0
- package/src/vector-tiles/vectorFeaturePaths.js +16 -0
- package/src/vector-tiles/vectorFeatureZoom.js +8 -0
- package/src/vector-tiles/vectorLabelAnchors.js +24 -0
- package/src/vector-tiles/vectorLabelCandidates.js +11 -0
- package/src/vector-tiles/vectorLabelCells.js +23 -0
- package/src/vector-tiles/vectorLabelIcon.js +30 -0
- package/src/vector-tiles/vectorLabelProperty.js +3 -0
- package/src/vector-tiles/vectorLabelText.js +10 -0
- package/src/vector-tiles/vectorSpriteIcon.js +11 -0
- package/src/vector-tiles/vectorStraightRun.js +14 -0
- package/src/vector-tiles/vectorStyleDependencies.js +15 -0
- package/src/vector-tiles/vectorStyleValue.js +5 -0
- package/src/vector-tiles/vectorStyleZoom.js +6 -0
- package/src/vector-tiles/vectorTileAwaited.js +9 -0
- package/src/vector-tiles/vectorTileOverlaps.js +4 -0
- package/src/vector-tiles/vectorTilePaint.js +10 -0
- package/src/vector-tiles/vectorTileSettings.js +17 -0
- package/src/vector-tiles/vectorTilesIdle.js +3 -0
- package/src/vector-tiles/vectorTolerance.js +4 -0
- package/src/vector-tiles/wrapVectorLabel.js +11 -0
- package/src/walk/initWalk.js +19 -6
- package/src/weakmaps/nativeProgramsByRenderer.js +1 -0
- package/src/weakmaps/pathProjectionByMap.js +1 -0
- package/src/weakmaps/streamTerrainByLayer.js +1 -0
- package/src/weakmaps/streamTerrainByMap.js +1 -0
- package/src/weakmaps/vectorTileOptionsByLayer.js +1 -0
- package/src/weakmaps/vectorWorkerByLayer.js +1 -0
- package/src/weakmaps/workerMapByLayer.js +1 -0
- package/src/workers/buildAreaInWorker.js +3 -27
- package/src/workers/cogWorker.js +20 -0
- package/src/workers/createGeometryWorker.js +1 -0
- package/src/workers/geometryWorker.js +15 -0
- package/src/workers/getCogInWorker.js +7 -0
- package/src/workers/modelWorker.js +10 -0
- package/src/workers/openCogInWorker.js +14 -0
- package/src/workers/runSourceWorker.js +32 -0
- package/src/workers/settleGeometryWorker.js +1 -1
- package/src/workers/vectorTileWorker.js +10 -0
- package/src/geometry/buildExtrudedPolygon.js +0 -10
- package/src/globals/layerCallInitHooks.js +0 -1
- package/src/sources/buildAreaPoint.js +0 -7
|
@@ -33,17 +33,19 @@ export function updateMapCamera(layer, size) {
|
|
|
33
33
|
const targetZ = (size.y / 2 - origin.y) / pixelsPerMeter;
|
|
34
34
|
const pitch = mapGetPitch(map) * radians;
|
|
35
35
|
const bearing = mapGetBearing(map) * radians;
|
|
36
|
+
const sinPitch = Math.sin(pitch), cosPitch = Math.cos(pitch);
|
|
37
|
+
const sinBearing = Math.sin(bearing), cosBearing = Math.cos(bearing);
|
|
36
38
|
const camera = cameraByLayer.get(layer);
|
|
37
39
|
camera.fov = cameraFov;
|
|
38
40
|
camera.aspect = size.x / size.y;
|
|
39
41
|
camera.near = Math.max(0.1, distance / 10000);
|
|
40
42
|
camera.far = Math.max(10000, distance * 10);
|
|
41
|
-
camera.position[0] = targetX +
|
|
42
|
-
camera.position[1] = targetY +
|
|
43
|
-
camera.position[2] = targetZ +
|
|
44
|
-
camera.up[0] = -
|
|
45
|
-
camera.up[1] =
|
|
46
|
-
camera.up[2] = -
|
|
43
|
+
camera.position[0] = targetX + sinBearing * sinPitch * distance;
|
|
44
|
+
camera.position[1] = targetY + cosPitch * distance;
|
|
45
|
+
camera.position[2] = targetZ + cosBearing * sinPitch * distance;
|
|
46
|
+
camera.up[0] = -sinBearing * cosPitch;
|
|
47
|
+
camera.up[1] = sinPitch;
|
|
48
|
+
camera.up[2] = -cosBearing * cosPitch;
|
|
47
49
|
camera.target[0] = targetX; camera.target[1] = targetY; camera.target[2] = targetZ;
|
|
48
50
|
// Refresh the camera view, projection and combined projection-view matrices.
|
|
49
51
|
updateCamera(camera);
|
package/src/cog/initCog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { initRaster } from '../raster/initRaster.js';
|
|
2
|
-
import {
|
|
2
|
+
import { openCogInWorker } from '../workers/openCogInWorker.js';
|
|
3
3
|
|
|
4
4
|
export function initCog(layer, options) {
|
|
5
5
|
initRaster(layer, /* alloc */ { ariaLabel: 'COG raster', ...options,
|
|
6
|
-
archive: options.archive ||
|
|
6
|
+
archive: options.archive || openCogInWorker(layer, options) });
|
|
7
7
|
}
|
|
@@ -36,37 +36,42 @@ import { changeCameraTouch } from './changeCameraTouch.js';
|
|
|
36
36
|
import { cleanupCameraTouch } from './cleanupCameraTouch.js';
|
|
37
37
|
import { endAllCameraTouches } from './endAllCameraTouches.js';
|
|
38
38
|
import { addCameraHandler } from './addCameraHandler.js';
|
|
39
|
+
import { extendLeafletClass } from '../core/extendLeafletClass.js';
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
41
|
+
class CompassHandler extends extendLeafletClass(L.Handler) {}
|
|
42
|
+
Object.assign(CompassHandler.prototype, { addHooks: compassAddHooks, removeHooks: compassRemoveHooks });
|
|
43
|
+
Compass.value = CompassHandler;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
removeHooks: containerResizeRemoveHooks,
|
|
45
|
+
class ContainerResizeHandler extends extendLeafletClass(L.Handler) {}
|
|
46
|
+
Object.assign(ContainerResizeHandler.prototype, {
|
|
47
|
+
addHooks: containerResizeAddHooks, removeHooks: containerResizeRemoveHooks,
|
|
48
48
|
});
|
|
49
|
+
ContainerResize.value = ContainerResizeHandler;
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
51
|
+
class PitchDragHandler extends extendLeafletClass(L.Handler) {}
|
|
52
|
+
Object.assign(PitchDragHandler.prototype, { addHooks: pitchDragAddHooks, removeHooks: pitchDragRemoveHooks });
|
|
53
|
+
PitchDrag.value = PitchDragHandler;
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
removeHooks: shiftRotateRemoveHooks,
|
|
55
|
+
class ShiftRotateHandler extends extendLeafletClass(L.Handler) {}
|
|
56
|
+
Object.assign(ShiftRotateHandler.prototype, {
|
|
57
|
+
addHooks: shiftRotateAddHooks, removeHooks: shiftRotateRemoveHooks,
|
|
58
58
|
});
|
|
59
|
+
ShiftRotate.value = ShiftRotateHandler;
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
removeHooks: notifyCameraTouchChange,
|
|
61
|
+
class TouchModeHandler extends extendLeafletClass(L.Handler) {}
|
|
62
|
+
Object.assign(TouchModeHandler.prototype, {
|
|
63
|
+
addHooks: notifyCameraTouchChange, removeHooks: notifyCameraTouchChange,
|
|
63
64
|
});
|
|
65
|
+
TouchMode.value = TouchModeHandler;
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
class RotateControl extends extendLeafletClass(L.Control) {
|
|
68
|
+
static defaultOptions = { position: 'topleft', closeOnZeroBearing: true, visualizePitch: true };
|
|
69
|
+
}
|
|
70
|
+
Object.assign(RotateControl.prototype, { onAdd: rotateOnAdd, onRemove: rotateOnRemove });
|
|
71
|
+
if (L.version.startsWith('1.')) {
|
|
72
|
+
RotateControl.prototype.options = Object.assign(Object.create(L.Control.prototype.options), RotateControl.defaultOptions);
|
|
73
|
+
}
|
|
74
|
+
L.Control.Rotate = RotateControl;
|
|
70
75
|
|
|
71
76
|
if (L.control) L.control.rotate = rotateControl;
|
|
72
77
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { boundsMethods } from '../weakmaps/boundsMethods.js';
|
|
2
|
+
import { projectNativePath } from './projectNativePath.js';
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
export function cameraCircleBounds() {
|
|
5
|
-
this.
|
|
6
|
+
if (this._map) projectNativePath(this);
|
|
6
7
|
return boundsMethods.get(this).call(this);
|
|
7
8
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { closestMethods } from '../weakmaps/closestMethods.js';
|
|
2
|
+
import { projectNativePath } from './projectNativePath.js';
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
export function closestCameraLayerPoint(point) {
|
|
5
|
-
this
|
|
6
|
+
projectNativePath(this);
|
|
6
7
|
this._parts = this._rings;
|
|
7
8
|
return closestMethods.get(this).call(this, point);
|
|
8
9
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { leafletLayer } from '../globals/leafletLayer.js';
|
|
2
|
+
import { layerInitialize } from '../scene/layerInitialize.js';
|
|
3
|
+
|
|
4
|
+
export function constructLayer(options) {
|
|
5
|
+
const layer = Reflect.construct(leafletLayer, /* alloc */ [], new.target);
|
|
6
|
+
layerInitialize.call(layer, options);
|
|
7
|
+
layer.callInitHooks();
|
|
8
|
+
return layer;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cameraViewByMap } from '../weakmaps/cameraViewByMap.js';
|
|
2
|
+
import { mapMethods } from '../globals/mapMethods.js';
|
|
3
|
+
import { radians } from '../globals/radians.js';
|
|
4
|
+
import { earthCirc } from '../globals/earthCirc.js';
|
|
5
|
+
import { mapElevationOf } from '../terrain/mapElevationOf.js';
|
|
6
|
+
import { groundBounds } from '../projections/groundBounds.js';
|
|
7
|
+
import { animationPoint } from '../projections/transformZoomAnimationPoint.js';
|
|
8
|
+
|
|
9
|
+
export function extendTerrainPixelBounds(layer, result, stream, origin) {
|
|
10
|
+
const map = layer._map;
|
|
11
|
+
let minimum = Infinity, maximum = -Infinity, key, entry;
|
|
12
|
+
for ([key, entry] of stream.terrainCache) {
|
|
13
|
+
if (!key.startsWith(`${layer._tileZoom}/`) || !entry.range) continue;
|
|
14
|
+
minimum = Math.min(minimum, entry.range[0]);
|
|
15
|
+
maximum = Math.max(maximum, entry.range[1]);
|
|
16
|
+
}
|
|
17
|
+
if (!Number.isFinite(minimum) || !Number.isFinite(maximum)) return result;
|
|
18
|
+
const zoom = cameraViewByMap.get(map)?.zoom ?? map.getZoom();
|
|
19
|
+
const scale = map.options.crs.scale(zoom) / (earthCirc * Math.cos(origin.lat * radians));
|
|
20
|
+
const target = mapElevationOf(map, map.getCenter()) ?? 0;
|
|
21
|
+
let i, j, footprint, point, raw;
|
|
22
|
+
for (i = 0; i < 2; i++) {
|
|
23
|
+
footprint = groundBounds(map, undefined, ((i ? maximum : minimum) - target) * scale);
|
|
24
|
+
for (j = 0; j < 2; j++) {
|
|
25
|
+
point = j ? footprint.max : footprint.min;
|
|
26
|
+
raw = mapMethods.value.containerPointToLayerPoint.call(map, animationPoint(map, point, true));
|
|
27
|
+
result.extend(map.project(map.layerPointToLatLng(raw), layer._tileZoom));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
@@ -3,10 +3,18 @@ import { tiledBounds } from '../globals/tiledBounds.js';
|
|
|
3
3
|
|
|
4
4
|
import { mapGetBearing } from '../camera/mapGetBearing.js';
|
|
5
5
|
import { mapGetPitch } from '../camera/mapGetPitch.js';
|
|
6
|
+
import { streamTerrainByMap } from '../weakmaps/streamTerrainByMap.js';
|
|
7
|
+
import { renderers } from '../weakmaps/renderers.js';
|
|
8
|
+
import { sceneOriginByLayer } from '../weakmaps/sceneOriginByLayer.js';
|
|
9
|
+
import { extendTerrainPixelBounds } from './extendTerrainPixelBounds.js';
|
|
6
10
|
|
|
7
11
|
export function gridlayerGetTiledPixelBounds(center) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const map = this._map, stream = streamTerrainByMap.get(map);
|
|
13
|
+
if (!stream && !mapGetBearing(map) && !mapGetPitch(map)) return tiledBounds.value.call(this, center);
|
|
14
|
+
const bounds = map.getBounds();
|
|
15
|
+
const result = /* alloc */ new L.Bounds(map.project(bounds.getNorthWest(), this._tileZoom),
|
|
16
|
+
map.project(bounds.getSouthEast(), this._tileZoom));
|
|
17
|
+
const shared = renderers.get(map), origin = shared && sceneOriginByLayer.get(shared);
|
|
18
|
+
if (!stream || !origin) return result;
|
|
19
|
+
return extendTerrainPixelBounds(this, result, stream, origin);
|
|
12
20
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { sceneLayers } from '../weakmaps/sceneLayers.js';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { initializeNativeLayer } from './initializeNativeLayer.js';
|
|
7
|
-
|
|
8
|
-
export function layerCallInitHooks() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
3
|
+
import { L } from '../globals/L.js';
|
|
4
|
+
import { layerProto } from '../globals/layerProto.js';
|
|
5
|
+
|
|
6
|
+
import { initializeNativeLayer } from './initializeNativeLayer.js';
|
|
7
|
+
|
|
8
|
+
export function layerCallInitHooks() {
|
|
9
|
+
const initialized = this._initHooksCalled;
|
|
10
|
+
if (!L.version.startsWith('2.')) layerProto.value.callInitHooks.call(this);
|
|
11
|
+
if (L.version.startsWith('2.') || !initialized) {
|
|
12
|
+
sceneLayers.add(this);
|
|
13
|
+
initializeNativeLayer.call(this);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/core/markerSetPos.js
CHANGED
|
@@ -5,7 +5,7 @@ import { markerCameraIconPoint } from '../projections/markerCameraIconPoint.js';
|
|
|
5
5
|
import { displayPoint } from '../projections/displayContainerPoint.js';
|
|
6
6
|
|
|
7
7
|
export function markerSetPos(point) {
|
|
8
|
-
markerMethods.value._setPos.call(this, displayPoint(this._map, point));
|
|
8
|
+
markerMethods.value._setPos.call(this, displayPoint(this._map, point, this.getLatLng()));
|
|
9
9
|
let i, element, key, direction, options, anchor;
|
|
10
10
|
for (i = 0; i < 2; i++) {
|
|
11
11
|
element = i ? this._shadow : this._icon;
|
|
@@ -3,6 +3,6 @@ import { popupEvents } from '../globals/popupEvents.js';
|
|
|
3
3
|
|
|
4
4
|
export function popupGetEvents() {
|
|
5
5
|
const events = popupEvents.value.call(this);
|
|
6
|
-
events.rotate = events.pitch = events.move = this._updatePosition;
|
|
6
|
+
events.rotate = events.pitch = events.move = events.terrainchange = this._updatePosition;
|
|
7
7
|
return events;
|
|
8
8
|
}
|
|
@@ -5,13 +5,13 @@ import { popupPosition } from '../globals/popupPosition.js';
|
|
|
5
5
|
import { displayPoint } from '../projections/displayContainerPoint.js';
|
|
6
6
|
|
|
7
7
|
export function popupUpdatePosition() {
|
|
8
|
-
popupPosition.value.call(this);
|
|
9
|
-
if (!this._map) return;
|
|
10
|
-
const point = this._map.latLngToLayerPoint(this._latlng), delta = displayPoint(this._map, point).subtract(point);
|
|
11
|
-
if (this._zoomAnimated) {
|
|
12
|
-
L.DomUtil.setPosition(this._container, L.DomUtil.getPosition(this._container).add(delta));
|
|
13
|
-
} else {
|
|
14
|
-
this._container.style.left = `${this._containerLeft + delta.x}px`;
|
|
15
|
-
this._container.style.bottom = `${this._containerBottom - delta.y}px`;
|
|
8
|
+
popupPosition.value.call(this);
|
|
9
|
+
if (!this._map) return;
|
|
10
|
+
const point = this._map.latLngToLayerPoint(this._latlng), delta = displayPoint(this._map, point, this._latlng).subtract(point);
|
|
11
|
+
if (this._zoomAnimated) {
|
|
12
|
+
L.DomUtil.setPosition(this._container, L.DomUtil.getPosition(this._container).add(delta));
|
|
13
|
+
} else {
|
|
14
|
+
this._container.style.left = `${this._containerLeft + delta.x}px`;
|
|
15
|
+
this._container.style.bottom = `${this._containerBottom - delta.y}px`;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { L } from '../globals/L.js';
|
|
2
|
+
import { pathProjectionByMap } from '../weakmaps/pathProjectionByMap.js';
|
|
3
|
+
|
|
4
|
+
export function projectNativePath(source) {
|
|
5
|
+
if (!L.version.startsWith('2.')) return source._project();
|
|
6
|
+
const map = source._map, renderer = source._renderer;
|
|
7
|
+
let projection = pathProjectionByMap.get(map);
|
|
8
|
+
if (!projection) {
|
|
9
|
+
// Leaflet 2 projects against a renderer view, even when no DOM renderer is mounted.
|
|
10
|
+
projection = Object.create(L.Renderer.prototype);
|
|
11
|
+
projection._map = map;
|
|
12
|
+
pathProjectionByMap.set(map, projection);
|
|
13
|
+
}
|
|
14
|
+
projection._pathZoom = map.getZoom();
|
|
15
|
+
projection._pathOrigin = map.getPixelOrigin();
|
|
16
|
+
source._renderer = projection;
|
|
17
|
+
try {
|
|
18
|
+
source._project();
|
|
19
|
+
} finally {
|
|
20
|
+
if (renderer) source._renderer = renderer;
|
|
21
|
+
else delete source._renderer;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -3,6 +3,6 @@ import { tooltipEvents } from '../globals/tooltipEvents.js';
|
|
|
3
3
|
|
|
4
4
|
export function tooltipGetEvents() {
|
|
5
5
|
const events = tooltipEvents.value.call(this);
|
|
6
|
-
events.rotate = events.pitch = events.move = this._updatePosition;
|
|
6
|
+
events.rotate = events.pitch = events.move = events.terrainchange = this._updatePosition;
|
|
7
7
|
return events;
|
|
8
8
|
}
|
|
@@ -5,7 +5,7 @@ import { tooltipPosition } from '../globals/tooltipPosition.js';
|
|
|
5
5
|
import { displayPoint } from '../projections/displayContainerPoint.js';
|
|
6
6
|
|
|
7
7
|
export function tooltipSetPosition(point) {
|
|
8
|
-
tooltipPosition.value.call(this, point);
|
|
9
|
-
const delta = displayPoint(this._map, point).subtract(point);
|
|
8
|
+
tooltipPosition.value.call(this, point);
|
|
9
|
+
const delta = displayPoint(this._map, point, this._latlng).subtract(point);
|
|
10
10
|
L.DomUtil.setPosition(this._container, L.DomUtil.getPosition(this._container).add(delta));
|
|
11
11
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export function triangle(point, target, a, b, c) {
|
|
2
|
-
return target.push(...point(a), ...point(b), ...point(c));
|
|
1
|
+
export function triangle(point, target, a, b, c, anchorA, anchorB, anchorC) {
|
|
2
|
+
return target.push(...point(a, anchorA), ...point(b, anchorB), ...point(c, anchorC));
|
|
3
3
|
}
|
|
@@ -3,18 +3,19 @@ import { disk } from './disk.js';
|
|
|
3
3
|
import { circleAt } from './circleAt.js';
|
|
4
4
|
import { line } from './line.js';
|
|
5
5
|
import { triangle } from './appendNativeTriangle.js';
|
|
6
|
+
import { projectNativePath } from '../core/projectNativePath.js';
|
|
6
7
|
|
|
7
8
|
export function circleGeometry(source, context) {
|
|
8
9
|
const { map, point, fill, stroke, options, dash, width } = context;
|
|
9
10
|
const center = map.project(source.getLatLng());
|
|
10
11
|
let radius = source.getRadius(), radiusY = radius, index, i;
|
|
11
12
|
if (source instanceof L.Circle) {
|
|
12
|
-
source
|
|
13
|
+
projectNativePath(source);
|
|
13
14
|
const projected = source._point.add(map.getPixelOrigin());
|
|
14
15
|
center.x = projected.x;
|
|
15
16
|
center.y = projected.y;
|
|
16
|
-
radius = source._radius;
|
|
17
|
-
radiusY = source._radiusY
|
|
17
|
+
radius = source._pxRadius ?? source._radius;
|
|
18
|
+
radiusY = source._pxRadiusY ?? source._radiusY ?? radius;
|
|
18
19
|
}
|
|
19
20
|
if (options.fill) disk(point, center, radius, fill, radiusY);
|
|
20
21
|
const count = Math.max(12, Math.min(128, Math.ceil(Math.PI * Math.sqrt(Math.max(radius, radiusY)))));
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { rendererByLayer } from '../weakmaps/rendererByLayer.js';
|
|
2
|
-
|
|
3
|
-
import { vertexNormals } from './vertexNormals.js';
|
|
1
|
+
import { rendererByLayer } from '../weakmaps/rendererByLayer.js';
|
|
2
|
+
|
|
4
3
|
import { createProgram } from '../materials/createProgram.js';
|
|
5
4
|
|
|
6
5
|
export function createModelGeometry(context, primitive, attributes) {
|
|
7
|
-
let normals;
|
|
8
|
-
if (!attributes.normal) {
|
|
9
|
-
normals = vertexNormals(attributes.position.data, attributes.index?.data);
|
|
10
|
-
attributes.normal = /* alloc */ { size: 3, data: normals };
|
|
11
|
-
}
|
|
12
6
|
const style = context.materials[primitive.material] || /* alloc */ {
|
|
13
7
|
color: /* alloc */ [1, 1, 1], metallic: 1,
|
|
14
8
|
};
|
|
@@ -18,7 +12,6 @@ export function createModelGeometry(context, primitive, attributes) {
|
|
|
18
12
|
const program = createProgram(context.backend, style);
|
|
19
13
|
context.resources.push(program);
|
|
20
14
|
const device = rendererByLayer.get(context.backend).device;
|
|
21
|
-
if (attributes.index?.data instanceof Uint8Array) attributes.index.data = Uint16Array.from(attributes.index.data);
|
|
22
15
|
let name, attribute;
|
|
23
16
|
for ([name, attribute] of Object.entries(attributes)) {
|
|
24
17
|
attribute.size ||= 1;
|
|
@@ -2,15 +2,20 @@ import { segment } from './segment.js';
|
|
|
2
2
|
|
|
3
3
|
export function dashedSegment(context, a, b, length, distance, period) {
|
|
4
4
|
const dash = context.dash;
|
|
5
|
-
let offset = 0, phase, index, end, delta;
|
|
5
|
+
let offset = 0, phase = ((distance % period) + period) % period, index = 0, end, delta, skipped = 0;
|
|
6
|
+
while (index < dash.length - 1 && phase >= dash[index]) phase -= dash[index++];
|
|
7
|
+
let remaining = Math.max(0, dash[index] - phase);
|
|
6
8
|
while (offset < length) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
end = Math.min(length, offset + dash[index] - phase);
|
|
10
|
-
if (index % 2 === 0) {
|
|
9
|
+
end = Math.min(length, offset + remaining);
|
|
10
|
+
if (end > offset && index % 2 === 0) {
|
|
11
11
|
delta = b.subtract(a).divideBy(length);
|
|
12
12
|
segment(context, a.add(delta.multiplyBy(offset)), a.add(delta.multiplyBy(end)), true, true);
|
|
13
13
|
}
|
|
14
|
+
if (end <= offset) {
|
|
15
|
+
if (++skipped >= dash.length) throw /* alloc */ new Error('Leaflet dashArray is too small for these coordinates');
|
|
16
|
+
} else skipped = 0;
|
|
14
17
|
offset = end;
|
|
18
|
+
index = (index + 1) % dash.length;
|
|
19
|
+
remaining = dash[index];
|
|
15
20
|
}
|
|
16
21
|
}
|
package/src/geometry/disk.js
CHANGED
|
@@ -6,6 +6,6 @@ export function disk(point, center, radius, target, radiusY = radius) {
|
|
|
6
6
|
const count = Math.max(12, Math.min(128, Math.ceil(Math.PI * Math.sqrt(radius))));
|
|
7
7
|
let i;
|
|
8
8
|
for (i = 0; i < count; i++) {
|
|
9
|
-
triangle(point, target, center, diskAt(center, radius, radiusY, count, i), diskAt(center, radius, radiusY, count, i + 1));
|
|
9
|
+
triangle(point, target, center, diskAt(center, radius, radiusY, count, i), diskAt(center, radius, radiusY, count, i + 1), center, center, center);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { triangle } from './appendNativeTriangle.js';
|
|
2
|
+
import { triangulate } from '../triangulation/triangulate.js';
|
|
3
|
+
|
|
4
|
+
export function fillNativePolygon(context, projected) {
|
|
5
|
+
const { options, fill, point } = context;
|
|
6
|
+
if (options.triangulated) {
|
|
7
|
+
if (projected.length !== 1 || projected[0].length !== 3) {
|
|
8
|
+
throw /* alloc */ new Error('triangulated polygons require three vertices per polygon and no holes');
|
|
9
|
+
}
|
|
10
|
+
triangle(point, fill, projected[0][0], projected[0][1], projected[0][2]);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const valid = /* alloc */ [];
|
|
14
|
+
let ring, indices;
|
|
15
|
+
for (ring of projected) if (ring.length >= 3) valid.push(ring);
|
|
16
|
+
const vertices = valid.flat();
|
|
17
|
+
for (indices of triangulate(valid[0], valid.slice(1))) {
|
|
18
|
+
triangle(point, fill, vertices[indices[0]], vertices[indices[1]], vertices[indices[2]]);
|
|
19
|
+
}
|
|
20
|
+
}
|
package/src/geometry/lineJoin.js
CHANGED
|
@@ -19,8 +19,8 @@ export function lineJoin(context, points, i, b, length) {
|
|
|
19
19
|
const from = a.add(n1.multiplyBy(radius)), to = a.add(n2.multiplyBy(radius));
|
|
20
20
|
const denominator = 1 + n1.x * n2.x + n1.y * n2.y;
|
|
21
21
|
const miter = denominator > 0 ? n1.add(n2).multiplyBy(radius / denominator) : null;
|
|
22
|
-
triangle(point, stroke, from, a, to);
|
|
22
|
+
triangle(point, stroke, from, a, to, a, a, a);
|
|
23
23
|
if (options.lineJoin === 'miter' && miter && Math.hypot(miter.x, miter.y) <= radius * 4) {
|
|
24
|
-
triangle(point, stroke, from, a.add(miter), to);
|
|
24
|
+
triangle(point, stroke, from, a.add(miter), to, a, a, a);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -8,11 +8,17 @@ import { localPosition } from '../projections/localPosition.js';
|
|
|
8
8
|
|
|
9
9
|
import { transformNativePoint } from '../transforms/transformNativePoint.js';
|
|
10
10
|
import { markerImageBounds } from './markerImageBounds.js';
|
|
11
|
+
import { streamTerrainByMap } from '../weakmaps/streamTerrainByMap.js';
|
|
12
|
+
import { mapElevationOf } from '../terrain/mapElevationOf.js';
|
|
11
13
|
|
|
12
14
|
export function markerQuadCorners(state, key, image) {
|
|
13
15
|
const { source, map, backend: layer } = state;
|
|
14
16
|
|
|
15
17
|
const position = localPosition(state, source.getLatLng());
|
|
18
|
+
if (streamTerrainByMap.get(map)) {
|
|
19
|
+
const root = rootByLayer.get(layer), elevation = mapElevationOf(map, source.getLatLng());
|
|
20
|
+
if (Number.isFinite(elevation)) position[1] = (elevation - root.position[1]) / root.scale[1];
|
|
21
|
+
}
|
|
16
22
|
const size = map.getSize();
|
|
17
23
|
const matrices = state.markerMatrices ||= /* alloc */ {
|
|
18
24
|
root: /* alloc */ new DOMMatrix(),
|
|
@@ -3,7 +3,7 @@ import { visit } from './visitNativeCoordinates.js';
|
|
|
3
3
|
import { dashValues } from './dashValues.js';
|
|
4
4
|
import { circleGeometry } from './circleGeometry.js';
|
|
5
5
|
|
|
6
|
-
/** Leaflet paths become flat triangles;
|
|
6
|
+
/** Leaflet paths become flat triangles; solid strokes retain stationary zoom anchors. */
|
|
7
7
|
export function nativeGeometry(source, map, point) {
|
|
8
8
|
const fill = /* alloc */ [];
|
|
9
9
|
const stroke = /* alloc */ [];
|
package/src/geometry/polygon.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import { triangle } from './appendNativeTriangle.js';
|
|
2
1
|
import { line } from './line.js';
|
|
3
|
-
import {
|
|
2
|
+
import { fillNativePolygon } from './fillNativePolygon.js';
|
|
4
3
|
|
|
5
4
|
export function polygon(context, rings, closed) {
|
|
6
|
-
const { options,
|
|
5
|
+
const { options, map } = context;
|
|
7
6
|
const projected = /* alloc */ [];
|
|
8
|
-
let ring, path, latlng
|
|
7
|
+
let ring, path, latlng;
|
|
9
8
|
for (ring of rings) {
|
|
10
9
|
path = /* alloc */ [];
|
|
11
10
|
for (latlng of ring) path.push(map.project(latlng));
|
|
12
11
|
projected.push(path);
|
|
13
12
|
}
|
|
14
13
|
if (closed && options.fill && projected[0]?.length >= 3) {
|
|
15
|
-
|
|
16
|
-
for (ring of projected) if (ring.length >= 3) valid.push(ring);
|
|
17
|
-
const vertices = valid.flat();
|
|
18
|
-
for (indices of triangulate(valid[0], valid.slice(1))) {
|
|
19
|
-
triangle(point, fill, vertices[indices[0]], vertices[indices[1]], vertices[indices[2]]);
|
|
20
|
-
}
|
|
14
|
+
fillNativePolygon(context, projected);
|
|
21
15
|
}
|
|
22
16
|
for (ring of projected) line(context, ring, closed);
|
|
23
17
|
}
|
package/src/geometry/segment.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { L } from '../globals/L.js';
|
|
1
|
+
import { L } from '../globals/L.js';
|
|
2
2
|
import { triangle } from './appendNativeTriangle.js';
|
|
3
3
|
import { disk } from './disk.js';
|
|
4
4
|
|
|
5
5
|
export function segment(context, a, b, startCap, endCap) {
|
|
6
6
|
const { options, width, stroke, point } = context;
|
|
7
7
|
const radius = width / 2;
|
|
8
|
+
const anchorA = a, anchorB = b;
|
|
8
9
|
const length = a.distanceTo(b);
|
|
9
10
|
if (!length) return;
|
|
10
11
|
const direction = b.subtract(a).divideBy(length);
|
|
@@ -13,8 +14,8 @@ export function segment(context, a, b, startCap, endCap) {
|
|
|
13
14
|
if (startCap) a = a.subtract(direction.multiplyBy(radius));
|
|
14
15
|
if (endCap) b = b.add(direction.multiplyBy(radius));
|
|
15
16
|
}
|
|
16
|
-
triangle(point, stroke, a.add(normal), a.subtract(normal), b.add(normal));
|
|
17
|
-
triangle(point, stroke, b.add(normal), a.subtract(normal), b.subtract(normal));
|
|
17
|
+
triangle(point, stroke, a.add(normal), a.subtract(normal), b.add(normal), anchorA, anchorA, anchorB);
|
|
18
|
+
triangle(point, stroke, b.add(normal), a.subtract(normal), b.subtract(normal), anchorB, anchorA, anchorB);
|
|
18
19
|
if (options.lineCap === 'round') {
|
|
19
20
|
if (startCap) disk(point, a, radius, stroke);
|
|
20
21
|
if (endCap) disk(point, b, radius, stroke);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const mvtTextDecoder = new TextDecoder('utf-8', { fatal: true });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const nativeScalableStyleKeys = new Set(['color', 'opacity', 'weight', 'fillColor', 'fillOpacity']);
|
package/src/globals/scenePass.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const vectorTileEvents = 'move zoom rotate pitch resize viewreset';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const workerCogSource = new Map();
|