@tianditu/vue 0.0.3-edge.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +56 -7
- package/dist/index.d.mts +1355 -17
- package/dist/index.mjs +1024 -183
- package/package.json +40 -23
- package/dist/index.d.ts +0 -18
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Demo Macro
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Demo Macro
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,21 +4,70 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
> Vue
|
|
7
|
+
> 用 Vue 3 组件写天地图。
|
|
8
|
+
> 覆盖官方 JavaScript API 的地图、覆盖物、控件、鼠标工具、图层、标绘组件与服务组合式函数:组件写在地图内部即自动挂载,props 变更经官方 setter 同步,官方事件原生转发,每个组件都 expose SDK 实例可命令式兜底。
|
|
8
9
|
|
|
9
|
-
##
|
|
10
|
+
## 特性
|
|
11
|
+
|
|
12
|
+
- 🗺️ **`<TdtMap>` 容器** — center/zoom/交互等 props(`locate` 定位方式:`"geolocation"` 浏览器定位、`"ip"` 官方 IP 定位、`"auto"` 前者优先浏览器失败回退 IP,默认回退北京);官方 14 个地图事件原生转发
|
|
13
|
+
- 📌 **覆盖物** — Marker、Polyline、Polygon、Circle、Rectangle、Label、MarkerClusterer、CloudMarkerCollection、InfoWindow 与 ContextMenu 均为声明式组件;props 变化经官方 setter 同步
|
|
14
|
+
- 🎛️ **控件** — Zoom、Scale、Copyright、OverviewMap 与 MapType
|
|
15
|
+
- 🖱️ **鼠标工具** — PolylineTool、PolygonTool、CircleTool、RectangleTool、MarkTool、PaintBrushTool 与 CoordinatePickup,受控 `active` 开关
|
|
16
|
+
- 🗂️ **图层** — TileLayer、TileLayer.WMS、TileLayer.TDT、GridlineLayer 与 LayerGroup
|
|
17
|
+
- 🚩 **标绘** — 22 个标绘实体组件、23 个标绘工具与标绘控件
|
|
18
|
+
- 📞 **服务组合式** — `useLocalSearch`、`useGeocoder`、`useGeolocation`、`useDrivingRoute`、`useTransitRoute`、`useBusLineSearch`、`useDataSources`、`useAdministrativeDivision`、`useLocalCity`,回调一律转为 Promise
|
|
19
|
+
- 🛟 **逃生口** — `useMap()` 暴露响应式地图实例;每个组件都 expose 其 SDK 实例,可命令式访问
|
|
20
|
+
|
|
21
|
+
## 安装
|
|
10
22
|
|
|
11
23
|
```bash
|
|
12
24
|
# npm
|
|
13
|
-
$ npm install
|
|
25
|
+
$ npm install @tianditu/vue
|
|
14
26
|
|
|
15
27
|
# yarn
|
|
16
|
-
$ yarn add
|
|
28
|
+
$ yarn add @tianditu/vue
|
|
17
29
|
|
|
18
30
|
# pnpm
|
|
19
|
-
$ pnpm add
|
|
31
|
+
$ pnpm add @tianditu/vue
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 快速开始
|
|
35
|
+
|
|
36
|
+
```vue
|
|
37
|
+
<script setup>
|
|
38
|
+
import { ref } from "vue";
|
|
39
|
+
|
|
40
|
+
import { TdtMap, TdtMarker, TdtInfoWindow } from "@tianditu/vue";
|
|
41
|
+
|
|
42
|
+
const open = ref(false);
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<TdtMap
|
|
47
|
+
tk="你的浏览器端密钥"
|
|
48
|
+
:center="[116.404, 39.915]"
|
|
49
|
+
:zoom="12"
|
|
50
|
+
style="width: 100%; height: 100%"
|
|
51
|
+
>
|
|
52
|
+
<TdtMarker :lnglat="[116.404, 39.915]" draggable>
|
|
53
|
+
<TdtInfoWindow v-model:open="open">
|
|
54
|
+
<div>天安门</div>
|
|
55
|
+
</TdtInfoWindow>
|
|
56
|
+
</TdtMarker>
|
|
57
|
+
</TdtMap>
|
|
58
|
+
</template>
|
|
20
59
|
```
|
|
21
60
|
|
|
22
|
-
##
|
|
61
|
+
## API
|
|
62
|
+
|
|
63
|
+
组件分组与官方文档类目一致——地图、覆盖物、控件、鼠标工具、图层、标绘与服务。每个组件的 props、事件与 exposes 见[文档站](https://github.com/DemoMacro/tianditu/tree/main/docs)。
|
|
64
|
+
|
|
65
|
+
## 相关包
|
|
66
|
+
|
|
67
|
+
- [@tianditu/core](https://www.npmjs.com/package/@tianditu/core) — 框架无关内核(自动安装)
|
|
68
|
+
- [@tianditu/web-components](https://www.npmjs.com/package/@tianditu/web-components) — Web Components 适配层
|
|
69
|
+
- [@tianditu/services](https://www.npmjs.com/package/@tianditu/services) — 类型化 REST 服务客户端
|
|
70
|
+
|
|
71
|
+
## 许可
|
|
23
72
|
|
|
24
|
-
- [MIT](LICENSE) © [Demo Macro](https://
|
|
73
|
+
- [MIT](LICENSE) © [Demo Macro](https://www.demomacro.com/)
|