Layer - react-map-gl
文章推薦指數: 80 %
This component allows apps to create a map layer using React. import * as React from 'react'; import Map, {Layer} from 'react-map-gl'; const parkLayer ...
ChevronDownIntroductionIntroductionWhat'snewUpgradeGuideContributingtoreact-map-glChevronDownDeveloperGuideGetStartedAboutMapboxTokensStateManagementAddingCustomDataTipsandTricksChevronDownAPIReferencedefault(Map)AttributionControlFullscreenControlGeolocateControlLayerMapProviderMarkerNavigationControlPopupScaleControlSourceuseControluseMapTypesLayerThiscomponentallowsappstocreateamaplayerusingReact.import*asReactfrom'react';
importMap,{Layer}from'react-map-gl';
constparkLayer={
id:'landuse_park',
type:'fill',
source:'mapbox',
'source-layer':'landuse',
filter:['==','class','park'],
paint:{
'fill-color':'#4E3FC8'
}
};
functionApp(){
return;
}PropertiesThepropsprovidedtothiscomponentshouldbeconformingtotheMapboxlayerspecification.Whenpropschangeshallowly,thecomponentwillperformstylediffingtoupdatethelayer.Avoiddefiningconstantobjects/arraysinlinemayhelpperformance.IdentityPropertiesOncea
延伸文章資訊
- 1A Complete Guide to Sources and Layers in React and ...
We will use Mapbox GL JS and React to build an interactive map with several custom sources and la...
- 2Urbica React Mapbox GL JS - GitHub
React Component Library for Mapbox GL JS. Mapbox GL JS is a JavaScript library that renders inter...
- 3how can i add source and layer to my react-map-gl
i'm trying to add source and layers on my map and it's not rendering ... import ReactMapGL, {Sour...
- 4react-map-gl examples - CodeSandbox
Learn how to use react-map-gl by viewing and forking react-map-gl example apps on ... that provid...
- 5MAP integration in React with react-map-gl and deck-gl