Skip to content

Fixing docs in response to react-map-gl named export change #9427

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

Merged
merged 12 commits into from
May 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api-reference/carto/basemap.md
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ npm install @deck.gl/core @deck.gl/layers @deck.gl/carto

```js
import {DeckGL} from '@deck.gl/react';
import {StaticMap} from 'react-map-gl';
import {Map} from 'react-map-gl/maplibre';
import {BASEMAP} from '@deck.gl/carto';
<DeckGL initialViewState={INITIAL_VIEW_STATE} controller={true} layers={layers}>
<StaticMap mapStyle={BASEMAP.POSITRON} />
2 changes: 1 addition & 1 deletion docs/api-reference/mapbox/mapbox-overlay.md
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ map.once('load', () => {

```tsx
import React from 'react';
import {Map, useControl} from 'react-map-gl';
import {Map, useControl} from 'react-map-gl/mapbox';
import {MapboxOverlay} from '@deck.gl/mapbox';
import {DeckProps} from '@deck.gl/core';
import {ScatterplotLayer} from '@deck.gl/layers';
4 changes: 2 additions & 2 deletions docs/developer-guide/base-maps/using-with-mapbox.md
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ map.once('load', () => {

```tsx
import React from 'react';
import {Map, useControl} from 'react-map-gl';
import {Map, useControl} from 'react-map-gl/mapbox';
import {MapboxOverlay} from '@deck.gl/mapbox';
import {DeckProps} from '@deck.gl/core';
import {ScatterplotLayer} from '@deck.gl/layers';
@@ -180,7 +180,7 @@ The reverse-controlled option is supported by the pre-built scripting bundle, an

```tsx
import React from 'react';
import {Map} from 'react-map-gl';
import {Map} from 'react-map-gl/mapbox';
import {DeckGL} from '@deck.gl/react';
import {ScatterplotLayer} from '@deck.gl/layers';
import 'mapbox-gl/dist/mapbox-gl.css';
2 changes: 1 addition & 1 deletion docs/get-started/using-with-react.md
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ import {DeckGL} from '@deck.gl/react';
import {MapViewState} from '@deck.gl/core';
import {LineLayer} from '@deck.gl/layers';
import {ZoomWidget} from '@deck.gl/react';
import {Map} from 'react-map-gl';
import {Map} from 'react-map-gl/mapbox';

const INITIAL_VIEW_STATE: MapViewState = {
longitude: -122.41669,
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import React, {useState, useRef, useCallback} from 'react';
import {createRoot} from 'react-dom/client';
import DeckGL, {ScatterplotLayer, ArcLayer, TextLayer} from 'deck.gl';
import {Map} from 'react-map-gl';
import {Map} from 'react-map-gl/mapbox';

import MapboxLayer from '../../../../modules/mapbox/src/mapbox-layer';


Unchanged files with check annotations Beta

type Properties = BinaryPointFeature['properties'];
type LineInfo = {index: number; length: number};
export function createPointsFromLines(

Check warning on line 11 in modules/carto/src/layers/label-utils.ts

GitHub Actions / test-node

Function 'createPointsFromLines' has too many statements (31). Maximum allowed is 25
lines: BinaryLineFeature,
uniqueIdProperty?: string
): BinaryPointFeature | null {
// Second pass: create points for the longest line of each unique ID
let pointIndex = 0;
for (const [_, {index}] of idToLineInfo) {

Check warning on line 48 in modules/carto/src/layers/label-utils.ts

GitHub Actions / test-node

'_' is assigned a value but never used
const midpoint = getLineMidpoint(lines, index);
positions.push(...midpoint);
*
* @returns true if data was aggregated, false if cache used
*/
export function aggregateTile<FeaturePropertiesT>(

Check warning on line 29 in modules/carto/src/layers/cluster-utils.ts

GitHub Actions / test-node

Function 'aggregateTile' has a complexity of 18. Maximum allowed is 11

Check warning on line 29 in modules/carto/src/layers/cluster-utils.ts

GitHub Actions / test-node

Function 'aggregateTile' has too many statements (36). Maximum allowed is 25

Check warning on line 29 in modules/carto/src/layers/cluster-utils.ts

GitHub Actions / test-node

Function 'aggregateTile' has too many parameters (6). Maximum allowed is 5
tile: Tile2DHeader<ParsedQuadbinTile<FeaturePropertiesT>>,
tileAggregationCache: Map<number, ClusteredFeaturePropertiesT<FeaturePropertiesT>[]>,
aggregationLevels: number,
...this.props,
id: 'clusters',
data: this.state.data,
dataComparator: (data?: BinaryFeatureCollection, oldData?: BinaryFeatureCollection) => {

Check warning on line 178 in modules/carto/src/layers/cluster-tile-layer.ts

GitHub Actions / test-node

'data' is already declared in the upper scope on line 138 column 11
const newIds = data?.points?.properties?.map((tile: any) => tile.id);
const oldIds = oldData?.points?.properties?.map((tile: any) => tile.id);
return deepEqual(newIds, oldIds, 1);
assert(dataset, `No dataset matching dataId: ${dataId}`);
const {data} = dataset;
assert(data, `No data loaded for dataId: ${dataId}`);
const {Layer, propMap, defaultProps} = getLayer(type, config, dataset);

Check warning on line 68 in modules/carto/src/api/parse-map.ts

GitHub Actions / test-node

'Layer' is already declared in the upper scope on line 8 column 9
const styleProps = createStyleProps(config, propMap);
return new Layer({
id,
if (type === 'point') {
const altitude = config.columns?.altitude;
if (altitude) {
result.dataTransform = data => {

Check warning on line 209 in modules/carto/src/api/parse-map.ts

GitHub Actions / test-node

'data' is already declared in the upper scope on line 163 column 3
data.features.forEach(({geometry, properties}) => {
const {type, coordinates} = geometry;

Check warning on line 211 in modules/carto/src/api/parse-map.ts

GitHub Actions / test-node

'type' is already declared in the upper scope on line 160 column 3
if (type === 'Point') {
coordinates[2] = properties[altitude];
}
return accessor(object.properties || object.__source.object.properties);
}
const {data, index} = info;

Check warning on line 315 in modules/carto/src/api/layer-map.ts

GitHub Actions / test-node

'data' is already declared in the upper scope on line 308 column 38
const proxy = createBinaryProxy(data, index);
return accessor(proxy);
};