Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
react-map-gl-geocoder
Advanced tools
React wrapper for mapbox-gl-geocoder for use with react-map-gl.
https://codesandbox.io/s/vv29y730q3
NPM
$ npm install react-map-gl-geocoder
or
Yarn
$ yarn add react-map-gl-geocoder
import 'mapbox-gl/dist/mapbox-gl.css'
import React, { Component } from 'react'
import MapGL from 'react-map-gl'
import { getAccessToken } from 'react-map-gl/dist/mapbox/mapbox'
import Geocoder from 'react-map-gl-geocoder'
// Ways to set Mapbox token: https://uber.github.io/react-map-gl/#/Documentation/getting-started/about-mapbox-tokens
const MAPBOX_TOKEN = getAccessToken()
class Example extends Component {
state = {
viewport: {
width: 400,
height: 400,
latitude: 37.7577,
longitude: -122.4376,
zoom: 8
}
}
mapRef = React.createRef()
componentDidMount() {
window.addEventListener('resize', this._resize.bind(this))
this._resize()
}
_resize() {
this._onViewportChange({
width: window.innerWidth,
height: window.innerHeight
})
}
_onViewportChange = (viewport) => {
this.setState({
viewport: { ...this.state.viewport, ...viewport }
})
}
render() {
return (
<MapGL
ref={this.mapRef}
{...this.state.viewport}
onViewportChange={this._onViewportChange}
mapboxApiAccessToken={MAPBOX_TOKEN}>
<Geocoder mapRef={this.mapRef} mapboxApiAccessToken={MAPBOX_TOKEN} />
</MapGL>
)
}
}
export default Example
FAQs
React wrapper for mapbox-gl-geocoder for use with react-map-gl
The npm package react-map-gl-geocoder receives a total of 2,813 weekly downloads. As such, react-map-gl-geocoder popularity was classified as popular.
We found that react-map-gl-geocoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.