File tree Expand file tree Collapse file tree 8 files changed +13
-32
lines changed
editable-h3-cluster-layer Expand file tree Collapse file tree 8 files changed +13
-32
lines changed Original file line number Diff line number Diff line change 2
2
import * as React from 'react' ;
3
3
import DeckGL from '@deck.gl/react' ;
4
4
import { MapView , MapController } from '@deck.gl/core' ;
5
- import StaticMap from 'react-map-gl' ;
5
+ import StaticMap from 'react-map-gl/maplibre ' ;
6
6
import { GL } from '@luma.gl/constants' ;
7
7
import circle from '@turf/circle' ;
8
- import MapLibre from 'maplibre-gl' ;
9
8
10
9
import {
11
10
EditableGeoJsonLayer ,
@@ -829,7 +828,6 @@ export default class Example extends React.Component<
829
828
renderStaticMap ( viewport : Record < string , any > ) {
830
829
return (
831
830
< StaticMap
832
- mapLib = { MapLibre }
833
831
{ ...viewport }
834
832
mapStyle = { 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json' }
835
833
/>
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import DeckGL from '@deck.gl/react';
4
4
// TODO Enable eslint after package is published.
5
5
// eslint-disable-next-line import/named, import/no-extraneous-dependencies
6
6
import { HtmlOverlayItem , HtmlClusterOverlay } from '@deck.gl-community/react' ;
7
- import StaticMap from 'react-map-gl' ;
8
- import MapLibre from 'maplibre-gl' ;
7
+ import StaticMap from 'react-map-gl/maplibre' ;
9
8
10
9
const DATA_URL = 'https://cors-tube.vercel.app/?url=https://whc.unesco.org/en/list/georss/' ;
11
10
@@ -117,7 +116,7 @@ export class WorldHeritageApp extends React.Component {
117
116
render ( ) {
118
117
return (
119
118
< DeckGL initialViewState = { initialViewState } controller = { true } >
120
- < StaticMap mapLib = { MapLibre } />
119
+ < StaticMap />
121
120
{ this . renderWorldHeritage ( ) }
122
121
</ DeckGL >
123
122
) ;
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import DeckGL from '@deck.gl/react';
4
4
// TODO Enable eslint after package is published.
5
5
// eslint-disable-next-line import/named
6
6
import { HtmlOverlayItem , HtmlClusterOverlay } from '@deck.gl-community/react' ;
7
- import { StaticMap } from 'react-map-gl' ;
8
- import MapLibre from 'maplibre-gl' ;
7
+ import { StaticMap } from 'react-map-gl/maplibre' ;
9
8
10
9
const DATA_URL = 'https://cors-tube.vercel.app/?url=https://whc.unesco.org/en/list/georss/' ;
11
10
@@ -117,7 +116,7 @@ export class WorldHeritageApp extends React.Component {
117
116
render ( ) {
118
117
return (
119
118
< DeckGL initialViewState = { initialViewState } controller = { true } >
120
- < StaticMap mapLib = { MapLibre } />
119
+ < StaticMap />
121
120
{ this . renderWorldHeritage ( ) }
122
121
</ DeckGL >
123
122
) ;
Original file line number Diff line number Diff line change 8
8
DrawCircleFromCenterMode ,
9
9
DrawRectangleMode
10
10
} from '@deck.gl-community/editable-layers' ;
11
- import StaticMap from 'react-map-gl' ;
11
+ import StaticMap from 'react-map-gl/maplibre ' ;
12
12
import { hexagonCluster1 , hexagonCluster2 , hexagonCluster3 } from './data' ;
13
- import MapLibre from 'maplibre-gl' ;
14
13
15
14
const SELECTED_FILL_COLOR = [ 50 , 100 , 200 , 230 ] ;
16
15
const UNSELECTED_FILL_COLOR = [ 50 , 100 , 200 , 100 ] ;
@@ -195,10 +194,7 @@ export function Example() {
195
194
layers = { [ layer ] }
196
195
getCursor = { layer . getCursor . bind ( layer ) }
197
196
>
198
- < StaticMap
199
- mapLib = { MapLibre }
200
- mapStyle = { 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json' }
201
- />
197
+ < StaticMap mapStyle = { 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json' } />
202
198
</ DeckGL >
203
199
< Toolbar
204
200
{ ...{
Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import React, {useState} from 'react';
2
2
import DeckGL from '@deck.gl/react' ;
3
3
import { ViewMode , EditableGeoJsonLayer } from '@deck.gl-community/editable-layers' ;
4
4
import { Toolbox } from '@deck.gl-community/react-editable-layers' ;
5
- import StaticMap from 'react-map-gl' ;
6
- import MapLibre from 'maplibre-gl' ;
5
+ import StaticMap from 'react-map-gl/maplibre' ;
7
6
8
7
const initialViewState = {
9
8
longitude : - 122.43 ,
@@ -81,10 +80,7 @@ export function Example() {
81
80
}
82
81
} }
83
82
>
84
- < StaticMap
85
- mapLib = { MapLibre }
86
- mapStyle = { 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json' }
87
- />
83
+ < StaticMap mapStyle = { 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json' } />
88
84
</ DeckGL >
89
85
90
86
< Toolbox
Original file line number Diff line number Diff line change 1
1
import React , { useEffect , useState } from 'react' ;
2
2
import DeckGL from '@deck.gl/react' ;
3
- import StaticMap from 'react-map-gl' ;
3
+ import StaticMap from 'react-map-gl/maplibre ' ;
4
4
import { INITIAL_COORDS , INITIAL_VIEW_STATE } from './constants' ;
5
5
import { HtmlOverlay , HtmlOverlayItem } from '@deck.gl-community/react' ;
6
6
import type { WikipediaEntry } from './types' ;
7
- import MapLibre from 'maplibre-gl' ;
8
7
9
8
const styles = {
10
9
mapContainer : {
@@ -59,10 +58,7 @@ const Example = () => {
59
58
return (
60
59
< div style = { styles . mapContainer } >
61
60
< DeckGL initialViewState = { INITIAL_VIEW_STATE } controller = { true } >
62
- < StaticMap
63
- mapLib = { MapLibre }
64
- mapStyle = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
65
- />
61
+ < StaticMap mapStyle = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json" />
66
62
{ data ? (
67
63
< HtmlOverlay >
68
64
{ data . map ( ( feature ) => (
Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
- import StaticMap from 'react-map-gl' ;
2
+ import StaticMap from 'react-map-gl/maplibre ' ;
3
3
import CSS from 'csstype' ;
4
4
5
5
import DeckGL from '@deck.gl/react' ;
6
6
import { WebMercatorViewport } from '@deck.gl/core' ;
7
7
import { TextLayer } from '@deck.gl/layers' ;
8
- import MapLibre from 'maplibre-gl' ;
9
8
10
9
import {
11
10
NebulaCore ,
@@ -309,7 +308,6 @@ export default class Example extends React.Component<
309
308
< div style = { mapContainerStyle } >
310
309
< link href = "https://unpkg.com/maplibre-gl@^4.1.3/dist/maplibre-gl.css" rel = "stylesheet" />
311
310
< StaticMap
312
- mapLib = { MapLibre }
313
311
{ ...viewState }
314
312
mapStyle = { 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json' }
315
313
>
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import DeckGL from '@deck.gl/react' ;
3
- import { Map } from 'react-map-gl' ;
3
+ import { Map } from 'react-map-gl/maplibre ' ;
4
4
import styled from 'styled-components' ;
5
5
import { useColorMode } from '@docusaurus/theme-common' ;
6
6
import { MAPBOX_STYLES } from '../constants/defaults' ;
@@ -129,7 +129,6 @@ export function makeLayerDemo(config) {
129
129
{ mapStyle && (
130
130
< Map
131
131
reuseMaps
132
- mapLib = { import ( 'maplibre-gl' ) }
133
132
mapStyle = { mapStyleSheet }
134
133
preventStyleDiffing = { true }
135
134
/>
You can’t perform that action at this time.
0 commit comments