Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] GoogleMapsOverlay misaligns layers with raster basemap in initial render #8891

Closed
1 of 7 tasks
zbigg opened this issue May 13, 2024 · 0 comments · Fixed by #8892
Closed
1 of 7 tasks

[Bug] GoogleMapsOverlay misaligns layers with raster basemap in initial render #8891

zbigg opened this issue May 13, 2024 · 0 comments · Fixed by #8892
Labels

Comments

@zbigg
Copy link
Collaborator

zbigg commented May 13, 2024

Description

GoogleMapsOverlay shows data in wrong position in initial render when rendering on top of raster basemap.

actual:
image

(note screenshots and sample below on "free" google quota, same applies with proper, paid key)

Flavors

  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CartoLayer
  • ArcGIS

Expected Behavior

data: one "geo" rectantgle polygon with bounds more or less fitting mainland USA

expected:
image

Steps to Reproduce

Repro code (https://stackblitz.com/edit/vitejs-vite-prbtax?file=main.js,package.json,index.html&terminal=dev):

import { GoogleMapsOverlay } from '@deck.gl/google-maps';
import { Loader } from '@googlemaps/js-api-loader';
import { PolygonLayer } from '@deck.gl/layers';
(...)
  const loader = new Loader({ apiKey: GOOGLE_MAPS_API_KEY });
  const googlemaps = await loader.importLibrary('maps');

  const map = new googlemaps.Map(document.getElementById('map'), {
    mapTypeId: 'satellite',
    center: {
      lat: 43.291517478783575,
      lng: -88.24979240793371,
    },
    zoom: 3,
    tilt: 0,
    bearing: 0,
    disableDefaultUI: true,
  });

  const layers = [new PolygonLayer({
    id: 'PolygonLayer',
    data: [
      {
        id: 1,
        contour: [
          [-133.25358036092166, 49.255563717225385],
          [-133.25358036092166, 24.670835144274477],
          [-64.13509283629588, 24.670835144274477],
          [-64.13509283629588, 49.255563717225385],
          [-133.25358036092166, 49.255563717225385],
        ],
      },
    ],

    getPolygon: (d) => d.contour,
    getFillColor: (d) => [255, 0, 0, 125],
  })];
  const overlay = new GoogleMapsOverlay({ layers});
  overlay.setMap(map);

### Environment

- Framework version: 9.0.14
- Browser: Chrome
- OS: MacOS


### Logs

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant