Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
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} onViewportChange={this._onViewportChange} 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,403 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.