### Development Setup for vue3-baidu-map-gl
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/README.md
Steps to set up the development environment for contributing to or working with the vue3-baidu-map-gl project. This includes cloning the repository, installing dependencies, and running development servers for components and documentation.
```bash
# Environment
# pnpm >= 6.0.0
# node >= 12.0.0
# clone
git clone https://github.com/yue1123/vue3-baidu-map-gl
cd ./vue3-baidu-map-gl
# install
pnpm install
# Run dev, real-time component library build
pnpm dev
# Run documentation site, used to test components and preview documentation
pnpm docs:dev
```
--------------------------------
### Coordinate Conversion Example
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/hooks/usePointConvertor.md
This example shows how to initialize a Map component and then use the `usePoint` hook to set a point's coordinates after the map is initialized. This is a common pattern when working with map components and their associated functionalities.
```html
```
--------------------------------
### Install MapV GL Libraries via npm
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/expand/mapv.md
Provides the npm and pnpm commands to install the core MapV library, the MapV GL extension library, and the MapV Three.js related library.
```Shell
# mapv 基础库
npm add mapv
# or
pnpm add mapv
# ----------------------
# mapvgl GL扩展库
npm add mapvgl
# or
pnpm add mapvgl
# ----------------------
# mapv-three three.js 相关库
npm add mapv-three
# or
pnpm add mapv-three
```
--------------------------------
### Install vue3-baidu-map-gl
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/README.md
Instructions for installing the vue3-baidu-map-gl library using different package managers like pnpm, yarn, and npm. This is the first step to integrate the library into your Vue 3 project.
```bash
# with pnpm
pnpm add vue3-baidu-map-gl
# or with yarn
yarn add vue3-baidu-map-gl
# or with npm
npm install vue3-baidu-map-gl
```
--------------------------------
### Install Vue3 BaiduMap GL with Package Managers
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/guide/installation.md
Installs the Vue3 BaiduMap GL library using popular package managers: pnpm, yarn, and npm. This is the recommended method for use with build tools like Vite or webpack.
```bash
pnpm add vue3-baidu-map-gl
```
```bash
yarn add vue3-baidu-map-gl
```
```bash
npm install vue3-baidu-map-gl
```
--------------------------------
### Initialize and Control Track Animation
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/hooks/useTrackAnimation.md
Demonstrates how to initialize and control the track animation using the `useTrackAnimation` hook. It shows how to get control functions like `setPath`, `start`, `cancel`, `stop`, `proceed`, and the animation `status`.
```javascript
const { setPath, start, cancel, stop, proceed, status } = useTrackAnimation(map, options)
```
--------------------------------
### Import MapV GL Libraries
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/expand/mapv.md
Demonstrates how to import the MapV, MapV GL, and MapV Three libraries after installing them via npm.
```TypeScript
import * as mapv from 'mapv'
import * as mapvgl from 'mapvgl'
import * as mapvThree from 'mapv-three'
```
--------------------------------
### Initialize and Use useIpLocation
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/hooks/useIpLocation.md
Demonstrates how to initialize the `useIpLocation` hook and access its returned values. The `get` method should be called after the `Map` component is initialized.
```typescript
const { get, location, isLoading } = useIpLocation(cal)
```
--------------------------------
### Volar Support Configuration
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/guide/quick-start.md
Configuration for Volar IDE support to enhance type hinting for global components in Vue3 BaiduMap GL. This involves updating the `tsconfig.json` file to include the necessary types.
```json
// tsconfig.json
{
"compilerOptions": {
// ...
"types": ["vue3-baidu-map-gl/volar"]
}
}
```
--------------------------------
### On-Demand Import Vue Components
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/guide/quick-start.md
Demonstrates on-demand importing of Vue3 BaiduMap GL components like BMap and BZoom. This approach leverages ES Module's Tree Shaking, ensuring that only the components used in the project are included in the final build, optimizing bundle size.
```vue
```
--------------------------------
### Full Import Vue3 BaiduMap GL
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/guide/quick-start.md
This code snippet demonstrates how to perform a full import of the Vue3 BaiduMap GL library. While convenient, it may lead to larger bundle sizes due to the loss of Tree Shaking functionality. This method is suitable if bundle size is not a primary concern.
```typescript
import { createApp } from 'vue'
import Vue3BaiduMapGL from 'vue3-baidu-map-gl'
const app = createApp(App)
app.use(Vue3BaiduMapGL)
```
--------------------------------
### Handle Map Drag Start Event (dragstart)
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/components/map.md
The 'dragstart' event is emitted when the user begins to drag the map. It provides the event type, target, pixel coordinates, and the geographical point where the drag started.
```Vue
```
--------------------------------
### Map Component with usePoint Integration
Source: https://github.com/yue1123/vue3-baidu-map-gl/blob/main/docs/zh-CN/hooks/usePoint.md
An example of integrating the `usePoint` hook within a Vue 3 component using the `