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
延伸文章資訊
- 1react-map-gl - npm
React components for Mapbox GL JS-compatible libraries. Latest version: 7.0.16, last published: 6...
- 2Dynamically changing the layer order is not possible #939
Hello, In my use case I have a list of layers whose order can be messed up with. I made this sand...
- 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-draw - npm
A lite version editing layer with react. Latest version: 1.0.3, last published: 2 months ago. Sta...
- 5MAP integration in React with react-map-gl and deck-gl