forked from novakand/h21-map-types-baidu-map
/
index.d.ts
1391 lines (1357 loc) · 52.5 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for BaiduMap v2.0
// Project: http://lbsyun.baidu.com/index.php?title=jspopular
// Definitions by: Codemonk <http://www.youxianxueche.com/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/* *****************************************************************************
Copyright [Codemonk] [Codemonk@live.cn]
This project is licensed under the MIT license.
Copyrights are respective of each contributor listed at the beginning of each definition file.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
***************************************************************************** */
declare namespace BMap {
class Point {
constructor (lng: number, lat: number)
lng: number
lat: number
equals(other: Point): boolean
}
class Pixel {
constructor (x: number, y: number)
x: number
y: number
equals(other: Pixel): boolean
}
class Size {
constructor (width: number, height: number)
width: number
height: number
equals(other: Size): boolean
}
class Bounds {
constructor (minX: number, minY: number, maxX: number, maxY: number)
constructor (sw: Point, ne: Point)
minX: number
minY: number
maxX: number
maxY: number
equals(other: Bounds): boolean
containsPoint(point: Point): boolean
containsBounds(bounds: Bounds): boolean
intersects(other: Bounds): boolean
extend(point: Point): void
getCenter(): Point
isEmpty(): boolean
getSouthWest(): Point
getNorthEast(): Point
toSpan(): Point
}
class Control {
constructor()
defaultAnchor: ControlAnchor
defaultOffset: Size
initialize(map: Map): HTMLElement
setAnchor(anchor: ControlAnchor): void
getAnchor(): ControlAnchor
setOffset(offset: Size): void
getOffset(): Size
show(): void
hide(): void
isVisible(): boolean
}
interface NavigationControlOptions {
anchor?: ControlAnchor
offset?: Size
type?: NavigationControlType
showZoomInfo?: boolean
enableGeolocation?: boolean
}
interface ScaleControlOptions {
anchor?: ControlAnchor
offset?: Size
}
interface CopyrightControlOptions {
anchor?: ControlAnchor
offset?: Size
}
type ControlAnchor = number
class OverviewMapControl extends Control {
constructor(opts: OverviewMapControlOptions)
changeView(): void
setSize(size: Size): void
getSize(): Size
onviewchanged: (event: { type: string, target: any, isOpen: boolean }) => void
onviewchanging: (event: { type: string, target: any }) => void
}
type LengthUnit = string
class MapTypeControl extends Control {
constructor(opts?: MapTypeControlOptions)
}
class NavigationControl extends Control {
constructor(opts?: NavigationControlOptions)
getType(): NavigationControlOptions
setType(type: NavigationControlType): void
}
interface OverviewMapControlOptions {
anchor?: ControlAnchor
offset?: Size
size?: Size
isOpen?: boolean
}
class CopyrightControl extends Control {
constructor(opts?: CopyrightControlOptions)
addCopyright(copyright: Copyright): void
removeCopyright(id: number): void
getCopyright(id: number): Copyright
getCopyrightCollection(): Copyright[]
}
interface MapTypeControlOptions {
type?: MapTypeControlType,
mapTypes?: MapType[]
}
type NavigationControlType = number
class ScaleControl extends Control {
constructor(opts?: ScaleControlOptions)
getUnit(): LengthUnit
setUnit(unit: LengthUnit): void
}
interface Copyright {
id?: number
content?: string
bounds?: Bounds
}
type MapTypeControlType = number
class GeolocationControl extends Control {
constructor(opts?: GeolocationControlOptions)
}
interface GeolocationControlOptions {
anchor?: ControlAnchor
offset?: Size
showAddressBar?: boolean
enableAutoLocation?: boolean
locationIcon?: Icon
}
type StatusCode = number
class PanoramaControl extends Control {
constructor()
}
class Map {
constructor(container: string | HTMLElement, opts?: MapOptions)
enableDragging(): void
disableDragging(): void
enableScrollWheelZoom(): void
disableScrollWheelZoom(): void
enableDoubleClickZoom(): void
disableDoubleClickZoom(): void
enableKeyboard(): void
disableKeyboard(): void
enableInertialDragging(): void
disableInertialDragging(): void
enableContinuousZoom(): void
disableContinuousZoom(): void
enablePinchToZoom(): void
disablePinchToZoom(): void
enableAutoResize(): void
disableAutoResize(): void
setDefaultCursor(cursor: string): void
getDefaultCursor(): string
setDraggingCursor(cursor: string): void
getDraggingCursor(): string
setMinZoom(zoom: number): void
setMaxZoom(zoom: number): void
setMapStyle(mapStyle: MapStyle): void
setPanorama(pano: Panorama): void
disable3DBuilding(): void
getBounds(): Bounds
getCenter(): Point
getDistance(start: Point, end: Point): number
getMapType(): MapType
getSize(): Size
getViewport(view: Point[], viewportOptions?: ViewportOptions): Viewport
getZoom(): number
getPanorama(): Panorama
centerAndZoom(center: Point, zoom: number): void
centerAndZoom(city: string): void
panTo(center: Point, opts?: PanOptions): void
panBy(x: number, y: number, opts?: PanOptions): void
reset(): void
setCenter(center: Point | string): void
setCurrentCity(city: string): void
setMapType(mapType: MapType): void
setViewport(view: Point[], viewportOptions?: ViewportOptions): void
setZoom(zoom: number): void
highResolutionEnabled(): boolean
zoomIn(): void
zoomOut(): void
addHotspot(hotspot: Hotspot): void
removeHotspot(hotspot: Hotspot): void
clearHotspots(): void
addControl(control: Control): void
removeControl(control: Control): void
getContainer(): HTMLElement
addContextMenu(menu: ContextMenu): void
removeContextMenu(menu: ContextMenu): void
addOverlay(overlay: Overlay): void
removeOverlay(overlay: Overlay): void
clearOverlays(): void
openInfoWindow(infoWnd: InfoWindow, point: Point): void
closeInfoWindow(): void
pointToOverlayPixel(point: Point): Pixel
overlayPixelToPoint(pixel: Pixel): Point
getInfoWindow(): InfoWindow
getOverlays(): Overlay[]
getPanes(): MapPanes
addTileLayer(tileLayer: TileLayer): void
removeTileLayer(tilelayer: TileLayer): void
getTileLayer(mapType: string): TileLayer
pixelToPoint(pixel: Pixel): Point
pointToPixel(point: Point): Pixel
onclick: (event: { type: string, target: any, point: Point, pixel: Pixel, overlay: Overlay }) => void
ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onrightclick: (event: { type: string, target: any, point: Point, pixel: Pixel, overlay: Overlay }) => void
onrightdblclick: (event: { type: string, target: any, point: Point, pixel: Pixel, overlay: Overlay }) => void
onmaptypechange: (event: { type: string, target: any }) => void
onmousemove: (event: { type: string, target: any, point: Point, pixel: Pixel, overlay: Overlay }) => void
onmouseover: (event: { type: string, target: any }) => void
onmouseout: (event: { type: string, target: any }) => void
onmovestart: (event: { type: string, target: any }) => void
onmoving: (event: { type: string, target: any }) => void
onmoveend: (event: { type: string, target: any }) => void
onzoomstart: (event: { type: string, target: any }) => void
onzoomend: (event: { type: string, target: any }) => void
onaddoverlay: (event: { type: string, target: any }) => void
onaddcontrol: (event: { type: string, target: any }) => void
onremovecontrol: (event: { type: string, target: any }) => void
onremoveoverlay: (event: { type: string, target: any }) => void
onclearoverlays: (event: { type: string, target: any }) => void
ondragstart: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
ondragging: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
ondragend: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onaddtilelayer: (event: { type: string, target: any }) => void
onremovetilelayer: (event: { type: string, target: any }) => void
onload: (event: { type: string, target: any, point: Point, pixel: Pixel, zoom: number }) => void
onresize: (event: { type: string, target: any, size: Size }) => void
onhotspotclick: (event: { type: string, target: any, spots: HotspotOptions }) => void
onhotspotover: (event: { type: string, target: any, spots: HotspotOptions }) => void
onhotspotout: (event: { type: string, target: any, spots: HotspotOptions }) => void
ontilesloaded: (event: { type: string, target: any }) => void
ontouchstart: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
ontouchmove: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
ontouchend: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onlongpress: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
}
interface PanOptions {
noAnimation?: boolean
}
interface MapOptions {
minZoom?: number
maxZoom?: number
mapType?: MapType
enableHighResolution?: boolean
enableAutoResize?: boolean
enableMapClick?: boolean
}
interface Viewport {
center: Point
zoom: number
}
interface ViewportOptions {
enableAnimation?: boolean
margins?: number[]
zoomFactor?: number
delay?: number
}
type APIVersion = number
interface MapStyle {
features: any[]
style: string
}
class TileLayer {
constructor(opts?: TileLayerOptions)
getTilesUrl(tileCoord: Pixel, zoom: number): string
getCopyright(): Copyright
isTransparentPng(): boolean
}
interface TileLayerOptions {
transparentPng?: boolean
tileUrlTemplate?: string
copyright?: Copyright
zIndex?: number
}
class TrafficLayer extends TileLayer {
constructor(opts?: TrafficLayerOptions)
}
interface TrafficLayerOptions {
predictDate?: PredictDate
}
interface PredictDate {
weekday: number
hour: number
}
class CustomLayer extends TileLayer {
constructor(opts: CustomLayerOptions)
onhotspotclick: (event: { type: string, target: any, content: any }) => void
}
interface Custompoi {
poiId: string
databoxId: string
title: string
address: string
phoneNumber: string
postcode: string
provinceCode: number
province: string
cityCode: number
city: string
districtCode: number
district: string
point: Point
tags: string[]
typeId: number
extendedData: any
}
class PanoramaCoverageLayer extends TileLayer {
constructor()
}
interface CustomLayerOptions {
databoxId?: string
geotableId?: string
q?: string
tags?: string
filter?: string
pointDensityType?: PointDensityType
}
type PointDensityType = number
class MapType {
constructor(name: string, layers: TileLayer | TileLayer[], opts?: MapTypeOptions)
getName(): string
getTileLayer(): TileLayer
getMinZoom(): number
getMaxZoom(): number
getProjection(): Projection
getTextColor(): string
getTips(): string
}
interface MapTypeOptions {
minZoom?: number
maxZoom?: number
errorImageUrl?: string
textColor?: number
tips?: string
}
interface Projection {
lngLatToPoint(lngLat: Point): Pixel
pointToLngLat(point: Pixel): Point
}
interface MercatorProjection extends Projection {
}
interface PerspectiveProjection extends Projection {
}
interface Overlay {
initialize?(map: Map): HTMLElement
isVisible?(): boolean
draw?(): void
show?(): void
hide?(): void
}
type SymbolShapeType = number
interface PolylineOptions {
strokeColor?: string
strokeWeight?: number
strokeOpacity?: number
strokeStyle?: string
enableMassClear?: boolean
enableEditing?: boolean
enableClicking?: boolean
}
interface GroundOverlayOptions {
opacity?: number
imageURL?: string
displayOnMinLevel?: number
displayOnMaxLevel?: number
}
interface Marker extends Overlay {}
class Marker {
constructor(point: Point, opts?: MarkerOptions)
openInfoWindow(infoWnd: InfoWindow): void
closeInfoWindow(): void
setIcon(icon: Icon): void
getIcon(): Icon
setPosition(position: Point): void
getPosition(): Point
setOffset(offset: Size): void
getOffset(): Size
setLabel(label: Label): void
getLabel(): Label
setTitle(title: string): void
getTitle(): string
setTop(isTop: boolean): void
enableDragging(): void
disableDragging(): void
enableMassClear(): void
disableMassClear(): void
setZIndex(zIndex: number): void
getMap(): Map
addContextMenu(menu: ContextMenu): void
removeContextMenu(menu: ContextMenu): void
setAnimation(animation?: Animation): void
setRotation(rotation: number): void
getRotation(): number
setShadow(shadow: Icon): void
getShadow(): void
addEventListener(event: string, handler: Function): void
removeEventListener(event: string, handler: Function): void
onclick: (event: { type: string, target: any }) => void
ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmousedown: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseup: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseout: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseover: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onremove: (event: { type: string, target: any }) => void
oninfowindowclose: (event: { type: string, target: any }) => void
oninfowindowopen: (event: { type: string, target: any }) => void
ondragstart: (event: { type: string, target: any }) => void
ondragging: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
ondragend: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onrightclick: (event: { type: string, target: any }) => void
}
interface SymbolOptions {
anchor?: Size
fillColor?: string
fillOpacity?: number
scale?: number
rotation?: number
strokeColor?: string
strokeOpacity?: number
strokeWeight?: number
}
class IconSequence {
constructor(symbol: Symbol, offset?: string, repeat?: string, fixedRotation?: boolean)
}
interface PointCollection extends Overlay {}
class PointCollection {
constructor(points: Point[], opts?: PointCollectionOption)
setPoints(points: Point[]): void
setStyles(styles: PointCollectionOption): void
clear(): void
onclick: (event: { type: string, target: any, point: Point }) => void
onmouseover: (event: { type: string, target: any, point: Point }) => void
onmouseout: (event: { type: string, target: any, point: Point }) => void
}
interface MarkerOptions {
offset?: Size
icon?: Icon
enableMassClear?: boolean
enableDragging?: boolean
enableClicking?: boolean
raiseOnDrag?: boolean
draggingCursor?: string
rotation?: number
shadow?: Icon
title?: string
}
interface InfoWindow extends Overlay {}
class InfoWindow {
constructor(content: string | HTMLElement, opts?: InfoWindowOptions)
setWidth(width: number): void
setHeight(height: number): void
redraw(): void
setTitle(title: string | HTMLElement): void
getTitle(): string | HTMLElement
setContent(content: string | HTMLElement): void
getContent(): string | HTMLElement
getPosition(): Point
enableMaximize(): void
disableMaximize(): void
isOpen(): boolean
setMaxContent(content: string): void
maximize(): void
restore(): void
enableAutoPan(): void
disableAutoPan(): void
enableCloseOnClick(): void
disableCloseOnClick(): void
addEventListener(event: string, handler: Function): void
removeEventListener(event: string, handler: Function): void
onclose: (event: { type: string, target: any, point: Point }) => void
onopen: (event: { type: string, target: any, point: Point }) => void
onmaximize: (event: { type: string, target: any }) => void
onrestore: (event: { type: string, target: any }) => void
onclickclose: (event: { type: string, target: any }) => void
}
interface Polygon extends Overlay {}
class Polygon {
constructor(points: Array<Point>, opts?: PolygonOptions)
setPath(path: Point[]): void
getPath(): Point[]
setStrokeColor(color: string): void
getStrokeColor(): string
setFillColor(color: string): void
getFillColor(): string
setStrokeOpacity(opacity: number): void
getStrokeOpacity(): number
setFillOpacity(opacity: number): void
getFillOpacity(): number
setStrokeWeight(weight: number): void
getStrokeWeight(): number
setStrokeStyle(style: string): void
getStrokeStyle(): string
getBounds(): Bounds
enableEditing(): void
disableEditing(): void
enableMassClear(): void
disableMassClear(): void
setPointAt(index: number, point: Point): void
setPositionAt(index: number, point: Point): void
getMap(): Map
addEventListener(event: string, handler: Function): void
removeEventListener(event: string, handler: Function): void
onclick: (event: { type: string, target: any }) => void
ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmousedown: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseup: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseout: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseover: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onremove: (event: { type: string, target: any }) => void
onlineupdate: (event: { type: string, target: any }) => void
}
interface PointCollectionOption {
shape?: ShapeType
color?: string
size?: SizeType
}
type Animation = number
interface InfoWindowOptions {
width?: number
height?: number
maxWidth?: number
offset?: Size
title?: string
enableAutoPan?: boolean
enableCloseOnClick?: boolean
enableMessage?: boolean
message?: string
}
interface PolygonOptions {
strokeColor?: string
fillColor?: string
strokeWeight?: number
strokeOpacity?: number
fillOpacity?: number
strokeStyle?: number
enableMassClear?: boolean
enableEditing?: boolean
enableClicking?: boolean
}
type ShapeType = number
interface Icon extends Overlay {}
class Icon {
constructor(url: string, size: Size, opts?: IconOptions)
anchor: Size
size: Size
imageOffset: Size
imageSize: Size
imageUrl: Size
infoWindowAnchor: Size
printImageUrl: string
setImageUrl(imageUrl: string): void
setSize(size: Size): void
setImageSize(offset: Size): void
setAnchor(anchor: Size): void
setImageOffset(offset: Size): void
setInfoWindowAnchor(anchor: Size): void
setPrintImageUrl(url: string): void
}
interface Label extends Overlay {}
class Label {
constructor(content: string, opts?: LabelOptions)
setStyle(styles: Object): void
setContent(content: string): void
setPosition(position: Point): void
getPosition(): Point
setOffset(offset: Size): void
getOffset(): Size
setTitle(title: string): void
getTitle(): string
enableMassClear(): void
disableMassClear(): void
setZIndex(zIndex: number): void
setPosition(position: Point): void
getMap(): Map
addEventListener(event: string, handler: Function): void
removeEventListener(event: string, handler: Function): void
onclick: (event: { type: string, target: any }) => void
ondblclick: (event: { type: string, target: any }) => void
onmousedown: (event: { type: string, target: any }) => void
onmouseup: (event: { type: string, target: any }) => void
onmouseout: (event: { type: string, target: any }) => void
onmouseover: (event: { type: string, target: any }) => void
onremove: (event: { type: string, target: any }) => void
onrightclick: (event: { type: string, target: any }) => void
}
interface Circle extends Overlay {}
class Circle {
constructor(center: Point, radius: number, opts?: CircleOptions)
setCenter(center: Point): void
getCenter(): Point
setRadius(radius: number): void
getRadius(): number
getBounds(): Bounds
setStrokeColor(color: string): void
getStrokeColor(): string
setFillColor(color: string): void
getFillColor(): string
setStrokeOpacity(opacity: number): void
getStrokeOpacity(): number
setFillOpacity(opacity: number): void
getFillOpacity(): number
setStrokeWeight(weight: number): void
getStrokeWeight(): number
setStrokeStyle(style: string): void
getStrokeStyle(): string
getBounds(): Bounds
enableEditing(): void
disableEditing(): void
enableMassClear(): void
disableMassClear(): void
getMap(): Map
addEventListener(event: string, handler: Function): void
removeEventListener(event: string, handler: Function): void
onclick: (event: { type: string, target: any }) => void
ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmousedown: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseup: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseout: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseover: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onremove: (event: { type: string, target: any }) => void
onlineupdate: (event: { type: string, target: any }) => void
}
type SizeType = number
interface IconOptions {
anchor?: Size
imageOffset?: Size
infoWindowAnchor?: Size
printImageUrl?: string
}
interface LabelOptions {
offset?: Size
position?: Point
enableMassClear?: boolean
}
interface CircleOptions {
strokeColor?: string
fillColor?: string
strokeWeight?: number
strokeOpacity?: number
fillOpacity?: number
strokeStyle?: string
enableMassClear?: boolean
enableEditing?: boolean
enableClicking?: boolean
}
interface Hotspot extends Overlay {}
class Hotspot {
constructor(position: Point, opts?: HotspotOptions)
setPosition(position: Point): void
getPosition(): Point
setText(text: string): void
getText(): string
setUserData(data: any): void
getUserData(): any
}
interface Symbol extends Overlay {}
class Symbol {
constructor(path: string | SymbolShapeType, opts?: SymbolOptions)
setPath(path: string | SymbolShapeType): void
setAnchor(anchor: Size): void
setRotation(rotation: number): void
setScale(scale: number): void
setStrokeWeight(strokeWeight: number): void
setStrokeColor(color: string): void
setStrokeOpacity(opacity: number): void
setFillOpacity(opacity: number): void
setFillColor(color: string): void
}
interface Polyline extends Overlay {}
class Polyline {
constructor(points: Point[], opts?: PolylineOptions)
setPath(path: Point[]): void
getPath(): Point[]
setStrokeColor(color: string): void
getStrokeColor(): string
setFillColor(color: string): void
getFillColor(): string
setStrokeOpacity(opacity: number): void
getStrokeOpacity(): number
setFillOpacity(opacity: number): void
getFillOpacity(): number
setStrokeWeight(weight: number): void
getStrokeWeight(): number
setStrokeStyle(style: string): void
getStrokeStyle(): string
getBounds(): Bounds
enableEditing(): void
disableEditing(): void
enableMassClear(): void
disableMassClear(): void
setPointAt(index: number, point: Point): void
setPositionAt(index: number, point: Point): void
getMap(): Map
addEventListener(event: string, handler: Function): void
removeEventListener(event: string, handler: Function): void
onclick: (event: { type: string, target: any }) => void
ondblclick: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmousedown: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseup: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseout: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onmouseover: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onremove: (event: { type: string, target: any }) => void
onlineupdate: (event: { type: string, target: any }) => void
}
interface GroundOverlay extends Overlay {}
class GroundOverlay {
constructor(bounds: Bounds, opts?: GroundOverlayOptions)
setBounds(bounds: Bounds): void
getBounds(): Bounds
setOpacity(opcity: number): void
getOpacity(): number
setImageURL(url: string): void
getImageURL(): string
setDisplayOnMinLevel(level: number): void
getDisplayOnMinLevel(): number
setDispalyOnMaxLevel(level: number): void
getDispalyOnMaxLevel(): number
onclick: (event: { type: string, target: any }) => void
ondblclick: (event: { type: string, target: any }) => void
}
interface HotspotOptions {
text?: string
offsets?: number[]
userData?: any
minZoom?: number
maxZoom?: number
}
interface MapPanes {
floatPane?: HTMLElement
markerMouseTarget?: HTMLElement
floatShadow?: HTMLElement
labelPane?: HTMLElement
markerPane?: HTMLElement
markerShadow?: HTMLElement
mapPane?: HTMLElement
}
class Panorama {
constructor(container: string | HTMLElement, opts?: PanoramaOptions)
getLinks(): PanoramaLink[]
getId(): string
getPosition(): Point
getPov(): PanoramaPov
getZoom(): number
setId(id: string): void
setPosition(position: Point): void
setPov(pov: PanoramaPov): void
setZoom(zoom: number): void
enableScrollWheelZoom(): void
disableScrollWheelZoom(): void
show(): void
hide(): void
addOverlay(overlay: PanoramaLabel): void
removeOverlay(overlay: PanoramaLabel): void
getSceneType(): PanoramaSceneType
setOptions(opts?: PanoramaOptions): void
setPanoramaPOIType(): PanoramaPOIType
onposition_changed: () => void
onlinks_changed: () => void
onpov_changed: () => void
onzoom_changed: () => void
onscene_type_changed: () => void
}
interface PanoramaOptions {
navigationControl?: boolean
linksControl?: boolean
indoorSceneSwitchControl?: boolean
albumsControl?: boolean
albumsControlOptions?: AlbumsControlOptions
}
interface PanoramaLink {
description: string
heading: string
id: string
}
interface PanoramaPov {
heading: number
pitch: number
}
class PanoramaService {
constructor()
getPanoramaById(id: string, callback: (data: PanoramaData) => void): void
getPanoramaByLocation(point: Point, radius?: number, callback?: (data: PanoramaData) => void): void
}
interface PanoramaData {
id: string
description: string
links: PanoramaLink[]
position: Point
tiles: PanoramaTileData
}
interface PanoramaTileData {
centerHeading: number
tileSize: Size
worldSize: Size
}
class PanoramaLabel {
constructor(content: string, opts?: PanoramaLabelOptions)
setPosition(position: Point): void
getPosition(): Point
getPov(): PanoramaPov
setContent(content: string): void
getContent(): string
show(): void
hide(): void
setAltitude(altitude: number): void
getAltitude(): number
addEventListener(event: string, handler: Function): void
removeEventListener(event: string, handler: Function): void
onclick: (event: { type: string, target: any }) => void
onmouseover: (event: { type: string, target: any }) => void
onmouseout: (event: { type: string, target: any }) => void
onremove: (event: { type: string, target: any }) => void
}
interface PanoramaLabelOptions {
position?: Point
altitude?: number
}
interface AlbumsControlOptions {
anchor?: ControlAnchor
offset?: Size
maxWidth?: number | string
imageHeight?: number
}
type PanoramaSceneType = string
type PanoramaPOIType = string
type ContextMenuIcon = string
interface MenuItemOptions {
width?: number
id?: string
iconUrl?: string
}
class MenuItem {
constructor(text: string, callback: (point: Point) => void, opts?: MenuItemOptions)
setText(text: string): void
setIcon(iconUrl: string): void
enable(): void
disable(): void
}
class ContextMenu {
constructor()
addItem(item: MenuItem): void
getItem(index: number): MenuItem
removeItem(item: MenuItem): void
addSeparator(): void
removeSeparator(index: number): void
onopen: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
onclose: (event: { type: string, target: any, point: Point, pixel: Pixel }) => void
}
class LocalSearch {
constructor(location: Map | Point | string, opts?: LocalSearchOptions)
search(keyword: string | Array<string>, option?: Object): void
searchInBounds(keyword: string | Array<string>, bounds: Bounds, option?: Object): void
searchNearby(keyword: string | Array<string>, center: LocalResultPoi | string | Point, radius: number, option?: Object): void
getResults(): LocalResult | LocalResult[]
clearResults(): void
gotoPage(page: number): void
enableAutoViewport(): void
disableAutoViewport(): void
enableFirstResultSelection(): void
disableFirstResultSelection(): void
setLocation(location: Map | Point | string): void
setPageCapacity(capacity: number): void
getPageCapacity(): number
setSearchCompleteCallback(callback: (results: LocalResult | LocalResult[]) => void): void
setMarkersSetCallback(callback: (pois: LocalResultPoi[]) => void): void
setInfoHtmlSetCallback(callback: (poi: LocalResultPoi, html: HTMLElement) => void): void
setResultsHtmlSetCallback(callback: (container: HTMLElement) => void): void
getStatus(): ServiceStatusCode
}
type LineType = number
interface WalkingRouteResult {
city: string
getStart(): LocalResultPoi
getEnd(): LocalResultPoi
getNumPlans(): number
getPlan(i: number): RoutePlan
}
class BusLineSearch {
constructor(location: Map | Point | string, opts?: BusLineSearchOptions)
getBusList(keyword: string): void
getBusLine(busLstItem: BusListItem): void
clearResults(): void
enableAutoViewport(): void
disableAutoViewport(): void
setLocation(location: Map | Point | string): void
getStatus(): ServiceStatusCode
toString(): string
setGetBusListCompleteCallback(callback: (rs: BusListResult) => void): void
setGetBusLineCompleteCallback(callback: (rs: BusLine) => void): void
setBusListHtmlSetCallback(callback: (container: HTMLElement) => void): void
setBusLineHtmlSetCallback(callback: (container: HTMLElement) => void): void
setPolylinesSetCallback(callback: (ply: Polyline) => void): void
setMarkersSetCallback(callback: (markers: Marker[]) => void): void
}
interface LocalSearchOptions {
renderOptions?: RenderOptions
onMarkersSet?: (pois: LocalResultPoi[]) => void
onInfoHtmlSet?: (poi: LocalResultPoi, html: HTMLElement) => void
onResultsHtmlSet?: (container: HTMLElement) => void
pageCapacity?: number
onSearchComplete?: (results: LocalResult[]) => void
}
class DrivingRoute {
constructor(location: Map | Point | string, opts?: DrivingRouteOptions)
search(start: string | Point | LocalResultPoi, end: string | Point | LocalResultPoi, opts?: Object): void
getResults(): DrivingRouteResult
clearResults(): void
enableAutoViewport(): void
disableAutoViewport(): void
setLocation(location: Map | Point | string): void
setPolicy(policy: DrivingPolicy): void
setSearchCompleteCallback(callback: (results: DrivingRouteResult) => void): void
setMarkersSetCallback(callback: (pois: LocalResultPoi[]) => void): void
setInfoHtmlSetCallback(callback: (poi: LocalResultPoi, html: HTMLElement) => void): void
setPolylinesSetCallback(callback: (routes: Route[]) => void): void
setResultsHtmlSetCallback(callback: (container: HTMLElement) => void): void
getStatus(): ServiceStatusCode
toString(): string
}
class Geocoder {
constructor()
getPoint(address: string, callback: (point: Point) => void, city: string): void
getLocation(point: Point, callback: (result: GeocoderResult) => void, opts?: LocationOptions): void
}
interface BusLineSearchOptions {
renderOptions?: RenderOptions
onGetBusListComplete?: (rs: BusListResult) => void
onGetBusLineComplete?: (rs: BusLine) => void
onBusListHtmlSet?: (container: HTMLElement) => void
onBusLineHtmlSet?: (container: HTMLElement) => void
onPolylinesSet?: (ply: Polyline) => void
onMarkersSet?: (sts: Marker[]) => void
}
interface CustomData {
geotableId: number
tags: string
filter: string
}
interface DrivingRouteOptions {
renderOptions?: RenderOptions
policy?: DrivingPolicy
onSearchComplete?: (results: DrivingRouteResult) => void
onMarkersSet?: (pois: LocalResultPoi[]) => void
onInfoHtmlSet?: (poi: LocalResultPoi, html: HTMLElement) => void
onPolylinesSet?: (routes: Route[]) => void
onResultsHtmlSet?: (container: HTMLElement) => void
}
interface GeocoderResult {
point: Point
address: string
addressComponents: AddressComponent
surroundingPoi: LocalResultPoi[]
business: string
}
interface BusListResult {
keyword: string
city: string
moreResultsUrl: string
getNumBusList(): number
getBusListItem(i: number): BusListItem
}
interface RenderOptions {
map: Map
panel?: string | HTMLElement
selectFirstResult?: boolean
autoViewport?: boolean
highlightMode?: HighlightModes
}
type DrivingPolicy = number
interface AddressComponent {
streetNumber: string
street: string
district: string
city: string
province: string
}
interface BusLine {
name: string
startTime: string
endTime: string
company: string
getNumBusStations(): string