Development guide for the Baidu Map JSAPI WebGL version. It includes API descriptions and code examples for core modules such as map initialization, overlays, events, and layers, aiming to help developers quickly integrate Baidu Map and follow the correct usage methods.
When to Apply
Refer to these guides in the following scenarios:
- Create a new map page or component
- Add overlays such as markers, polylines, and polygons to the map
- Handle map interaction events (click, drag, zoom, etc.)
- Configure map styles or switch layers
- Debug map rendering or performance issues
Quick Reference
0. Basic Concepts
references/base-classes.md- Basic classes: Point, Bounds, Size, Pixel, Iconreferences/constants.md- Common constants: search status codes, POI types
1. Map
references/map-init.md- Map initialization: resource import, instance creation, configuration options, interaction and view control
2. Map Overlays
references/overlay-common.md- Common overlay operations: add/remove, show/hide, batch clearreferences/marker.md- Marker: constructor parameters, position/icon/rotation/top/drag methodsreferences/polyline.md- Polyline: constructor parameters, line style, coordinate operations, edit modereferences/polygon.md- Polygon: constructor parameters, border/fill style, polygon with holes, edit modereferences/circle.md- Circle: constructor parameters, center point/radius, style settings, edit modereferences/custom-overlay.md- Custom overlay: DOM creation, property passing, event binding, rotation controlreferences/info-window.md- Info window: constructor parameters, content/size settings, maximize, use with Marker
3. Events
references/map-events.md- Map events: binding methods, interaction events, view change events, lifecycle eventsreferences/overlay-events.md- Overlay events: common events, drag events, vector graphic events
4. Map Styles
references/map-style.md- Personalized map: customize map appearance (color, visibility) to achieve effects such as dark theme and minimalist map
5. Layer Services
references/xyz-layer.md- Third-party layers: load XYZ/TMS/WMS/WMTS standard tilesreferences/mvt-layer.md- Vector tiles: load MVT/PBF format tiles, support style expressions, feature interaction, state management
6. Route Planning
references/route-common.md- Common configuration: constructor parameters, rendering options, callback functions, data structures, status constantsreferences/driving-route.md- Driving: strategy enums, waypoints, traffic conditions, tolls, draggingreferences/walking-route.md- Walking: turn types, draggingreferences/riding-route.md- Riding: riding searchreferences/transit-route.md- Transit: intra-city/inter-city strategies, transportation modes, transfers
7. Other LBS Services
references/local-search.md- Local search: normal/range/nearby search, result processing, pagination, POI data structurereferences/geocoder.md- Geocoding: forward geocoding (address→coordinates), reverse geocoding (coordinates→address)references/convertor.md- Coordinate conversion: convert GPS/Amap/Google coordinates to Baidu coordinates
How to Use
Please read the reference files for detailed explanations and code examples:
references/map-init.md
Each reference file contains:
- Brief function description
- Complete code example and explanation
- API parameter description and notes
Notes
references/get-ak.md- Obtain the key (AK): When the user has no AK or the AK is invalid, guide the user to the console to apply for a browser-side type AK