tg-map-core 0.0.1 → 0.0.3
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/README.md +3 -0
- package/dist/src/map/map/map.d.ts +1 -0
- package/dist/tg-map-core.cjs +6394 -0
- package/dist/tg-map-core.css +77 -0
- package/dist/tg-map-core.mjs +6277 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -7
- package/src/map/dts/baidu.d.ts +53 -0
- package/src/map/dts/google.d.ts +10 -0
- package/src/map/dts/here-v31.d.ts +16 -0
- package/src/map/dts/index.d.ts +4 -0
- package/src/map/dts/js-modules.d.ts +15 -0
- package/src/map/dts/maptalks.d.ts +10 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
declare namespace BMap {
|
|
2
|
+
class OverlayV3 {
|
|
3
|
+
initialize(map: Map): HTMLElement
|
|
4
|
+
isVisible(): boolean
|
|
5
|
+
draw(): void
|
|
6
|
+
show(): void
|
|
7
|
+
hide(): void
|
|
8
|
+
// 这些方法文档中都没写, 但确实可以调用...
|
|
9
|
+
addEventListener(event: string, handler: Callback): void
|
|
10
|
+
removeEventListener(event: string, handler: Callback): void
|
|
11
|
+
/** @param event type名要以'on'开头 */
|
|
12
|
+
dispatchEvent(event: { type: string }): void
|
|
13
|
+
}
|
|
14
|
+
interface Map {
|
|
15
|
+
addEventListener(event: string, handler: Callback): void
|
|
16
|
+
removeEventListener(event: string, handler: Callback): void
|
|
17
|
+
}
|
|
18
|
+
interface Autocomplete {
|
|
19
|
+
addEventListener(event: string, handler: Callback): void
|
|
20
|
+
removeEventListener(event: string, handler: Callback): void
|
|
21
|
+
}
|
|
22
|
+
interface AutocompleteResultPoi {
|
|
23
|
+
city: string
|
|
24
|
+
}
|
|
25
|
+
interface LocalSearchOptions {
|
|
26
|
+
onSearchComplete?: ((results: LocalResult[] | LocalResult) => void) | undefined;
|
|
27
|
+
}
|
|
28
|
+
interface LocalResultPoi {
|
|
29
|
+
uid: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface MarkerOptions {
|
|
33
|
+
icon?: BMap.Symbol | Icon
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface Marker {
|
|
37
|
+
setIcon(icon: Icon | BMap.Symbol): void;
|
|
38
|
+
getIcon(): Icon | BMap.Symbol;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface Symbol {
|
|
42
|
+
/** 实际的锚点, 第一次添加到地图上时会为undefined */
|
|
43
|
+
anchor?: Size
|
|
44
|
+
style: {
|
|
45
|
+
/** 设置的锚点 */
|
|
46
|
+
anchor: Size
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface IconOptions {
|
|
51
|
+
imageSize?: Size
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// v3.1
|
|
2
|
+
declare namespace H {
|
|
3
|
+
namespace service {
|
|
4
|
+
interface PlatformV31Constructor {
|
|
5
|
+
new(options: { apikey: string }): Platform
|
|
6
|
+
}
|
|
7
|
+
interface PlatformV31 extends Platform {
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
let PlatformV31: PlatformV31Constructor
|
|
11
|
+
interface DefaultLayers {
|
|
12
|
+
raster: { normal: H.service.MapType, satellite: H.service.MapType, terrain: H.service.MapType }
|
|
13
|
+
vector: { normal: { map: H.map.layer.TileLayer, traffic: H.map.layer.TileLayer, trafficincidents: H.map.layer.MarkerTileLayer } }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 当前版本, tsconfig中`allowJs:true`和`declaration:true`不兼容, 导致引用第三方js库时, 无法利用JSDoc的类型注解
|
|
3
|
+
* 未来貌似会增加允许两者同时为true的功能, 详见{@link https://github.com/microsoft/TypeScript/pull/32372}
|
|
4
|
+
*
|
|
5
|
+
* 当前使用两个tsconfig, 达到类似效果:
|
|
6
|
+
* 1. tsconfig.json: `allowJs:true`+`declaration:false`, 用来在VSCode中利用第三方JS库的JSDoc注解
|
|
7
|
+
* 2. tsconfig.types.json: `allowJs:false`+`declaration:true`, 用来在编译时正常输出.d.ts文件
|
|
8
|
+
*
|
|
9
|
+
* 而该文件(`js-modules.d.ts`)的作用就是声明用到的第三方js库, 让tsconfig.types.json能够正常编译
|
|
10
|
+
*
|
|
11
|
+
* typescript 3.7 之后已支持两者同时为true, 该文件暂时没有用, 可以移除
|
|
12
|
+
*/
|
|
13
|
+
// cSpell:ignore bmaplib, markerclusterer
|
|
14
|
+
// declare module 'bmaplib.markerclusterer'
|
|
15
|
+
// declare module '@google/markerclusterer'
|