@deck.gl/google-maps 9.2.9 → 9.2.10
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/dist/dist.dev.js +74 -35
- package/dist/google-maps-overlay.d.ts +12 -4
- package/dist/google-maps-overlay.d.ts.map +1 -1
- package/dist/google-maps-overlay.js +78 -32
- package/dist/google-maps-overlay.js.map +1 -1
- package/dist/index.cjs +76 -37
- package/dist/index.cjs.map +2 -2
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +12 -7
- package/dist/utils.js.map +1 -1
- package/dist.min.js +2 -2
- package/package.json +2 -2
- package/src/google-maps-overlay.ts +86 -39
- package/src/utils.ts +13 -6
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/google-maps-overlay.ts", "../src/utils.ts"],
|
|
4
|
-
"sourcesContent": ["// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {default as GoogleMapsOverlay} from './google-maps-overlay';\nexport type {GoogleMapsOverlayProps} from './google-maps-overlay';\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* global google */\nimport {GL, GLParameters} from '@luma.gl/constants';\nimport {WebGLDevice} from '@luma.gl/webgl';\nimport {\n createDeckInstance,\n destroyDeckInstance,\n getViewPropsFromOverlay,\n getViewPropsFromCoordinateTransformer\n} from './utils';\nimport {Deck} from '@deck.gl/core';\n\nimport type {DeckProps, MapViewState} from '@deck.gl/core';\nimport type {Device} from '@luma.gl/core';\n\nconst HIDE_ALL_LAYERS = () => false;\nconst GL_STATE: GLParameters = {\n depthMask: true,\n depthTest: true,\n blend: true,\n blendFunc: [GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ONE, GL.ONE_MINUS_SRC_ALPHA],\n blendEquation: GL.FUNC_ADD\n};\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() {}\n\nconst defaultProps = {\n interleaved: true\n};\n\nexport type GoogleMapsOverlayProps = Omit<\n DeckProps,\n | 'width'\n | 'height'\n | 'gl'\n | 'deviceProps'\n | 'parent'\n | 'canvas'\n | '_customRender'\n | 'viewState'\n | 'initialViewState'\n | 'controller'\n> & {\n interleaved?: boolean;\n};\n\nexport default class GoogleMapsOverlay {\n private props: GoogleMapsOverlayProps = {};\n private _map: google.maps.Map | null = null;\n private _deck: Deck | null = null;\n private _overlay: google.maps.WebGLOverlayView | google.maps.OverlayView | null = null;\n\n constructor(props: GoogleMapsOverlayProps) {\n this.setProps({...defaultProps, ...props});\n }\n\n /* Public API */\n\n /** Add/remove the overlay from a map. */\n setMap(map: google.maps.Map | null): void {\n if (map === this._map) {\n return;\n }\n\n const {VECTOR, UNINITIALIZED} = google.maps.RenderingType;\n if (this._map) {\n if (!map && this._map.getRenderingType() === VECTOR && this.props.interleaved) {\n (this._overlay as google.maps.WebGLOverlayView).requestRedraw();\n }\n this._overlay?.setMap(null);\n this._map = null;\n }\n if (map) {\n this._map = map;\n const renderingType = map.getRenderingType();\n if (renderingType !== UNINITIALIZED) {\n this._createOverlay(map);\n } else {\n map.addListener('renderingtype_changed', () => {\n this._createOverlay(map);\n });\n }\n }\n }\n\n /**\n * Update (partial) props.\n */\n setProps(props: Partial<GoogleMapsOverlayProps>): void {\n Object.assign(this.props, props);\n if (this._deck) {\n const canvas = this._deck.getCanvas();\n if (props.style && canvas?.parentElement) {\n const parentStyle = canvas.parentElement.style;\n Object.assign(parentStyle, props.style);\n props.style = null;\n }\n this._deck.setProps(props);\n }\n }\n\n /** Equivalent of `deck.pickObject`. */\n pickObject(params) {\n return this._deck && this._deck.pickObject(params);\n }\n\n /** Equivalent of `deck.pickObjects`. */\n pickMultipleObjects(params) {\n return this._deck && this._deck.pickMultipleObjects(params);\n }\n\n /** Equivalent of `deck.pickMultipleObjects`. */\n pickObjects(params) {\n return this._deck && this._deck.pickObjects(params);\n }\n\n /** Remove the overlay and release all underlying resources. */\n finalize() {\n this.setMap(null);\n if (this._deck) {\n destroyDeckInstance(this._deck);\n this._deck = null;\n }\n }\n\n /* Private API */\n _createOverlay(map: google.maps.Map) {\n const {interleaved} = this.props;\n const {VECTOR, UNINITIALIZED} = google.maps.RenderingType;\n const renderingType = map.getRenderingType();\n if (renderingType === UNINITIALIZED) {\n return;\n }\n\n const isVectorMap = renderingType === VECTOR && google.maps.WebGLOverlayView;\n const OverlayView = isVectorMap ? google.maps.WebGLOverlayView : google.maps.OverlayView;\n const overlay = new OverlayView();\n\n if (overlay instanceof google.maps.WebGLOverlayView) {\n if (interleaved) {\n overlay.onAdd = noop;\n overlay.onContextRestored = this._onContextRestored.bind(this);\n overlay.onDraw = this._onDrawVectorInterleaved.bind(this);\n } else {\n overlay.onAdd = this._onAdd.bind(this);\n overlay.onContextRestored = noop;\n overlay.onDraw = this._onDrawVectorOverlay.bind(this);\n }\n overlay.onContextLost = this._onContextLost.bind(this);\n } else {\n overlay.onAdd = this._onAdd.bind(this);\n overlay.draw = this._onDrawRaster.bind(this);\n }\n overlay.onRemove = this._onRemove.bind(this);\n\n this._overlay = overlay;\n this._overlay.setMap(map);\n }\n\n _onAdd() {\n // @ts-ignore (TS2345) map is defined at this stage\n this._deck = createDeckInstance(this._map, this._overlay, this._deck, this.props);\n }\n\n _onContextRestored({gl}) {\n if (!this._map || !this._overlay) {\n return;\n }\n const _customRender = () => {\n if (this._overlay) {\n (this._overlay as google.maps.WebGLOverlayView).requestRedraw();\n }\n };\n const deck = createDeckInstance(this._map, this._overlay, this._deck, {\n gl,\n _customRender,\n ...this.props\n });\n this._deck = deck;\n\n // By default, animationLoop._renderFrame invokes\n // animationLoop.onRender. We override this to wrap\n // in withParameters so we don't modify the GL state\n // @ts-ignore accessing protected member\n const animationLoop = deck.animationLoop!;\n animationLoop._renderFrame = () => {\n const ab = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n // @ts-expect-error accessing protected member\n const device: Device = deck.device;\n device.withParametersWebGL({}, () => {\n animationLoop.props.onRender(animationLoop.animationProps!);\n });\n gl.bindBuffer(gl.ARRAY_BUFFER, ab);\n };\n }\n\n _onContextLost() {\n // TODO this isn't working\n if (this._deck) {\n destroyDeckInstance(this._deck);\n this._deck = null;\n }\n }\n\n _onRemove() {\n this._deck?.setProps({layerFilter: HIDE_ALL_LAYERS});\n }\n\n _onDrawRaster() {\n if (!this._deck || !this._map) {\n return;\n }\n const deck = this._deck;\n\n const {width, height, left, top, ...rest} = getViewPropsFromOverlay(\n this._map,\n this._overlay as google.maps.OverlayView\n );\n\n const canvas = deck.getCanvas();\n const parent = canvas?.parentElement || deck.props.parent;\n if (parent) {\n const parentStyle = parent.style;\n parentStyle.left = `${left}px`;\n parentStyle.top = `${top}px`;\n }\n\n const altitude = 10000;\n deck.setProps({\n width,\n height,\n // @ts-expect-error altitude is accepted by WebMercatorViewport but not exposed by type\n viewState: {altitude, ...rest} as MapViewState\n });\n // Deck is initialized\n deck.redraw();\n }\n\n // Vector code path\n _onDrawVectorInterleaved({gl, transformer}) {\n if (!this._deck || !this._map) {\n return;\n }\n\n const deck = this._deck;\n\n deck.setProps({\n ...getViewPropsFromCoordinateTransformer(this._map, transformer),\n\n // Using external gl context - do not set css size\n width: null,\n height: null\n });\n\n if (deck.isInitialized) {\n // @ts-expect-error\n const device: Device = deck.device;\n\n // As an optimization, some renders are to an separate framebuffer\n // which we need to pass onto deck\n if (device instanceof WebGLDevice) {\n const _framebuffer = device.getParametersWebGL(GL.FRAMEBUFFER_BINDING);\n deck.setProps({_framebuffer});\n }\n\n // Camera changed, will trigger a map repaint right after this\n // Clear any change flag triggered by setting viewState so that deck does not request\n // a second repaint\n deck.needsRedraw({clearRedrawFlags: true});\n\n // Workaround for bug in Google maps where viewport state is wrong\n // TODO remove once fixed\n if (device instanceof WebGLDevice) {\n device.setParametersWebGL({\n viewport: [0, 0, gl.canvas.width, gl.canvas.height],\n scissor: [0, 0, gl.canvas.width, gl.canvas.height],\n stencilFunc: [gl.ALWAYS, 0, 255, gl.ALWAYS, 0, 255]\n });\n\n device.withParametersWebGL(GL_STATE, () => {\n deck._drawLayers('google-vector', {\n clearCanvas: false\n });\n });\n }\n }\n }\n\n _onDrawVectorOverlay({transformer}) {\n if (!this._deck || !this._map) {\n return;\n }\n\n const deck = this._deck;\n\n deck.setProps({\n ...getViewPropsFromCoordinateTransformer(this._map, transformer)\n });\n deck.redraw();\n }\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* global google, document */\nimport {Deck, MapView} from '@deck.gl/core';\nimport {Matrix4, Vector2} from '@math.gl/core';\nimport type {MjolnirGestureEvent, MjolnirPointerEvent} from 'mjolnir.js';\n\n// https://en.wikipedia.org/wiki/Web_Mercator_projection#Formulas\nconst MAX_LATITUDE = 85.05113;\n\ntype UserData = {\n _googleMap: google.maps.Map;\n _eventListeners: Record<string, google.maps.MapsEventListener | null>;\n};\n\n/**\n * Get a new deck instance\n * @param map (google.maps.Map) - The parent Map instance\n * @param overlay (google.maps.OverlayView) - A maps Overlay instance\n * @param [deck] (Deck) - a previously created instances\n */\nexport function createDeckInstance(\n map: google.maps.Map,\n overlay: google.maps.OverlayView | google.maps.WebGLOverlayView,\n deck: Deck | null | undefined,\n props\n): Deck {\n if (deck) {\n if (deck.userData._googleMap === map) {\n return deck;\n }\n // deck instance was created for a different map\n destroyDeckInstance(deck);\n }\n\n const eventListeners = {\n click: null,\n rightclick: null,\n dblclick: null,\n mousemove: null,\n mouseout: null\n };\n\n const newDeck = new Deck({\n ...props,\n useDevicePixels: props.interleaved ? true : props.useDevicePixels,\n style: props.interleaved ? null : {pointerEvents: 'none'},\n parent: getContainer(overlay, props.style),\n views: new MapView({repeat: true}),\n initialViewState: {\n longitude: 0,\n latitude: 0,\n zoom: 1\n },\n controller: false\n });\n\n // Register event listeners\n for (const eventType in eventListeners) {\n eventListeners[eventType] = map.addListener(eventType, evt =>\n handleMouseEvent(newDeck, eventType, evt)\n );\n }\n\n // Attach userData directly to Deck instance\n (newDeck.userData as UserData)._googleMap = map;\n (newDeck.userData as UserData)._eventListeners = eventListeners;\n\n return newDeck;\n}\n\n// Create a container that will host the deck canvas and tooltip\nfunction getContainer(\n overlay: google.maps.OverlayView | google.maps.WebGLOverlayView,\n style?: Partial<CSSStyleDeclaration>\n): HTMLElement {\n const container = document.createElement('div');\n container.style.position = 'absolute';\n Object.assign(container.style, style);\n\n // The DOM structure has a different structure depending on whether\n // the Google map is rendered as vector or raster\n if ('getPanes' in overlay) {\n overlay.getPanes()?.overlayLayer.appendChild(container);\n } else {\n overlay.getMap()?.getDiv().appendChild(container);\n }\n return container;\n}\n\n/**\n * Safely remove a deck instance\n * @param deck (Deck) - a previously created instances\n */\nexport function destroyDeckInstance(deck: Deck) {\n const {_eventListeners: eventListeners} = deck.userData;\n\n // Unregister event listeners\n for (const eventType in eventListeners) {\n // Check that event listener was set before trying to remove.\n if (eventListeners[eventType]) {\n eventListeners[eventType].remove();\n }\n }\n\n deck.finalize();\n}\n\n/* eslint-disable max-statements */\n/**\n * Get the current view state\n * @param map (google.maps.Map) - The parent Map instance\n * @param overlay (google.maps.OverlayView) - A maps Overlay instance\n */\n// eslint-disable-next-line complexity\nexport function getViewPropsFromOverlay(map: google.maps.Map, overlay: google.maps.OverlayView) {\n const {width, height} = getMapSize(map);\n\n // Canvas position relative to draggable map's container depends on\n // overlayView's projection, not the map's. Have to use the center of the\n // map for this, not the top left, for the same reason as above.\n const projection = overlay.getProjection();\n\n const bounds = map.getBounds();\n if (!bounds) {\n return {width, height, left: 0, top: 0};\n }\n\n const ne = bounds.getNorthEast();\n const sw = bounds.getSouthWest();\n const topRight = projection.fromLatLngToDivPixel(ne);\n const bottomLeft = projection.fromLatLngToDivPixel(sw);\n\n // google maps places overlays in a container anchored at the map center.\n // the container CSS is manipulated during dragging.\n // We need to update left/top of the deck canvas to match the base map.\n const centerLngLat = pixelToLngLat(projection, width / 2, height / 2);\n const centerH = new google.maps.LatLng(0, centerLngLat[0]);\n const centerContainerPx = projection.fromLatLngToContainerPixel(centerH);\n const centerDivPx = projection.fromLatLngToDivPixel(centerH);\n\n if (!topRight || !bottomLeft || !centerDivPx || !centerContainerPx) {\n return {width, height, left: 0, top: 0};\n }\n const leftOffset = Math.round(centerDivPx.x - centerContainerPx.x);\n let topOffset = centerDivPx.y - centerContainerPx.y;\n\n const topLngLat = pixelToLngLat(projection, width / 2, 0);\n const bottomLngLat = pixelToLngLat(projection, width / 2, height);\n\n // Compute fractional center.\n let latitude = centerLngLat[1];\n const longitude = centerLngLat[0];\n\n // Adjust vertical offset - limit latitude\n if (Math.abs(latitude) > MAX_LATITUDE) {\n latitude = latitude > 0 ? MAX_LATITUDE : -MAX_LATITUDE;\n const center = new google.maps.LatLng(latitude, longitude);\n const centerPx = projection.fromLatLngToContainerPixel(center);\n // @ts-ignore (TS2531) Object is possibly 'null'\n topOffset += centerPx.y - height / 2;\n }\n topOffset = Math.round(topOffset);\n\n // Compute fractional bearing\n const delta = new Vector2(topLngLat).sub(bottomLngLat);\n let bearing = (180 * delta.verticalAngle()) / Math.PI;\n if (bearing < 0) bearing += 360;\n\n // Maps sometimes returns undefined instead of 0\n const heading = map.getHeading() || 0;\n\n let zoom = (map.getZoom() as number) - 1;\n\n let scale;\n\n if (bearing === 0) {\n // At full world view (always unrotated) simply compare height, as diagonal\n // is incorrect due to multiple world copies\n scale = height ? (bottomLeft.y - topRight.y) / height : 1;\n } else if (bearing === heading) {\n // Fractional zoom calculation only correct when bearing is not animating\n const viewDiagonal = new Vector2([topRight.x, topRight.y])\n .sub([bottomLeft.x, bottomLeft.y])\n .len();\n const mapDiagonal = new Vector2([width, -height]).len();\n scale = mapDiagonal ? viewDiagonal / mapDiagonal : 1;\n }\n\n // When resizing aggressively, occasionally ne and sw are the same points\n // See https://github.com/visgl/deck.gl/issues/4218\n zoom += Math.log2(scale || 1);\n\n return {\n width,\n height,\n left: leftOffset,\n top: topOffset,\n zoom,\n bearing,\n pitch: map.getTilt(),\n latitude,\n longitude\n };\n}\n\n/* eslint-enable max-statements */\n\n/**\n * Get the current view state\n * @param map (google.maps.Map) - The parent Map instance\n * @param transformer (google.maps.CoordinateTransformer) - A CoordinateTransformer instance\n */\nexport function getViewPropsFromCoordinateTransformer(\n map: google.maps.Map,\n transformer: google.maps.CoordinateTransformer\n) {\n const {width, height} = getMapSize(map);\n const {center, heading: bearing, tilt: pitch, zoom} = transformer.getCameraParams();\n\n // Match Google projection matrix\n const fovy = 25;\n const aspect = height ? width / height : 1;\n\n // Match depth range (crucial for correct z-sorting)\n const near = 0.75;\n const far = 300000000000000;\n // const far = Infinity;\n\n const projectionMatrix = new Matrix4().perspective({\n fovy: (fovy * Math.PI) / 180,\n aspect,\n near,\n far\n });\n const focalDistance = 0.5 * projectionMatrix[5];\n\n return {\n width,\n height,\n viewState: {\n altitude: focalDistance,\n bearing,\n latitude: center.lat(),\n longitude: center.lng(),\n pitch,\n projectionMatrix,\n repeat: true,\n zoom: zoom - 1\n }\n };\n}\n\nfunction getMapSize(map: google.maps.Map): {width: number; height: number} {\n // The map fills the container div unless it's in fullscreen mode\n // at which point the first child of the container is promoted\n const container = map.getDiv().firstChild as HTMLElement | null;\n return {\n // @ts-ignore (TS2531) Object is possibly 'null'\n width: container.offsetWidth,\n // @ts-ignore (TS2531) Object is possibly 'null'\n height: container.offsetHeight\n };\n}\n\nfunction pixelToLngLat(\n projection: google.maps.MapCanvasProjection,\n x: number,\n y: number\n): [longitude: number, latitude: number] {\n const point = new google.maps.Point(x, y);\n const latLng = projection.fromContainerPixelToLatLng(point);\n // @ts-ignore (TS2531) Object is possibly 'null'\n return [latLng.lng(), latLng.lat()];\n}\n\nfunction getEventPixel(event, deck: Deck): {x: number; y: number} {\n if (event.pixel) {\n return event.pixel;\n }\n // event.pixel may not exist when clicking on a POI\n // https://developers.google.com/maps/documentation/javascript/reference/map#MouseEvent\n const point = deck.getViewports()[0].project([event.latLng.lng(), event.latLng.lat()]);\n return {\n x: point[0],\n y: point[1]\n };\n}\n\n// Triggers picking on a mouse event\nfunction handleMouseEvent(deck: Deck, type: string, event) {\n if (!deck.isInitialized) {\n return;\n }\n\n const mockEvent: Record<string, any> = {\n type,\n offsetCenter: getEventPixel(event, deck),\n srcEvent: event\n };\n\n switch (type) {\n case 'click':\n case 'rightclick':\n mockEvent.type = 'click';\n mockEvent.tapCount = 1;\n // Hack: because we do not listen to pointer down, perform picking now\n deck._onPointerDown(mockEvent as MjolnirPointerEvent);\n deck._onEvent(mockEvent as MjolnirGestureEvent);\n break;\n\n case 'dblclick':\n mockEvent.type = 'click';\n mockEvent.tapCount = 2;\n deck._onEvent(mockEvent as MjolnirGestureEvent);\n break;\n\n case 'mousemove':\n mockEvent.type = 'pointermove';\n deck._onPointerMove(mockEvent as MjolnirPointerEvent);\n break;\n\n case 'mouseout':\n mockEvent.type = 'pointerleave';\n deck._onPointerMove(mockEvent as MjolnirPointerEvent);\n break;\n\n default:\n return;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACKA,uBAA+B;AAC/B,mBAA0B;;;ACD1B,kBAA4B;AAC5B,IAAAA,eAA+B;
|
|
4
|
+
"sourcesContent": ["// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {default as GoogleMapsOverlay} from './google-maps-overlay';\nexport type {GoogleMapsOverlayProps} from './google-maps-overlay';\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* global google */\nimport {GL, GLParameters} from '@luma.gl/constants';\nimport {WebGLDevice} from '@luma.gl/webgl';\nimport {\n createDeckInstance,\n destroyDeckInstance,\n getViewPropsFromOverlay,\n getViewPropsFromCoordinateTransformer,\n POSITIONING_CONTAINER_ID\n} from './utils';\nimport {Deck} from '@deck.gl/core';\n\nimport type {DeckProps, MapViewState} from '@deck.gl/core';\nimport type {Device} from '@luma.gl/core';\nconst HIDE_ALL_LAYERS = () => false;\nconst GL_STATE: GLParameters = {\n depthMask: true,\n depthTest: true,\n blend: true,\n blendFunc: [GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ONE, GL.ONE_MINUS_SRC_ALPHA],\n blendEquation: GL.FUNC_ADD\n};\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() {}\n\nconst defaultProps = {\n interleaved: true\n};\n\nexport type GoogleMapsOverlayProps = Omit<\n DeckProps,\n | 'width'\n | 'height'\n | 'gl'\n | 'deviceProps'\n | 'parent'\n | 'canvas'\n | '_customRender'\n | 'viewState'\n | 'initialViewState'\n | 'controller'\n> & {\n interleaved?: boolean;\n};\n\nexport default class GoogleMapsOverlay {\n private props: GoogleMapsOverlayProps = {};\n private _map: google.maps.Map | null = null;\n private _deck: Deck | null = null;\n private _overlay: google.maps.WebGLOverlayView | google.maps.OverlayView | null = null;\n private _positioningOverlay: google.maps.OverlayView | null = null;\n\n constructor(props: GoogleMapsOverlayProps) {\n this.setProps({...defaultProps, ...props});\n }\n\n /* Public API */\n\n /** Add/remove the overlay from a map. */\n setMap(map: google.maps.Map | null): void {\n if (map === this._map) {\n return;\n }\n\n const {VECTOR, UNINITIALIZED} = google.maps.RenderingType;\n if (this._map) {\n if (!map && this._map.getRenderingType() === VECTOR && this.props.interleaved) {\n (this._overlay as google.maps.WebGLOverlayView).requestRedraw();\n }\n this._overlay?.setMap(null);\n this._positioningOverlay?.setMap(null);\n this._map = null;\n }\n if (map) {\n this._map = map;\n const renderingType = map.getRenderingType();\n if (renderingType !== UNINITIALIZED) {\n this._createOverlay(map);\n } else {\n map.addListener('renderingtype_changed', () => {\n this._createOverlay(map);\n });\n }\n }\n }\n\n /**\n * Update (partial) props.\n */\n setProps(props: Partial<GoogleMapsOverlayProps>): void {\n Object.assign(this.props, props);\n if (this._deck) {\n const canvas = this._deck.getCanvas();\n if (props.style && canvas?.parentElement) {\n const parentStyle = canvas.parentElement.style;\n Object.assign(parentStyle, props.style);\n props.style = null;\n }\n this._deck.setProps(props);\n }\n }\n\n /** Equivalent of `deck.pickObject`. */\n pickObject(params) {\n return this._deck && this._deck.pickObject(params);\n }\n\n /** Equivalent of `deck.pickObjects`. */\n pickMultipleObjects(params) {\n return this._deck && this._deck.pickMultipleObjects(params);\n }\n\n /** Equivalent of `deck.pickMultipleObjects`. */\n pickObjects(params) {\n return this._deck && this._deck.pickObjects(params);\n }\n\n /** Remove the overlay and release all underlying resources. */\n finalize() {\n this.setMap(null);\n if (this._deck) {\n destroyDeckInstance(this._deck);\n this._deck = null;\n }\n }\n\n /* Private API */\n _createOverlay(map: google.maps.Map) {\n const {VECTOR, UNINITIALIZED} = google.maps.RenderingType;\n const renderingType = map.getRenderingType();\n if (renderingType === UNINITIALIZED) {\n return;\n }\n\n const isVectorMap = renderingType === VECTOR && google.maps.WebGLOverlayView;\n if (isVectorMap) {\n this._createOverlayVector(map);\n } else {\n this._createOverlayRaster(map);\n }\n }\n\n /**\n * Create overlays for vector maps.\n * Uses OverlayView for DOM positioning (correct z-index) and\n * WebGLOverlayView for camera data (smooth animations).\n * In interleaved mode, WebGLOverlayView also provides the shared GL context.\n */\n _createOverlayVector(map: google.maps.Map) {\n const interleaved = this.props.interleaved ?? defaultProps.interleaved;\n // Create positioning overlay for proper DOM placement\n const positioningOverlay = new google.maps.OverlayView();\n positioningOverlay.onAdd = this._onAddVectorOverlay.bind(this);\n positioningOverlay.draw = this._updateContainerSize.bind(this);\n positioningOverlay.onRemove = this._onRemove.bind(this);\n this._positioningOverlay = positioningOverlay;\n this._positioningOverlay.setMap(map);\n\n // Create WebGL overlay for camera data (and GL context if interleaved)\n const overlay = new google.maps.WebGLOverlayView();\n overlay.onAdd = noop;\n overlay.onContextRestored = interleaved ? this._onContextRestored.bind(this) : noop;\n overlay.onDraw = this._onDrawVector.bind(this);\n overlay.onContextLost = interleaved ? this._onContextLost.bind(this) : noop;\n overlay.onRemove = interleaved ? this._onRemove.bind(this) : noop;\n this._overlay = overlay;\n this._overlay.setMap(map);\n }\n\n _createOverlayRaster(map: google.maps.Map) {\n // Raster maps use standard OverlayView\n const overlay = new google.maps.OverlayView();\n overlay.onAdd = this._onAdd.bind(this);\n overlay.draw = this._onDrawRaster.bind(this);\n overlay.onRemove = this._onRemove.bind(this);\n this._overlay = overlay;\n this._overlay.setMap(map);\n }\n\n _onAdd() {\n // @ts-ignore (TS2345) map is defined at this stage\n this._deck = createDeckInstance(this._map, this._overlay, this._deck, this.props);\n }\n\n _onAddVectorOverlay() {\n // For non-interleaved vector maps, create a positioning container\n // that Google Maps will place correctly in the DOM with proper z-index\n const overlay = this._positioningOverlay as google.maps.OverlayView;\n const panes = overlay.getPanes();\n if (panes) {\n const container = document.createElement('div');\n container.id = POSITIONING_CONTAINER_ID;\n container.style.position = 'absolute';\n panes.overlayLayer.appendChild(container);\n }\n\n // @ts-ignore (TS2345) map is defined at this stage\n // Pass the positioning overlay for deck canvas creation (not WebGL overlay)\n this._deck = createDeckInstance(this._map, overlay, this._deck, this.props);\n }\n\n _updateContainerSize() {\n // Update positioning container size and position to match map\n if (!this._map) return;\n\n const container = this._map\n .getDiv()\n .querySelector(`#${POSITIONING_CONTAINER_ID}`) as HTMLElement;\n if (!container) return;\n\n const mapContainer = this._map.getDiv().firstChild as HTMLElement;\n if (!mapContainer) return;\n\n const width = mapContainer.offsetWidth;\n const height = mapContainer.offsetHeight;\n\n container.style.width = `${width}px`;\n container.style.height = `${height}px`;\n // Position at top-left (overlayLayer uses centered coords, so offset by half)\n container.style.left = `${-width / 2}px`;\n container.style.top = `${-height / 2}px`;\n }\n\n _onContextRestored({gl}) {\n if (!this._map || !this._overlay) {\n return;\n }\n const _customRender = () => {\n if (this._overlay) {\n (this._overlay as google.maps.WebGLOverlayView).requestRedraw();\n }\n };\n const deck = createDeckInstance(this._map, this._overlay, this._deck, {\n gl,\n _customRender,\n ...this.props\n });\n this._deck = deck;\n\n // By default, animationLoop._renderFrame invokes\n // animationLoop.onRender. We override this to wrap\n // in withParameters so we don't modify the GL state\n // @ts-ignore accessing protected member\n const animationLoop = deck.animationLoop!;\n animationLoop._renderFrame = () => {\n const ab = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n // @ts-expect-error accessing protected member\n const device: Device = deck.device;\n device.withParametersWebGL({}, () => {\n animationLoop.props.onRender(animationLoop.animationProps!);\n });\n gl.bindBuffer(gl.ARRAY_BUFFER, ab);\n };\n }\n\n _onContextLost() {\n // TODO this isn't working\n if (this._deck) {\n destroyDeckInstance(this._deck);\n this._deck = null;\n }\n }\n\n _onRemove() {\n this._deck?.setProps({layerFilter: HIDE_ALL_LAYERS});\n }\n\n _onDrawRaster() {\n if (!this._deck || !this._map) {\n return;\n }\n const deck = this._deck;\n\n const {width, height, left, top, ...rest} = getViewPropsFromOverlay(\n this._map,\n this._overlay as google.maps.OverlayView\n );\n\n const canvas = deck.getCanvas();\n const parent = canvas?.parentElement || deck.props.parent;\n if (parent) {\n const parentStyle = parent.style;\n parentStyle.left = `${left}px`;\n parentStyle.top = `${top}px`;\n }\n\n const altitude = 10000;\n deck.setProps({\n width,\n height,\n // @ts-expect-error altitude is accepted by WebMercatorViewport but not exposed by type\n viewState: {altitude, ...rest} as MapViewState\n });\n // Deck is initialized\n deck.redraw();\n }\n\n _onDrawVector({gl, transformer}) {\n if (!this._deck || !this._map) {\n return;\n }\n\n const deck = this._deck;\n const {interleaved} = this.props;\n\n deck.setProps({\n ...getViewPropsFromCoordinateTransformer(this._map, transformer),\n // Using external gl context - do not set css size\n ...(interleaved && {width: null, height: null})\n });\n\n if (interleaved && deck.isInitialized) {\n // @ts-expect-error\n const device: Device = deck.device;\n\n // As an optimization, some renders are to an separate framebuffer\n // which we need to pass onto deck\n if (device instanceof WebGLDevice) {\n const _framebuffer = device.getParametersWebGL(GL.FRAMEBUFFER_BINDING);\n deck.setProps({_framebuffer});\n }\n\n // Camera changed, will trigger a map repaint right after this\n // Clear any change flag triggered by setting viewState so that deck does not request\n // a second repaint\n deck.needsRedraw({clearRedrawFlags: true});\n\n // Workaround for bug in Google maps where viewport state is wrong\n // TODO remove once fixed\n if (device instanceof WebGLDevice) {\n device.setParametersWebGL({\n viewport: [0, 0, gl.canvas.width, gl.canvas.height],\n scissor: [0, 0, gl.canvas.width, gl.canvas.height],\n stencilFunc: [gl.ALWAYS, 0, 255, gl.ALWAYS, 0, 255]\n });\n\n device.withParametersWebGL(GL_STATE, () => {\n deck._drawLayers('google-vector', {\n clearCanvas: false\n });\n });\n }\n } else if (!interleaved) {\n deck.redraw();\n }\n }\n}\n", "// deck.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/* global google, document */\nimport {Deck, MapView} from '@deck.gl/core';\nimport {Matrix4, Vector2} from '@math.gl/core';\nimport type {MjolnirGestureEvent, MjolnirPointerEvent} from 'mjolnir.js';\nexport const POSITIONING_CONTAINER_ID = 'deck-gl-google-maps-container';\n\n// https://en.wikipedia.org/wiki/Web_Mercator_projection#Formulas\nconst MAX_LATITUDE = 85.05113;\n\ntype UserData = {\n _googleMap: google.maps.Map;\n _eventListeners: Record<string, google.maps.MapsEventListener | null>;\n};\n\n/**\n * Get a new deck instance\n * @param map (google.maps.Map) - The parent Map instance\n * @param overlay (google.maps.OverlayView) - A maps Overlay instance\n * @param [deck] (Deck) - a previously created instances\n */\nexport function createDeckInstance(\n map: google.maps.Map,\n overlay: google.maps.OverlayView | google.maps.WebGLOverlayView,\n deck: Deck | null | undefined,\n props\n): Deck {\n if (deck) {\n if (deck.userData._googleMap === map) {\n return deck;\n }\n // deck instance was created for a different map\n destroyDeckInstance(deck);\n }\n\n const eventListeners = {\n click: null,\n rightclick: null,\n dblclick: null,\n mousemove: null,\n mouseout: null\n };\n\n const newDeck = new Deck({\n ...props,\n // Default to true for high-DPI displays, but allow user override\n useDevicePixels: props.useDevicePixels ?? true,\n style: props.interleaved ? null : {pointerEvents: 'none'},\n parent: getContainer(overlay, props.style),\n views: new MapView({repeat: true}),\n initialViewState: {\n longitude: 0,\n latitude: 0,\n zoom: 1\n },\n controller: false\n });\n\n // Register event listeners\n for (const eventType in eventListeners) {\n eventListeners[eventType] = map.addListener(eventType, evt =>\n handleMouseEvent(newDeck, eventType, evt)\n );\n }\n\n // Attach userData directly to Deck instance\n (newDeck.userData as UserData)._googleMap = map;\n (newDeck.userData as UserData)._eventListeners = eventListeners;\n\n return newDeck;\n}\n\n// Create a container that will host the deck canvas and tooltip\nfunction getContainer(\n overlay: google.maps.OverlayView | google.maps.WebGLOverlayView,\n style?: Partial<CSSStyleDeclaration>\n): HTMLElement {\n const container = document.createElement('div');\n container.style.position = 'absolute';\n Object.assign(container.style, style);\n\n const googleMapsContainer = (overlay.getMap() as google.maps.Map).getDiv();\n\n // Check if there's a pre-created positioning container (for vector maps)\n const positioningContainer = googleMapsContainer.querySelector(`#${POSITIONING_CONTAINER_ID}`);\n\n if (positioningContainer) {\n // Vector maps (both interleaved and non-interleaved): Use positioning container\n positioningContainer.appendChild(container);\n } else if ('getPanes' in overlay) {\n // Raster maps: Append to overlayLayer pane\n overlay.getPanes()?.overlayLayer.appendChild(container);\n }\n return container;\n}\n\n/**\n * Safely remove a deck instance\n * @param deck (Deck) - a previously created instances\n */\nexport function destroyDeckInstance(deck: Deck) {\n const {_eventListeners: eventListeners} = deck.userData;\n\n // Unregister event listeners\n for (const eventType in eventListeners) {\n // Check that event listener was set before trying to remove.\n if (eventListeners[eventType]) {\n eventListeners[eventType].remove();\n }\n }\n\n deck.finalize();\n}\n\n/* eslint-disable max-statements */\n/**\n * Get the current view state\n * @param map (google.maps.Map) - The parent Map instance\n * @param overlay (google.maps.OverlayView) - A maps Overlay instance\n */\n// eslint-disable-next-line complexity\nexport function getViewPropsFromOverlay(map: google.maps.Map, overlay: google.maps.OverlayView) {\n const {width, height} = getMapSize(map);\n\n // Canvas position relative to draggable map's container depends on\n // overlayView's projection, not the map's. Have to use the center of the\n // map for this, not the top left, for the same reason as above.\n const projection = overlay.getProjection();\n\n const bounds = map.getBounds();\n if (!bounds) {\n return {width, height, left: 0, top: 0};\n }\n\n const ne = bounds.getNorthEast();\n const sw = bounds.getSouthWest();\n const topRight = projection.fromLatLngToDivPixel(ne);\n const bottomLeft = projection.fromLatLngToDivPixel(sw);\n\n // google maps places overlays in a container anchored at the map center.\n // the container CSS is manipulated during dragging.\n // We need to update left/top of the deck canvas to match the base map.\n const centerLngLat = pixelToLngLat(projection, width / 2, height / 2);\n const centerH = new google.maps.LatLng(0, centerLngLat[0]);\n const centerContainerPx = projection.fromLatLngToContainerPixel(centerH);\n const centerDivPx = projection.fromLatLngToDivPixel(centerH);\n\n if (!topRight || !bottomLeft || !centerDivPx || !centerContainerPx) {\n return {width, height, left: 0, top: 0};\n }\n const leftOffset = Math.round(centerDivPx.x - centerContainerPx.x);\n let topOffset = centerDivPx.y - centerContainerPx.y;\n\n const topLngLat = pixelToLngLat(projection, width / 2, 0);\n const bottomLngLat = pixelToLngLat(projection, width / 2, height);\n\n // Compute fractional center.\n let latitude = centerLngLat[1];\n const longitude = centerLngLat[0];\n\n // Adjust vertical offset - limit latitude\n if (Math.abs(latitude) > MAX_LATITUDE) {\n latitude = latitude > 0 ? MAX_LATITUDE : -MAX_LATITUDE;\n const center = new google.maps.LatLng(latitude, longitude);\n const centerPx = projection.fromLatLngToContainerPixel(center);\n // @ts-ignore (TS2531) Object is possibly 'null'\n topOffset += centerPx.y - height / 2;\n }\n topOffset = Math.round(topOffset);\n\n // Compute fractional bearing\n const delta = new Vector2(topLngLat).sub(bottomLngLat);\n let bearing = (180 * delta.verticalAngle()) / Math.PI;\n if (bearing < 0) bearing += 360;\n\n // Maps sometimes returns undefined instead of 0\n const heading = map.getHeading() || 0;\n\n let zoom = (map.getZoom() as number) - 1;\n\n let scale;\n\n if (bearing === 0) {\n // At full world view (always unrotated) simply compare height, as diagonal\n // is incorrect due to multiple world copies\n scale = height ? (bottomLeft.y - topRight.y) / height : 1;\n } else if (bearing === heading) {\n // Fractional zoom calculation only correct when bearing is not animating\n const viewDiagonal = new Vector2([topRight.x, topRight.y])\n .sub([bottomLeft.x, bottomLeft.y])\n .len();\n const mapDiagonal = new Vector2([width, -height]).len();\n scale = mapDiagonal ? viewDiagonal / mapDiagonal : 1;\n }\n\n // When resizing aggressively, occasionally ne and sw are the same points\n // See https://github.com/visgl/deck.gl/issues/4218\n zoom += Math.log2(scale || 1);\n\n return {\n width,\n height,\n left: leftOffset,\n top: topOffset,\n zoom,\n bearing,\n pitch: map.getTilt(),\n latitude,\n longitude\n };\n}\n\n/* eslint-enable max-statements */\n\n/**\n * Get the current view state\n * @param map (google.maps.Map) - The parent Map instance\n * @param transformer (google.maps.CoordinateTransformer) - A CoordinateTransformer instance\n */\nexport function getViewPropsFromCoordinateTransformer(\n map: google.maps.Map,\n transformer: google.maps.CoordinateTransformer\n) {\n const {width, height} = getMapSize(map);\n const {center, heading: bearing, tilt: pitch, zoom} = transformer.getCameraParams();\n\n // Match Google projection matrix\n const fovy = 25;\n const aspect = height ? width / height : 1;\n\n // Match depth range (crucial for correct z-sorting)\n const near = 0.75;\n const far = 300000000000000;\n // const far = Infinity;\n\n const projectionMatrix = new Matrix4().perspective({\n fovy: (fovy * Math.PI) / 180,\n aspect,\n near,\n far\n });\n const focalDistance = 0.5 * projectionMatrix[5];\n\n return {\n width,\n height,\n viewState: {\n altitude: focalDistance,\n bearing,\n latitude: center.lat(),\n longitude: center.lng(),\n pitch,\n projectionMatrix,\n repeat: true,\n zoom: zoom - 1\n }\n };\n}\n\nfunction getMapSize(map: google.maps.Map): {width: number; height: number} {\n // The map fills the container div unless it's in fullscreen mode\n // at which point the first child of the container is promoted\n const container = map.getDiv().firstChild as HTMLElement | null;\n return {\n // @ts-ignore (TS2531) Object is possibly 'null'\n width: container.offsetWidth,\n // @ts-ignore (TS2531) Object is possibly 'null'\n height: container.offsetHeight\n };\n}\n\nfunction pixelToLngLat(\n projection: google.maps.MapCanvasProjection,\n x: number,\n y: number\n): [longitude: number, latitude: number] {\n const point = new google.maps.Point(x, y);\n const latLng = projection.fromContainerPixelToLatLng(point);\n // @ts-ignore (TS2531) Object is possibly 'null'\n return [latLng.lng(), latLng.lat()];\n}\n\nfunction getEventPixel(event, deck: Deck): {x: number; y: number} {\n if (event.pixel) {\n return event.pixel;\n }\n // event.pixel may not exist when clicking on a POI\n // https://developers.google.com/maps/documentation/javascript/reference/map#MouseEvent\n const point = deck.getViewports()[0].project([event.latLng.lng(), event.latLng.lat()]);\n return {\n x: point[0],\n y: point[1]\n };\n}\n\n// Triggers picking on a mouse event\nfunction handleMouseEvent(deck: Deck, type: string, event) {\n if (!deck.isInitialized) {\n return;\n }\n\n const mockEvent: Record<string, any> = {\n type,\n offsetCenter: getEventPixel(event, deck),\n srcEvent: event\n };\n\n switch (type) {\n case 'click':\n case 'rightclick':\n mockEvent.type = 'click';\n mockEvent.tapCount = 1;\n // Hack: because we do not listen to pointer down, perform picking now\n deck._onPointerDown(mockEvent as MjolnirPointerEvent);\n deck._onEvent(mockEvent as MjolnirGestureEvent);\n break;\n\n case 'dblclick':\n mockEvent.type = 'click';\n mockEvent.tapCount = 2;\n deck._onEvent(mockEvent as MjolnirGestureEvent);\n break;\n\n case 'mousemove':\n mockEvent.type = 'pointermove';\n deck._onPointerMove(mockEvent as MjolnirPointerEvent);\n break;\n\n case 'mouseout':\n mockEvent.type = 'pointerleave';\n deck._onPointerMove(mockEvent as MjolnirPointerEvent);\n break;\n\n default:\n return;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACKA,uBAA+B;AAC/B,mBAA0B;;;ACD1B,kBAA4B;AAC5B,IAAAA,eAA+B;AAExB,IAAM,2BAA2B;AAGxC,IAAM,eAAe;AAaf,SAAU,mBACd,KACA,SACA,MACA,OAAK;AAEL,MAAI,MAAM;AACR,QAAI,KAAK,SAAS,eAAe,KAAK;AACpC,aAAO;IACT;AAEA,wBAAoB,IAAI;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C9B;AAKA,WAAK,YAAY,EAAC,kBAAkB,KAAI,CAAC;AAIzC,UAAI,kBAAkB,0BAAa;AACjC,eAAO,mBAAmB;UACxB,UAAU,CAAC,GAAG,GAAG,GAAG,OAAO,OAAO,GAAG,OAAO,MAAM;UAClD,SAAS,CAAC,GAAG,GAAG,GAAG,OAAO,OAAO,GAAG,OAAO,MAAM;UACjD,aAAa,CAAA,KAAY,GAAG,KAAG,KAAa,GAAG,GAAG;SACnD;AAED,eAAO,oBAAoB,UAAU,MAAK;AACxC,eAAK,YAAY,iBAAiB;YAChC,aAAa;WACd;QACH,CAAC;MACH;IACF,WAAW,CAAC,aAAa;AACvB,WAAK,OAAM;IACb;EACF;;",
|
|
6
6
|
"names": ["import_core"]
|
|
7
7
|
}
|
package/dist/utils.d.ts
CHANGED
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,IAAI,EAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAU,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,IAAI,EAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAU,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AAUxE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EACpB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAC/D,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,EAC7B,KAAK,KAAA,GACJ,IAAI,CA4CN;AA0BD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,QAY7C;AAGD;;;;GAIG;AAEH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;EAyF7F;AAID;;;;GAIG;AACH,wBAAgB,qCAAqC,CACnD,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EACpB,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB;;;;;;;;;;;;;EAoC/C"}
|
package/dist/utils.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
/* global google, document */
|
|
5
5
|
import { Deck, MapView } from '@deck.gl/core';
|
|
6
6
|
import { Matrix4, Vector2 } from '@math.gl/core';
|
|
7
|
+
export const POSITIONING_CONTAINER_ID = 'deck-gl-google-maps-container';
|
|
7
8
|
// https://en.wikipedia.org/wiki/Web_Mercator_projection#Formulas
|
|
8
9
|
const MAX_LATITUDE = 85.05113;
|
|
9
10
|
/**
|
|
@@ -29,7 +30,8 @@ export function createDeckInstance(map, overlay, deck, props) {
|
|
|
29
30
|
};
|
|
30
31
|
const newDeck = new Deck({
|
|
31
32
|
...props,
|
|
32
|
-
|
|
33
|
+
// Default to true for high-DPI displays, but allow user override
|
|
34
|
+
useDevicePixels: props.useDevicePixels ?? true,
|
|
33
35
|
style: props.interleaved ? null : { pointerEvents: 'none' },
|
|
34
36
|
parent: getContainer(overlay, props.style),
|
|
35
37
|
views: new MapView({ repeat: true }),
|
|
@@ -54,13 +56,16 @@ function getContainer(overlay, style) {
|
|
|
54
56
|
const container = document.createElement('div');
|
|
55
57
|
container.style.position = 'absolute';
|
|
56
58
|
Object.assign(container.style, style);
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const googleMapsContainer = overlay.getMap().getDiv();
|
|
60
|
+
// Check if there's a pre-created positioning container (for vector maps)
|
|
61
|
+
const positioningContainer = googleMapsContainer.querySelector(`#${POSITIONING_CONTAINER_ID}`);
|
|
62
|
+
if (positioningContainer) {
|
|
63
|
+
// Vector maps (both interleaved and non-interleaved): Use positioning container
|
|
64
|
+
positioningContainer.appendChild(container);
|
|
61
65
|
}
|
|
62
|
-
else {
|
|
63
|
-
|
|
66
|
+
else if ('getPanes' in overlay) {
|
|
67
|
+
// Raster maps: Append to overlayLayer pane
|
|
68
|
+
overlay.getPanes()?.overlayLayer.appendChild(container);
|
|
64
69
|
}
|
|
65
70
|
return container;
|
|
66
71
|
}
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,6BAA6B;AAC7B,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,6BAA6B;AAC7B,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AAExE,iEAAiE;AACjE,MAAM,YAAY,GAAG,QAAQ,CAAC;AAO9B;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,GAAoB,EACpB,OAA+D,EAC/D,IAA6B,EAC7B,KAAK;IAEL,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC;QACd,CA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