bmap-jsapi-gl

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

JSAPI GL 开发指南

JSAPI GL Development Guide

百度地图 JSAPI WebGL 版本开发指南。包含地图初始化、覆盖物、事件、图层等核心模块的 API 说明和代码示例,旨在帮助开发者快速集成百度地图并遵循正确的使用方式。
Baidu Maps JSAPI WebGL version development guide. 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 Maps and follow correct usage methods.

何时适用

When to Use

在以下场景中参考这些指南:
  • 创建新的地图页面或组件
  • 在地图上添加标注、折线、多边形等覆盖物
  • 处理地图交互事件(点击、拖拽、缩放等)
  • 配置地图样式或切换图层
  • 调试地图渲染或性能问题
Refer to these guides in the following scenarios:
  • Creating new map pages or components
  • Adding markers, polylines, polygons, and other overlays to the map
  • Handling map interaction events (click, drag, zoom, etc.)
  • Configuring map styles or switching layers
  • Debugging map rendering or performance issues

快速参考

Quick Reference

0. 基础概念

0. Basic Concepts

  • references/base-classes.md
    - 基础类:Point、Bounds、Size、Pixel、Icon
  • references/constants.md
    - 通用常量:搜索状态码、POI 类型
  • references/base-classes.md
    - Basic Classes: Point, Bounds, Size, Pixel, Icon
  • references/constants.md
    - Common Constants: Search status codes, POI types

1. 地图

1. Map

  • references/map-init.md
    - 地图初始化:资源引入、创建实例、配置选项、交互与视图控制
  • references/map-init.md
    - Map Initialization: Resource introduction, instance creation, configuration options, interaction and view control

2. 地图覆盖物

2. Map Overlays

  • references/overlay-common.md
    - 覆盖物通用操作:添加/移除、显示/隐藏、批量清除
  • references/marker.md
    - 点标记:构造参数、位置/图标/旋转/置顶/拖拽方法
  • references/polyline.md
    - 折线:构造参数、线条样式、坐标操作、编辑模式
  • references/polygon.md
    - 多边形:构造参数、边框/填充样式、带孔多边形、编辑模式
  • references/circle.md
    - 圆形:构造参数、中心点/半径、样式设置、编辑模式
  • references/custom-overlay.md
    - 自定义覆盖物:DOM 创建、属性传递、事件绑定、旋转控制
  • references/info-window.md
    - 信息窗口:构造参数、内容/尺寸设置、最大化、与 Marker 配合使用
  • references/overlay-common.md
    - Common Overlay Operations: Add/remove, show/hide, batch clear
  • references/marker.md
    - Marker: Constructor parameters, position/icon/rotation/topmost/drag methods
  • references/polyline.md
    - Polyline: Constructor parameters, line style, coordinate operations, edit mode
  • references/polygon.md
    - Polygon: Constructor parameters, border/fill style, polygon with holes, edit mode
  • references/circle.md
    - Circle: Constructor parameters, center point/radius, style settings, edit mode
  • references/custom-overlay.md
    - Custom Overlay: DOM creation, attribute passing, event binding, rotation control
  • references/info-window.md
    - Info Window: Constructor parameters, content/size settings, maximize, use with Marker

3. 事件

3. Events

  • references/map-events.md
    - 地图事件:绑定方式、交互事件、视图变化事件、生命周期事件
  • references/overlay-events.md
    - 覆盖物事件:通用事件、拖拽事件、矢量图形事件
  • references/map-events.md
    - Map Events: Binding methods, interaction events, view change events, lifecycle events
  • references/overlay-events.md
    - Overlay Events: Common events, drag events, vector graphic events

4. 地图样式

4. Map Styles

  • references/map-style.md
    - 个性化地图:自定义地图外观(颜色、显隐),实现深色主题、简洁地图等效果
  • references/map-style.md
    - Customized Maps: Customize map appearance (color, show/hide), implement dark themes, minimalist maps, etc.

5. 图层服务

5. Layer Services

  • references/xyz-layer.md
    - 第三方图层:加载 XYZ/TMS/WMS/WMTS 标准瓦片
  • references/mvt-layer.md
    - 矢量瓦片:加载 MVT/PBF 格式瓦片,支持样式表达式、特征交互、状态管理
  • references/xyz-layer.md
    - Third-party Layers: Load standard tiles in XYZ/TMS/WMS/WMTS formats
  • references/mvt-layer.md
    - Vector Tiles: Load tiles in MVT/PBF formats, support style expressions, feature interaction, state management

6. 路径规划

6. Route Planning

  • references/route-common.md
    - 通用配置:构造参数、渲染选项、回调函数、数据结构、状态常量
    • references/driving-route.md
      - 驾车:策略枚举、途经点、路况、收费、拖拽
    • references/walking-route.md
      - 步行:转向类型、拖拽
    • references/riding-route.md
      - 骑行:骑行搜索
    • references/transit-route.md
      - 公交:市内/跨城策略、交通方式、换乘
  • references/route-common.md
    - Common Configuration: Constructor parameters, rendering options, callback functions, data structures, state constants
    • references/driving-route.md
      - Driving: Strategy enumeration, waypoints, traffic conditions, tolls, drag
    • references/walking-route.md
      - Walking: Turn types, drag
    • references/riding-route.md
      - Cycling: Cycling search
    • references/transit-route.md
      - Public Transit: Intra-city/inter-city strategies, transportation modes, transfers

7. 其他LBS服务

7. Other LBS Services

  • references/local-search.md
    - 本地检索:普通/范围/周边检索、结果处理、翻页、POI 数据结构
  • references/geocoder.md
    - 地理编码:正地理编码(地址→坐标)、逆地理编码(坐标→地址)
  • references/convertor.md
    - 坐标转换:GPS/高德/谷歌坐标转百度坐标
  • references/local-search.md
    - Local Search: General/range/surrounding search, result processing, pagination, POI data structure
  • references/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

请阅读各个参考文件以获取详细说明和代码示例:
references/map-init.md
每个参考文件包含:
  • 功能简要说明
  • 完整代码示例及解释
  • API 参数说明和注意事项
Please read each reference file for detailed explanations and code examples:
references/map-init.md
Each reference file includes:
  • Brief function description
  • Complete code examples and explanations
  • API parameter descriptions and notes