# qm-map-wrapper

> qm-map-wrapper

Latest version **1.0.8** (published 2025-03-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install qm-map-wrapper
pnpm add qm-map-wrapper
yarn add qm-map-wrapper
bun add qm-map-wrapper
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2025-03-19 |
| First published | 2024-09-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 197.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | czdnpmczd |
| Keywords | qm, mapboxgl@1.13.0, turf |

## Links

- npm: https://www.npmjs.com/package/qm-map-wrapper
- npm.io page: https://npm.io/package/qm-map-wrapper

## Dependencies (2)

- [mapbox-gl](https://npm.io/package/mapbox-gl.md) 1.13.0
- [@turf/turf](https://npm.io/package/@turf/turf.md) ^7.1.0

## Recent versions

- 1.0.8 (latest) — 2025-03-19
- 1.0.7 — 2025-02-27
- 1.0.6 — 2025-02-25
- 1.0.5 — 2024-11-28
- 1.0.3 — 2024-09-23
- 1.0.2 — 2024-09-23
- 1.0.1 — 2024-09-23
- 1.0.0 — 2024-09-12
- 0.1.0 — 2024-09-11

## README

# qm-map-wrapper

qm-map-wrapper 是一款基于 Mapboxgl 的地图扩展类

## 安装

使用 npm 或 yarn 安装

```bash
npm install qm-map-wrapper
yarn add qm-map-wrapper

```

## 使用

```js
import { MapWrapper } from 'qm-map-wrapper';


const mapDom = ref<HTMLDivElement | null>(null)

const mapOption={
    id: 'themeMap',
    container: '',
    center: [115.39047951086354, 33.2714096725866] as LngLatLike, // 界首市
    zoom: 9.5,
    maxZoom: 20
}
// 初始化 
  const map = new MapWrapper({
    pitch: 0,
    bearing: 0,
    attributionControl: false,
    renderWorldCopies: false,
    trackResize: true,
    preserveDrawingBuffer: true,
    style: {
      version: 8,
      glyphs: `/font/{fontstack}/{range}.pbf`,
      sources: {},
      layers: []
    }
    ...mapOption,
      container: mapDom.current as HTMLElement,
  })

// 挂载
 <div ref={mapDom} className={className ?? 'map-wrapper'} id="map-wrapper"></div>


```

---
_Source: https://npm.io/package/qm-map-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
