react-mapbox-gl - npm
文章推薦指數: 80 %
A React binding of mapbox-gl-js. Latest version: 5.1.1, last published: 2 years ago. Start using react-mapbox-gl in your project by running ... react-mapbox-gl5.1.1 • Public • Published2yearsagoReadmeExploreBETA5Dependencies93Dependents142Versions React-mapbox-gl|Documentation|Demos Reactwrapperformapbox-gl-js. Components Proxycomponents(proxybetweenReactandMapboxAPI) ReactMapboxGL Layer&Feature propertysymboldisplaysamapboxsymbol. propertylinedisplaysalineString. propertyfilldisplaysapolygon. propertycircledisplaysamapboxcircle. propertyrasterdisplaysamapboxrastertiles. propertyfill-extrusiondisplaysalayerwithextrudedbuildings. propertybackgrounddisplaysamapboxbackgroundlayer. propertyheatmapdisplaysamapboxheatmaplayer. Source GeoJSONLayer DOMcomponents(normalReactcomponents) ZoomControl ScaleControl RotationControl Marker(Projectedcomponent) Popup(Projectedcomponent) Cluster GettingStarted npminstallreact-mapbox-glmapbox-gl--save Example: Addingthecssinyourindex.html:
... // ES6import ReactMapboxGl, { Layer, Feature } from 'react-mapbox-gl';import 'mapbox-gl/dist/mapbox-gl.css'; // ES5var ReactMapboxGl = require('react-mapbox-gl');var Layer = ReactMapboxGl.Layer;var Feature = ReactMapboxGl.Feature;require('mapbox-gl/dist/mapbox-gl.css'); const Map = ReactMapboxGl({ accessToken: 'pk.eyJ1IjoiZmFicmljOCIsImEiOiJjaWc5aTV1ZzUwMDJwdzJrb2w0dXRmc2d0In0.p6GGlfyV-WksaDV_KdN27A'}); // in render(); Whyarezoom,bearingandpitchArrays? Ifthosepropertieschangedatthemapbox-gl-jslevelandyoudon'tupdatethevaluekeptinyourstate,itwillbeunsyncedwiththecurrentviewport.Atsomepointyoumightwanttoupdatetheviewportvalue(zoom,pitchorbearing)withtheonesinyourstatebutusingvalueequalityisnotenough.Takingzoomasexample,youwillstillhavetheunsyncedzoomvaluethereforewecan'ttellifyouwanttoupdatethepropornot.Inordertoexplicitlyupdatethecurrentviewportvaluesyoucaninsteadbreakthereferencesofthosepropsandreliablyupdatethecurrentviewportwiththeoneyouhaveinyourstatetobesyncedagain. Currentversiondocumentation Version3.0documentation Version2.0documentation Contributions Pleasetrytoreproduceyourproblemwiththeboilerplatebeforepostinganissue. mapbox-gl-drawcompatibility Tryreact-mapbox-gl-draw LookingforanAngularalternative? Tryngx-mapbox-gl Keywordsmapboxreactmapwebglmapbox-glreact-componentInstallnpmireact-mapbox-glRepositoryGitgithub.com/alex3165/react-mapbox-glHomepagegithub.com/alex3165/react-mapbox-gl#readmeDownloadsWeeklyDownloads43,896Version5.1.1LicenseMITUnpackedSize496kBTotalFiles174Lastpublish2yearsagoCollaboratorsTryonRunKitReportmalware延伸文章資訊
- 1react-map-gl | Introduction
- 2Introduction To MapBox With React | MindBowser
Introduction To MapBox With React ... Mapbox is an American provider of custom online maps based ...
- 3Is there a way to use Mapbox GL JS for Free? - Stack Overflow
- 4Use Mapbox GL JS in a React App
Mapbox GL JS is part of the Mapbox GL ecosystem, which also provides native SDKs for Android, iOS...
- 5react-map-gl
Use Mapbox GL JS Map as a fully controlled reactive component. Extensible. Comes with additional ...