gistda-sphere-react 1.0.0 → 1.0.1
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 +0 -2
- package/dist/index.d.mts +79 -71
- package/dist/index.d.ts +79 -71
- package/dist/index.js +452 -451
- package/dist/index.mjs +459 -459
- package/package.json +7 -7
- package/src/components/Circle.tsx +32 -35
- package/src/components/Dot.tsx +24 -27
- package/src/components/Marker.tsx +28 -31
- package/src/components/Polygon.tsx +38 -41
- package/src/components/Polyline.tsx +168 -173
- package/src/components/Popup.tsx +23 -26
- package/src/components/Rectangle.tsx +152 -157
- package/src/components/SphereMap.tsx +237 -242
- package/src/components/index.ts +1 -1
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Ref, ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
interface Location {
|
|
5
5
|
lon: number;
|
|
@@ -463,9 +463,19 @@ declare global {
|
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
interface CircleRef {
|
|
467
|
+
getCircle(): SphereCircle | null;
|
|
468
|
+
togglePopup(show?: boolean, location?: Location): void;
|
|
469
|
+
getCenter(): Location | null;
|
|
470
|
+
getBound(): Bound | null;
|
|
471
|
+
getArea(language?: string): number | string | null;
|
|
472
|
+
getRadius(language?: string): number | string | null;
|
|
473
|
+
updateStyle(options: Partial<GeometryOptions>): void;
|
|
474
|
+
}
|
|
466
475
|
interface CircleProps {
|
|
467
476
|
center: Location;
|
|
468
477
|
radius: number;
|
|
478
|
+
ref?: Ref<CircleRef>;
|
|
469
479
|
title?: string;
|
|
470
480
|
detail?: string;
|
|
471
481
|
popup?: PopupOptions;
|
|
@@ -481,19 +491,16 @@ interface CircleProps {
|
|
|
481
491
|
onDrag?: (circle: SphereCircle) => void;
|
|
482
492
|
onDrop?: (circle: SphereCircle) => void;
|
|
483
493
|
}
|
|
484
|
-
|
|
485
|
-
getCircle(): SphereCircle | null;
|
|
486
|
-
togglePopup(show?: boolean, location?: Location): void;
|
|
487
|
-
getCenter(): Location | null;
|
|
488
|
-
getBound(): Bound | null;
|
|
489
|
-
getArea(language?: string): number | string | null;
|
|
490
|
-
getRadius(language?: string): number | string | null;
|
|
491
|
-
updateStyle(options: Partial<GeometryOptions>): void;
|
|
492
|
-
}
|
|
493
|
-
declare const Circle: react.ForwardRefExoticComponent<CircleProps & react.RefAttributes<CircleRef>>;
|
|
494
|
+
declare function Circle({ center, radius, ref, title, detail, popup, visibleRange, lineWidth, lineColor, fillColor, lineStyle, clickable, draggable, zIndex, onClick, onDrag, onDrop, }: CircleProps): null;
|
|
494
495
|
|
|
496
|
+
interface DotRef {
|
|
497
|
+
getDot(): SphereDot | null;
|
|
498
|
+
setPosition(location: Location): void;
|
|
499
|
+
getPosition(): Location | null;
|
|
500
|
+
}
|
|
495
501
|
interface DotProps {
|
|
496
502
|
position: Location;
|
|
503
|
+
ref?: Ref<DotRef>;
|
|
497
504
|
title?: string;
|
|
498
505
|
detail?: string;
|
|
499
506
|
visibleRange?: Range;
|
|
@@ -506,12 +513,7 @@ interface DotProps {
|
|
|
506
513
|
onDrag?: (dot: SphereDot) => void;
|
|
507
514
|
onDrop?: (dot: SphereDot, location: Location) => void;
|
|
508
515
|
}
|
|
509
|
-
|
|
510
|
-
getDot(): SphereDot | null;
|
|
511
|
-
setPosition(location: Location): void;
|
|
512
|
-
getPosition(): Location | null;
|
|
513
|
-
}
|
|
514
|
-
declare const Dot: react.ForwardRefExoticComponent<DotProps & react.RefAttributes<DotRef>>;
|
|
516
|
+
declare function Dot({ position, ref, title, detail, visibleRange, lineWidth, lineColor, clickable, draggable, zIndex, onClick, onDrag, onDrop, }: DotProps): null;
|
|
515
517
|
|
|
516
518
|
interface LayerProps {
|
|
517
519
|
name?: string;
|
|
@@ -538,8 +540,15 @@ interface LayerProps {
|
|
|
538
540
|
}
|
|
539
541
|
declare function Layer({ name, preset, isBase, type, url, zoomRange, source, opacity, zIndex, bound, attribution, extraQuery, id, format, srs, tileMatrixPrefix, styles, version, refresh, zoomOffset, beforeId, }: LayerProps): null;
|
|
540
542
|
|
|
543
|
+
interface MarkerRef {
|
|
544
|
+
getMarker(): SphereMarker | null;
|
|
545
|
+
togglePopup(show?: boolean): void;
|
|
546
|
+
setPosition(location: Location, animate?: boolean): void;
|
|
547
|
+
setRotation(angle: number): void;
|
|
548
|
+
}
|
|
541
549
|
interface MarkerProps {
|
|
542
550
|
position: Location;
|
|
551
|
+
ref?: Ref<MarkerRef>;
|
|
543
552
|
icon?: Icon;
|
|
544
553
|
title?: string;
|
|
545
554
|
detail?: string;
|
|
@@ -555,16 +564,22 @@ interface MarkerProps {
|
|
|
555
564
|
onHover?: (marker: SphereMarker) => void;
|
|
556
565
|
onLeave?: (marker: SphereMarker) => void;
|
|
557
566
|
}
|
|
558
|
-
|
|
559
|
-
getMarker(): SphereMarker | null;
|
|
560
|
-
togglePopup(show?: boolean): void;
|
|
561
|
-
setPosition(location: Location, animate?: boolean): void;
|
|
562
|
-
setRotation(angle: number): void;
|
|
563
|
-
}
|
|
564
|
-
declare const Marker: react.ForwardRefExoticComponent<MarkerProps & react.RefAttributes<MarkerRef>>;
|
|
567
|
+
declare function Marker({ position, ref, icon, title, detail, popup, visibleRange, clickable, draggable, zIndex, rotate, onClick, onDrag, onDrop, onHover, onLeave, }: MarkerProps): null;
|
|
565
568
|
|
|
569
|
+
interface PolygonRef {
|
|
570
|
+
getPolygon(): SpherePolygon | null;
|
|
571
|
+
togglePopup(show?: boolean, location?: Location): void;
|
|
572
|
+
getPivot(): Location | null;
|
|
573
|
+
getCentroid(): Location | null;
|
|
574
|
+
getBound(): Bound | null;
|
|
575
|
+
getArea(language?: string): number | string | null;
|
|
576
|
+
rotate(angle: number): void;
|
|
577
|
+
updateStyle(options: Partial<GeometryOptions>): void;
|
|
578
|
+
toGeoJSON(): object | null;
|
|
579
|
+
}
|
|
566
580
|
interface PolygonProps {
|
|
567
581
|
positions: Location[];
|
|
582
|
+
ref?: Ref<PolygonRef>;
|
|
568
583
|
title?: string;
|
|
569
584
|
detail?: string;
|
|
570
585
|
label?: string;
|
|
@@ -585,21 +600,21 @@ interface PolygonProps {
|
|
|
585
600
|
onDrag?: (polygon: SpherePolygon) => void;
|
|
586
601
|
onDrop?: (polygon: SpherePolygon) => void;
|
|
587
602
|
}
|
|
588
|
-
|
|
589
|
-
|
|
603
|
+
declare function Polygon({ positions, ref, title, detail, label, labelOptions, popup, visibleRange, lineWidth, lineColor, fillColor, lineStyle, pivot, clickable, draggable, pointer, zIndex, editable, onClick, onDrag, onDrop, }: PolygonProps): null;
|
|
604
|
+
|
|
605
|
+
interface PolylineRef {
|
|
606
|
+
getPolyline(): SpherePolyline | null;
|
|
590
607
|
togglePopup(show?: boolean, location?: Location): void;
|
|
591
608
|
getPivot(): Location | null;
|
|
592
609
|
getCentroid(): Location | null;
|
|
593
610
|
getBound(): Bound | null;
|
|
594
|
-
|
|
611
|
+
getLength(language?: string): number | string | null;
|
|
595
612
|
rotate(angle: number): void;
|
|
596
613
|
updateStyle(options: Partial<GeometryOptions>): void;
|
|
597
|
-
toGeoJSON(): object | null;
|
|
598
614
|
}
|
|
599
|
-
declare const Polygon: react.ForwardRefExoticComponent<PolygonProps & react.RefAttributes<PolygonRef>>;
|
|
600
|
-
|
|
601
615
|
interface PolylineProps {
|
|
602
616
|
positions: Location[];
|
|
617
|
+
ref?: Ref<PolylineRef>;
|
|
603
618
|
title?: string;
|
|
604
619
|
detail?: string;
|
|
605
620
|
label?: string;
|
|
@@ -618,20 +633,18 @@ interface PolylineProps {
|
|
|
618
633
|
onDrag?: (polyline: SpherePolyline) => void;
|
|
619
634
|
onDrop?: (polyline: SpherePolyline) => void;
|
|
620
635
|
}
|
|
621
|
-
|
|
622
|
-
getPolyline(): SpherePolyline | null;
|
|
623
|
-
togglePopup(show?: boolean, location?: Location): void;
|
|
624
|
-
getPivot(): Location | null;
|
|
625
|
-
getCentroid(): Location | null;
|
|
626
|
-
getBound(): Bound | null;
|
|
627
|
-
getLength(language?: string): number | string | null;
|
|
628
|
-
rotate(angle: number): void;
|
|
629
|
-
updateStyle(options: Partial<GeometryOptions>): void;
|
|
630
|
-
}
|
|
631
|
-
declare const Polyline: react.ForwardRefExoticComponent<PolylineProps & react.RefAttributes<PolylineRef>>;
|
|
636
|
+
declare function Polyline({ positions, ref, title, detail, label, labelOptions, popup, visibleRange, lineWidth, lineColor, lineStyle, pivot, clickable, draggable, pointer, zIndex, onClick, onDrag, onDrop, }: PolylineProps): null;
|
|
632
637
|
|
|
638
|
+
interface PopupRef {
|
|
639
|
+
getPopup(): SpherePopup | null;
|
|
640
|
+
setPosition(location: Location): void;
|
|
641
|
+
setTitle(title: string): void;
|
|
642
|
+
setDetail(detail: string): void;
|
|
643
|
+
getElement(): HTMLElement | null;
|
|
644
|
+
}
|
|
633
645
|
interface PopupProps {
|
|
634
646
|
position: Location;
|
|
647
|
+
ref?: Ref<PopupRef>;
|
|
635
648
|
title?: string;
|
|
636
649
|
detail?: string;
|
|
637
650
|
loadDetail?: (element: HTMLElement) => void;
|
|
@@ -641,18 +654,19 @@ interface PopupProps {
|
|
|
641
654
|
closable?: boolean;
|
|
642
655
|
onClose?: (popup: SpherePopup) => void;
|
|
643
656
|
}
|
|
644
|
-
|
|
645
|
-
getPopup(): SpherePopup | null;
|
|
646
|
-
setPosition(location: Location): void;
|
|
647
|
-
setTitle(title: string): void;
|
|
648
|
-
setDetail(detail: string): void;
|
|
649
|
-
getElement(): HTMLElement | null;
|
|
650
|
-
}
|
|
651
|
-
declare const Popup: react.ForwardRefExoticComponent<PopupProps & react.RefAttributes<PopupRef>>;
|
|
657
|
+
declare function Popup({ position, ref, title, detail, loadDetail, html, loadHtml, size, closable, onClose, }: PopupProps): null;
|
|
652
658
|
|
|
659
|
+
interface RectangleRef {
|
|
660
|
+
getRectangle(): SphereRectangle | null;
|
|
661
|
+
togglePopup(show?: boolean, location?: Location): void;
|
|
662
|
+
getBound(): Bound | null;
|
|
663
|
+
getArea(language?: string): number | string | null;
|
|
664
|
+
updateStyle(options: Partial<GeometryOptions>): void;
|
|
665
|
+
}
|
|
653
666
|
interface RectangleProps {
|
|
654
667
|
position: Location;
|
|
655
668
|
size: Size | Location;
|
|
669
|
+
ref?: Ref<RectangleRef>;
|
|
656
670
|
title?: string;
|
|
657
671
|
detail?: string;
|
|
658
672
|
popup?: PopupOptions;
|
|
@@ -669,17 +683,23 @@ interface RectangleProps {
|
|
|
669
683
|
onDrag?: (rectangle: SphereRectangle) => void;
|
|
670
684
|
onDrop?: (rectangle: SphereRectangle) => void;
|
|
671
685
|
}
|
|
672
|
-
|
|
673
|
-
getRectangle(): SphereRectangle | null;
|
|
674
|
-
togglePopup(show?: boolean, location?: Location): void;
|
|
675
|
-
getBound(): Bound | null;
|
|
676
|
-
getArea(language?: string): number | string | null;
|
|
677
|
-
updateStyle(options: Partial<GeometryOptions>): void;
|
|
678
|
-
}
|
|
679
|
-
declare const Rectangle: react.ForwardRefExoticComponent<RectangleProps & react.RefAttributes<RectangleRef>>;
|
|
686
|
+
declare function Rectangle({ position, size, ref, title, detail, popup, visibleRange, lineWidth, lineColor, fillColor, lineStyle, clickable, draggable, editable, zIndex, onClick, onDrag, onDrop, }: RectangleProps): null;
|
|
680
687
|
|
|
688
|
+
interface SphereMapRef {
|
|
689
|
+
getMap(): SphereMap$1 | null;
|
|
690
|
+
setZoom(zoom: number, animate?: boolean): void;
|
|
691
|
+
setCenter(location: Location, animate?: boolean): void;
|
|
692
|
+
setBound(bound: Bound, options?: object): void;
|
|
693
|
+
goTo(target: FlyToOptions, animate?: boolean): void;
|
|
694
|
+
setRotate(angle: number, animate?: boolean): void;
|
|
695
|
+
setPitch(angle: number): void;
|
|
696
|
+
setFilter(filter: FilterType): void;
|
|
697
|
+
resize(): void;
|
|
698
|
+
repaint(): void;
|
|
699
|
+
}
|
|
681
700
|
interface SphereMapProps {
|
|
682
701
|
children?: ReactNode;
|
|
702
|
+
ref?: Ref<SphereMapRef>;
|
|
683
703
|
zoom?: number;
|
|
684
704
|
zoomRange?: Range;
|
|
685
705
|
center?: Location;
|
|
@@ -706,19 +726,7 @@ interface SphereMapProps {
|
|
|
706
726
|
onMouseMove?: (location: Location) => void;
|
|
707
727
|
onError?: (error: Error) => void;
|
|
708
728
|
}
|
|
709
|
-
|
|
710
|
-
getMap(): SphereMap$1 | null;
|
|
711
|
-
setZoom(zoom: number, animate?: boolean): void;
|
|
712
|
-
setCenter(location: Location, animate?: boolean): void;
|
|
713
|
-
setBound(bound: Bound, options?: object): void;
|
|
714
|
-
goTo(target: FlyToOptions, animate?: boolean): void;
|
|
715
|
-
setRotate(angle: number, animate?: boolean): void;
|
|
716
|
-
setPitch(angle: number): void;
|
|
717
|
-
setFilter(filter: FilterType): void;
|
|
718
|
-
resize(): void;
|
|
719
|
-
repaint(): void;
|
|
720
|
-
}
|
|
721
|
-
declare const SphereMap: react.ForwardRefExoticComponent<SphereMapProps & react.RefAttributes<SphereMapRef>>;
|
|
729
|
+
declare function SphereMap({ children, ref, zoom, zoomRange, center, language, input, lastView, ui, filter, rotate, pitch, className, style, id, onReady, onZoom, onLocation, onClick, onDoubleClick, onRotate, onPitch, onDrag, onDrop, onIdle, onMouseMove, onError, }: SphereMapProps): react_jsx_runtime.JSX.Element;
|
|
722
730
|
|
|
723
731
|
interface MapContextValue {
|
|
724
732
|
map: SphereMap$1 | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Ref, ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
interface Location {
|
|
5
5
|
lon: number;
|
|
@@ -463,9 +463,19 @@ declare global {
|
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
interface CircleRef {
|
|
467
|
+
getCircle(): SphereCircle | null;
|
|
468
|
+
togglePopup(show?: boolean, location?: Location): void;
|
|
469
|
+
getCenter(): Location | null;
|
|
470
|
+
getBound(): Bound | null;
|
|
471
|
+
getArea(language?: string): number | string | null;
|
|
472
|
+
getRadius(language?: string): number | string | null;
|
|
473
|
+
updateStyle(options: Partial<GeometryOptions>): void;
|
|
474
|
+
}
|
|
466
475
|
interface CircleProps {
|
|
467
476
|
center: Location;
|
|
468
477
|
radius: number;
|
|
478
|
+
ref?: Ref<CircleRef>;
|
|
469
479
|
title?: string;
|
|
470
480
|
detail?: string;
|
|
471
481
|
popup?: PopupOptions;
|
|
@@ -481,19 +491,16 @@ interface CircleProps {
|
|
|
481
491
|
onDrag?: (circle: SphereCircle) => void;
|
|
482
492
|
onDrop?: (circle: SphereCircle) => void;
|
|
483
493
|
}
|
|
484
|
-
|
|
485
|
-
getCircle(): SphereCircle | null;
|
|
486
|
-
togglePopup(show?: boolean, location?: Location): void;
|
|
487
|
-
getCenter(): Location | null;
|
|
488
|
-
getBound(): Bound | null;
|
|
489
|
-
getArea(language?: string): number | string | null;
|
|
490
|
-
getRadius(language?: string): number | string | null;
|
|
491
|
-
updateStyle(options: Partial<GeometryOptions>): void;
|
|
492
|
-
}
|
|
493
|
-
declare const Circle: react.ForwardRefExoticComponent<CircleProps & react.RefAttributes<CircleRef>>;
|
|
494
|
+
declare function Circle({ center, radius, ref, title, detail, popup, visibleRange, lineWidth, lineColor, fillColor, lineStyle, clickable, draggable, zIndex, onClick, onDrag, onDrop, }: CircleProps): null;
|
|
494
495
|
|
|
496
|
+
interface DotRef {
|
|
497
|
+
getDot(): SphereDot | null;
|
|
498
|
+
setPosition(location: Location): void;
|
|
499
|
+
getPosition(): Location | null;
|
|
500
|
+
}
|
|
495
501
|
interface DotProps {
|
|
496
502
|
position: Location;
|
|
503
|
+
ref?: Ref<DotRef>;
|
|
497
504
|
title?: string;
|
|
498
505
|
detail?: string;
|
|
499
506
|
visibleRange?: Range;
|
|
@@ -506,12 +513,7 @@ interface DotProps {
|
|
|
506
513
|
onDrag?: (dot: SphereDot) => void;
|
|
507
514
|
onDrop?: (dot: SphereDot, location: Location) => void;
|
|
508
515
|
}
|
|
509
|
-
|
|
510
|
-
getDot(): SphereDot | null;
|
|
511
|
-
setPosition(location: Location): void;
|
|
512
|
-
getPosition(): Location | null;
|
|
513
|
-
}
|
|
514
|
-
declare const Dot: react.ForwardRefExoticComponent<DotProps & react.RefAttributes<DotRef>>;
|
|
516
|
+
declare function Dot({ position, ref, title, detail, visibleRange, lineWidth, lineColor, clickable, draggable, zIndex, onClick, onDrag, onDrop, }: DotProps): null;
|
|
515
517
|
|
|
516
518
|
interface LayerProps {
|
|
517
519
|
name?: string;
|
|
@@ -538,8 +540,15 @@ interface LayerProps {
|
|
|
538
540
|
}
|
|
539
541
|
declare function Layer({ name, preset, isBase, type, url, zoomRange, source, opacity, zIndex, bound, attribution, extraQuery, id, format, srs, tileMatrixPrefix, styles, version, refresh, zoomOffset, beforeId, }: LayerProps): null;
|
|
540
542
|
|
|
543
|
+
interface MarkerRef {
|
|
544
|
+
getMarker(): SphereMarker | null;
|
|
545
|
+
togglePopup(show?: boolean): void;
|
|
546
|
+
setPosition(location: Location, animate?: boolean): void;
|
|
547
|
+
setRotation(angle: number): void;
|
|
548
|
+
}
|
|
541
549
|
interface MarkerProps {
|
|
542
550
|
position: Location;
|
|
551
|
+
ref?: Ref<MarkerRef>;
|
|
543
552
|
icon?: Icon;
|
|
544
553
|
title?: string;
|
|
545
554
|
detail?: string;
|
|
@@ -555,16 +564,22 @@ interface MarkerProps {
|
|
|
555
564
|
onHover?: (marker: SphereMarker) => void;
|
|
556
565
|
onLeave?: (marker: SphereMarker) => void;
|
|
557
566
|
}
|
|
558
|
-
|
|
559
|
-
getMarker(): SphereMarker | null;
|
|
560
|
-
togglePopup(show?: boolean): void;
|
|
561
|
-
setPosition(location: Location, animate?: boolean): void;
|
|
562
|
-
setRotation(angle: number): void;
|
|
563
|
-
}
|
|
564
|
-
declare const Marker: react.ForwardRefExoticComponent<MarkerProps & react.RefAttributes<MarkerRef>>;
|
|
567
|
+
declare function Marker({ position, ref, icon, title, detail, popup, visibleRange, clickable, draggable, zIndex, rotate, onClick, onDrag, onDrop, onHover, onLeave, }: MarkerProps): null;
|
|
565
568
|
|
|
569
|
+
interface PolygonRef {
|
|
570
|
+
getPolygon(): SpherePolygon | null;
|
|
571
|
+
togglePopup(show?: boolean, location?: Location): void;
|
|
572
|
+
getPivot(): Location | null;
|
|
573
|
+
getCentroid(): Location | null;
|
|
574
|
+
getBound(): Bound | null;
|
|
575
|
+
getArea(language?: string): number | string | null;
|
|
576
|
+
rotate(angle: number): void;
|
|
577
|
+
updateStyle(options: Partial<GeometryOptions>): void;
|
|
578
|
+
toGeoJSON(): object | null;
|
|
579
|
+
}
|
|
566
580
|
interface PolygonProps {
|
|
567
581
|
positions: Location[];
|
|
582
|
+
ref?: Ref<PolygonRef>;
|
|
568
583
|
title?: string;
|
|
569
584
|
detail?: string;
|
|
570
585
|
label?: string;
|
|
@@ -585,21 +600,21 @@ interface PolygonProps {
|
|
|
585
600
|
onDrag?: (polygon: SpherePolygon) => void;
|
|
586
601
|
onDrop?: (polygon: SpherePolygon) => void;
|
|
587
602
|
}
|
|
588
|
-
|
|
589
|
-
|
|
603
|
+
declare function Polygon({ positions, ref, title, detail, label, labelOptions, popup, visibleRange, lineWidth, lineColor, fillColor, lineStyle, pivot, clickable, draggable, pointer, zIndex, editable, onClick, onDrag, onDrop, }: PolygonProps): null;
|
|
604
|
+
|
|
605
|
+
interface PolylineRef {
|
|
606
|
+
getPolyline(): SpherePolyline | null;
|
|
590
607
|
togglePopup(show?: boolean, location?: Location): void;
|
|
591
608
|
getPivot(): Location | null;
|
|
592
609
|
getCentroid(): Location | null;
|
|
593
610
|
getBound(): Bound | null;
|
|
594
|
-
|
|
611
|
+
getLength(language?: string): number | string | null;
|
|
595
612
|
rotate(angle: number): void;
|
|
596
613
|
updateStyle(options: Partial<GeometryOptions>): void;
|
|
597
|
-
toGeoJSON(): object | null;
|
|
598
614
|
}
|
|
599
|
-
declare const Polygon: react.ForwardRefExoticComponent<PolygonProps & react.RefAttributes<PolygonRef>>;
|
|
600
|
-
|
|
601
615
|
interface PolylineProps {
|
|
602
616
|
positions: Location[];
|
|
617
|
+
ref?: Ref<PolylineRef>;
|
|
603
618
|
title?: string;
|
|
604
619
|
detail?: string;
|
|
605
620
|
label?: string;
|
|
@@ -618,20 +633,18 @@ interface PolylineProps {
|
|
|
618
633
|
onDrag?: (polyline: SpherePolyline) => void;
|
|
619
634
|
onDrop?: (polyline: SpherePolyline) => void;
|
|
620
635
|
}
|
|
621
|
-
|
|
622
|
-
getPolyline(): SpherePolyline | null;
|
|
623
|
-
togglePopup(show?: boolean, location?: Location): void;
|
|
624
|
-
getPivot(): Location | null;
|
|
625
|
-
getCentroid(): Location | null;
|
|
626
|
-
getBound(): Bound | null;
|
|
627
|
-
getLength(language?: string): number | string | null;
|
|
628
|
-
rotate(angle: number): void;
|
|
629
|
-
updateStyle(options: Partial<GeometryOptions>): void;
|
|
630
|
-
}
|
|
631
|
-
declare const Polyline: react.ForwardRefExoticComponent<PolylineProps & react.RefAttributes<PolylineRef>>;
|
|
636
|
+
declare function Polyline({ positions, ref, title, detail, label, labelOptions, popup, visibleRange, lineWidth, lineColor, lineStyle, pivot, clickable, draggable, pointer, zIndex, onClick, onDrag, onDrop, }: PolylineProps): null;
|
|
632
637
|
|
|
638
|
+
interface PopupRef {
|
|
639
|
+
getPopup(): SpherePopup | null;
|
|
640
|
+
setPosition(location: Location): void;
|
|
641
|
+
setTitle(title: string): void;
|
|
642
|
+
setDetail(detail: string): void;
|
|
643
|
+
getElement(): HTMLElement | null;
|
|
644
|
+
}
|
|
633
645
|
interface PopupProps {
|
|
634
646
|
position: Location;
|
|
647
|
+
ref?: Ref<PopupRef>;
|
|
635
648
|
title?: string;
|
|
636
649
|
detail?: string;
|
|
637
650
|
loadDetail?: (element: HTMLElement) => void;
|
|
@@ -641,18 +654,19 @@ interface PopupProps {
|
|
|
641
654
|
closable?: boolean;
|
|
642
655
|
onClose?: (popup: SpherePopup) => void;
|
|
643
656
|
}
|
|
644
|
-
|
|
645
|
-
getPopup(): SpherePopup | null;
|
|
646
|
-
setPosition(location: Location): void;
|
|
647
|
-
setTitle(title: string): void;
|
|
648
|
-
setDetail(detail: string): void;
|
|
649
|
-
getElement(): HTMLElement | null;
|
|
650
|
-
}
|
|
651
|
-
declare const Popup: react.ForwardRefExoticComponent<PopupProps & react.RefAttributes<PopupRef>>;
|
|
657
|
+
declare function Popup({ position, ref, title, detail, loadDetail, html, loadHtml, size, closable, onClose, }: PopupProps): null;
|
|
652
658
|
|
|
659
|
+
interface RectangleRef {
|
|
660
|
+
getRectangle(): SphereRectangle | null;
|
|
661
|
+
togglePopup(show?: boolean, location?: Location): void;
|
|
662
|
+
getBound(): Bound | null;
|
|
663
|
+
getArea(language?: string): number | string | null;
|
|
664
|
+
updateStyle(options: Partial<GeometryOptions>): void;
|
|
665
|
+
}
|
|
653
666
|
interface RectangleProps {
|
|
654
667
|
position: Location;
|
|
655
668
|
size: Size | Location;
|
|
669
|
+
ref?: Ref<RectangleRef>;
|
|
656
670
|
title?: string;
|
|
657
671
|
detail?: string;
|
|
658
672
|
popup?: PopupOptions;
|
|
@@ -669,17 +683,23 @@ interface RectangleProps {
|
|
|
669
683
|
onDrag?: (rectangle: SphereRectangle) => void;
|
|
670
684
|
onDrop?: (rectangle: SphereRectangle) => void;
|
|
671
685
|
}
|
|
672
|
-
|
|
673
|
-
getRectangle(): SphereRectangle | null;
|
|
674
|
-
togglePopup(show?: boolean, location?: Location): void;
|
|
675
|
-
getBound(): Bound | null;
|
|
676
|
-
getArea(language?: string): number | string | null;
|
|
677
|
-
updateStyle(options: Partial<GeometryOptions>): void;
|
|
678
|
-
}
|
|
679
|
-
declare const Rectangle: react.ForwardRefExoticComponent<RectangleProps & react.RefAttributes<RectangleRef>>;
|
|
686
|
+
declare function Rectangle({ position, size, ref, title, detail, popup, visibleRange, lineWidth, lineColor, fillColor, lineStyle, clickable, draggable, editable, zIndex, onClick, onDrag, onDrop, }: RectangleProps): null;
|
|
680
687
|
|
|
688
|
+
interface SphereMapRef {
|
|
689
|
+
getMap(): SphereMap$1 | null;
|
|
690
|
+
setZoom(zoom: number, animate?: boolean): void;
|
|
691
|
+
setCenter(location: Location, animate?: boolean): void;
|
|
692
|
+
setBound(bound: Bound, options?: object): void;
|
|
693
|
+
goTo(target: FlyToOptions, animate?: boolean): void;
|
|
694
|
+
setRotate(angle: number, animate?: boolean): void;
|
|
695
|
+
setPitch(angle: number): void;
|
|
696
|
+
setFilter(filter: FilterType): void;
|
|
697
|
+
resize(): void;
|
|
698
|
+
repaint(): void;
|
|
699
|
+
}
|
|
681
700
|
interface SphereMapProps {
|
|
682
701
|
children?: ReactNode;
|
|
702
|
+
ref?: Ref<SphereMapRef>;
|
|
683
703
|
zoom?: number;
|
|
684
704
|
zoomRange?: Range;
|
|
685
705
|
center?: Location;
|
|
@@ -706,19 +726,7 @@ interface SphereMapProps {
|
|
|
706
726
|
onMouseMove?: (location: Location) => void;
|
|
707
727
|
onError?: (error: Error) => void;
|
|
708
728
|
}
|
|
709
|
-
|
|
710
|
-
getMap(): SphereMap$1 | null;
|
|
711
|
-
setZoom(zoom: number, animate?: boolean): void;
|
|
712
|
-
setCenter(location: Location, animate?: boolean): void;
|
|
713
|
-
setBound(bound: Bound, options?: object): void;
|
|
714
|
-
goTo(target: FlyToOptions, animate?: boolean): void;
|
|
715
|
-
setRotate(angle: number, animate?: boolean): void;
|
|
716
|
-
setPitch(angle: number): void;
|
|
717
|
-
setFilter(filter: FilterType): void;
|
|
718
|
-
resize(): void;
|
|
719
|
-
repaint(): void;
|
|
720
|
-
}
|
|
721
|
-
declare const SphereMap: react.ForwardRefExoticComponent<SphereMapProps & react.RefAttributes<SphereMapRef>>;
|
|
729
|
+
declare function SphereMap({ children, ref, zoom, zoomRange, center, language, input, lastView, ui, filter, rotate, pitch, className, style, id, onReady, onZoom, onLocation, onClick, onDoubleClick, onRotate, onPitch, onDrag, onDrop, onIdle, onMouseMove, onError, }: SphereMapProps): react_jsx_runtime.JSX.Element;
|
|
722
730
|
|
|
723
731
|
interface MapContextValue {
|
|
724
732
|
map: SphereMap$1 | null;
|