Popup - react-map-gl
文章推薦指數: 80 %
A string indicating the part of the popup that should be positioned closest to the coordinate, set via longitude and latitude . If unset, the anchor will be ...
ChevronDownIntroductionIntroductionWhat'snewUpgradeGuideContributingtoreact-map-glChevronDownDeveloperGuideGetStartedAboutMapboxTokensStateManagementAddingCustomDataTipsandTricksChevronDownAPIReferencedefault(Map)AttributionControlFullscreenControlGeolocateControlLayerMapProviderMarkerNavigationControlPopupScaleControlSourceuseControluseMapTypesPopupPropertiesReactcomponentthatwrapsPopup.import*asReactfrom'react';
importMap,{Popup}from'react-map-gl';
functionApp(){
const[showPopup,setShowPopup]=React.useState(true);
return;
}Renderoptionsanchor:'center'|'left'|'right'|'top'|'bottom'|'top-left'|'top-right'|'bottom-left'|'bottom-right'|undefinedAstringindicatingthepartofthepopupthatshouldbepositionedclosesttothecoordinate,setvialongitudeandlatitude.
Ifunset,theanchorwillbedynamicallysettoensurethepopupfallswithinthemapcontainerwithapreferencefor'bottom'.className:stringSpace-separatedCSSclassnamestoaddtopopupcontainer.closeButton:booleanDefault:trueIftrue,aclosebuttonwillappearinthetoprightcornerofthepopup.closeOnClick:booleanDefault:trueIftrue,thepopupwillclosewhenthemapisclicked.closeOnMove:booleanDefault:falseIftrue,thepopupwillclosedwhenthemapmoves.focusAfterOpen:booleanDefault:trueIftrue,thepopupwilltrytofocusthefirstfocusableelementinsidethepopup.offset:number|PointLike|Record\
延伸文章資訊
- 1How to display Popups on a Mapbox Map in React
This tutorial will be covering how to display popups on a Mapbox map in a React app with the reac...
- 2React-map-gl Popups on hover also pops up if location on ...
I'm not sure why that's happening, but the Popup component seems to have an action associated wit...
- 3Popup - react-map-gl
A string indicating the part of the popup that should be positioned closest to the coordinate, se...
- 4How to display Popups on a Mapbox Map - Morioh
import ReactMapGL, {Marker, Popup } from 'react-map-gl'; const CustomPopup = ({index, marker, clo...
- 5React map gl popup - 財經貼文懶人包
Popup - react-map-gl - GitHub Pages。 This is a React equivalent of Mapbox's Popup Control, which ...