chore(legacy-plugin-chart-map-box): replace viewport-mercator-project with @math.gl/web-mercator (#30651)

This commit is contained in:
Birk Skyum
2024-11-24 21:00:26 +01:00
committed by GitHub
parent 33a9817388
commit e9e2c0bee8
3 changed files with 53 additions and 23 deletions

View File

@@ -21,7 +21,7 @@
import { Component } from 'react';
import PropTypes from 'prop-types';
import MapGL from 'react-map-gl';
import ViewportMercator from 'viewport-mercator-project';
import { WebMercatorViewport } from '@math.gl/web-mercator';
import ScatterPlotGlowOverlay from './ScatterPlotGlowOverlay';
import './MapBox.css';
@@ -63,7 +63,7 @@ class MapBox extends Component {
// Get a viewport that fits the given bounds, which all marks to be clustered.
// Derive lat, lon and zoom from this viewport. This is only done on initial
// render as the bounds don't update as we pan/zoom in the current design.
const mercator = new ViewportMercator({
const mercator = new WebMercatorViewport({
width,
height,
}).fitBounds(bounds);