$ show huiyan-fe/react-bmap
This is a React component library that wraps the Baidu Maps JavaScript API (v2.0). It provides declarative React components for embedding Baidu maps, markers, info windows, controls, shapes, and advanced visualization layers (via mapv and mapvgl). The architecture is straightforward: each component manages a Baidu API object's lifecycle (create in componentDidMount, update in componentDidUpdate, destroy in componentWillUnmount), and render returns null. The Map component passes the map instance to children via React.cloneElement. The library is built with Babel 6, Webpack 3, and targets React 15. It is a wrapper library, not a standalone application. The codebase is functional but outdated, with high technical drift due to very old dependencies (React 15, Babel 6, Webpack 3). The library is no longer actively developed; the README recommends using the newer React-BMapGL for 3D support. It is suitable for simple Baidu map integrations in legacy React projects, but not recommended for new development.
The LLM identified 1 files worth highlighting for reuse:
Provides pure JavaScript utility functions for merging road path strings (splitting, concatenating, deduplicating) and checking if a point lies on a polyline. It is independent of Baidu Maps or React, making it extractable for any mapping or geometry project. The `mergeRoadPath` function intelligently merges adjacent road segments by matching endpoints, and `isPointOnPolyline` uses cross-product precision checks. This demonstrates non-obvious algorithmic skill for polyline manipulation.