Gathering detailed insights and metrics for react-mapbox-gl-spiderifier
Gathering detailed insights and metrics for react-mapbox-gl-spiderifier
Gathering detailed insights and metrics for react-mapbox-gl-spiderifier
Gathering detailed insights and metrics for react-mapbox-gl-spiderifier
npm install react-mapbox-gl-spiderifier
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
124 Commits
5 Forks
2 Watching
7 Branches
1 Contributors
Updated on 15 Aug 2024
JavaScript (85.77%)
CSS (8.21%)
HTML (6.02%)
Cumulative downloads
Total Downloads
Last day
281.8%
42
Compared to previous day
Last week
-4.8%
160
Compared to previous week
Last month
-9.5%
588
Compared to previous month
Last year
-28.5%
9,470
Compared to previous year
5
Rendering the spiderifier into react-mapbox-gl
as React
component.
Spiral/Circle positioning logic taken from and credits goes to https://github.com/jawj/OverlappingMarkerSpiderfier.
Please note that the ReactMapboxGlSpiderifier
should be used together with the React
wrapper of mapbox-gl
e.g. react-mapbox-gl
.
https://github.com/alex3165/react-mapbox-gl
1import ReactMapboxGl from 'react-mapbox-gl'; 2import { ReactMapboxGlSpiderifier } from 'react-mapbox-gl-spiderifier'; 3 4const Map = ReactMapboxGl({ 5 accessToken: '...', 6}); 7 8const mapProps = { 9 style: 'mapbox://styles/mapbox/streets-v8', 10}; 11 12class App extends Component { 13 onStyleLoad = (map) => { 14 this.map = map; 15 }; 16 17 renderPopup(properties, coordinates, offset) { 18 if (this.currentPopup) { 19 this.currentPopup.remove(); 20 } 21 22 setTimeout(() => { 23 this.currentPopup = new MapboxGl.Popup({ offset }) 24 .setLngLat(coordinates) 25 .setHTML(`Some description for node ${properties.value}`) 26 .addTo(this.map); 27 }); 28 } 29 30 renderSpiderifierContent(key, value) { 31 return ( 32 <div className="spiderifier-marker-content" key={key} properties={{ value }}> 33 <div>{value}</div> 34 </div> 35 ) 36 } 37 38 render() { 39 return ( 40 <div className="App"> 41 <Map {...mapProps} onStyleLoad={this.onStyleLoad}> 42 <ReactMapboxGlSpiderifier 43 coordinates={[-0.2268, 51.5361]} 44 onClick={(properties, coords, offset) => this.renderPopup(properties, coords, offset)} 45 > 46 {[100, 200, 300, 400, 500].((n, index) => this.renderSpiderifierContent(index, n))} 47 </ReactMapboxGlSpiderifier> 48 </Map> 49 </div> 50 ); 51 } 52}
coordinates ([number, number])
Display the Spiderifier at the given position
circleSpiralSwitchover (number)
Show spiral instead of circle from this marker count upwards, 0 -> always spiral; Infinity -> always circle
circleFootSeparation (number)
Related to circumference of circle
spiralFootSeparation (number)
Related to size of spiral
spiralLengthStart (number)
Related to size of spiral
spiralLengthFactor (number)
Related to size of spiral
animate (bool)
To enable animate the spiral
animationSpeed (number)
Animation speed in milliseconds
transformSpiderLeft (number)
The margin in left side of each spider
transformSpiderTop (number)
The margin in top of each spider
showingLegs (bool)
Indicate if the legs should be shown even when the spiderifier only have one spider element
onClick (function)
The click event handler
onMouseDown (function)
The mouse down event handler
onMouseEnter (function)
The mouse enter event handler
onMouseLeave (function)
The mouse leave event handler
onMouseMove (function)
The mouse move event handler
onMouseOut (function)
The mouse out event handler
onMouseOver (function)
The mouse over event handler
onMouseUp (function)
The mouse up event handler
react
, mapbox-gl
, react-mapbox-gl
,....env
fileREACT_APP_MAPBOX_GL_TOKEN
into the .env
fileyarn start
yarn upgrade-interactive --latest
yarn start
yarn build
package.json
README
npm publish
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
33 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More