Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
react-baidu-map
Advanced tools
react component to work with baidu javascript API which enables you search, pinch and more
react component to work with baidu javascript API which enables you search, pinch and more
$ npm install --save react-baidu-map
The following is an example to show how it works with a search input to get position of every marker from the map in real-time.
import { BaiduMap } from 'react-baidu-map';
class ExampleApp extends React.Component {
render() {
return (
<div>
<input onChange={this.onChange.bind(this)} />
<BaiduMap id="location" ref="location" style={{height: 300}}
onSelect={this.onSelect} />
</div>
);
}
onChange(event) {
this.refs.location.search(event.target.value);
}
onSelect(point) {
// point.lng
// point.lat
}
}
Before you start working on coding with Baidu API, you should add script to your main script:
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=your_key"></script>
id
{String} the id to create the map element in DOM tree, default value: "allmap".style
{Object} the style sheet to apply to the root element of this component.onSelect
{Function} this function will be fired when user click a marker and the info bubble is shown
point
{Point} the position of being clicked to some maker
lng
{String} the lng
of the point.lat
{String} the lat
of the point.search(text: string): void
Search by keyword from the created map context.
MIT Licensed and WeFlex Copyright
FAQs
react component to work with baidu javascript API which enables you search, pinch and more
The npm package react-baidu-map receives a total of 0 weekly downloads. As such, react-baidu-map popularity was classified as not popular.
We found that react-baidu-map 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.