Skip to content

Commit

Permalink
[Upgrades] mapbox-gl to 3.5.2 (#470)
Browse files Browse the repository at this point in the history
Closes DG-163, DG-159

## What changed? Why?
Upgrades to the latest mapbox-gl version and removes the old typescript
package
  • Loading branch information
dgattey authored Aug 14, 2024
1 parent f0d73a6 commit f874a1f
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 43 deletions.
7 changes: 3 additions & 4 deletions packages/maps/mapbox-gl/Control.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { Map } from 'mapbox-gl';
import { useEffect, useMemo, useRef } from 'react';
import type { Root } from 'react-dom/client';
import { createRoot } from 'react-dom/client';
import { useControl } from 'react-map-gl';
import { useControl, type MapInstance } from 'react-map-gl';
import { useTheme } from '@mui/material';
import type { ControlContainerProps } from './ControlContainer';
import { ControlContainer } from './ControlContainer';
Expand All @@ -26,7 +25,7 @@ class DGControl {
/**
* What Mapbox uses for the map itself - needs to be named this
*/
_map: Map | undefined;
_map: MapInstance | undefined;

/**
* What Mapbox uses for the container for the element we're adding -
Expand Down Expand Up @@ -56,7 +55,7 @@ class DGControl {
* Creates a new div that holds a `ControlContainer` for the contents. Pass
* onClick if there are not multiple children.
*/
onAdd(map: Map) {
onAdd(map: MapInstance) {
this._map = map;
this._container?.parentNode?.removeChild(this._container);
this._container = document.createElement('div');
Expand Down
3 changes: 1 addition & 2 deletions packages/maps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
"dependencies": {
"@mui/material": "5.16.7",
"api": "workspace:*",
"mapbox-gl": "3.0.1",
"lucide-react": "0.427.0",
"mapbox-gl": "3.5.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-map-gl": "7.1.7",
"shared-core": "workspace:*",
"ui": "workspace:*"
},
"devDependencies": {
"@types/mapbox-gl": "2.7.19",
"@types/node": "22.2.0",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
Expand Down
110 changes: 73 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f874a1f

Please sign in to comment.