mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-14 22:10:30 +00:00
Merge pull request #34061 from fnberta/react-map-gl-4.1
[react-map-gl] add geolocate control
This commit is contained in:
Vendored
+12
@@ -317,6 +317,18 @@ export interface FullscreenControlProps extends BaseControlProps {
|
||||
|
||||
export class FullscreenControl extends BaseControl<FullscreenControlProps> {}
|
||||
|
||||
export interface GeolocateControlProps extends BaseControlProps {
|
||||
className?: string;
|
||||
positionOptions?: MapboxGL.PositionOptions;
|
||||
fitBoundsOptions?: MapboxGL.FitBoundsOptions;
|
||||
trackUserLocation?: boolean;
|
||||
showUserLocation?: boolean;
|
||||
onViewStateChange?: (info: ViewStateChangeInfo) => void;
|
||||
onViewportChange?: (viewState: ViewState) => void;
|
||||
}
|
||||
|
||||
export class GeolocateControl extends BaseControl<GeolocateControlProps> {}
|
||||
|
||||
export interface DraggableControlProps extends BaseControlProps {
|
||||
draggable?: boolean;
|
||||
onDrag?: (event: DragEvent) => void;
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
SVGOverlay,
|
||||
HTMLOverlay,
|
||||
FullscreenControl,
|
||||
GeolocateControl,
|
||||
CanvasRedrawOptions,
|
||||
HTMLRedrawOptions,
|
||||
SVGRedrawOptions,
|
||||
@@ -39,6 +40,7 @@ class MyMap extends React.Component<{}, State> {
|
||||
ref={this.setRefInteractive}
|
||||
>
|
||||
<FullscreenControl className="test-class" container={document.querySelector('body')} />
|
||||
<GeolocateControl className="test-class" />
|
||||
<CanvasOverlay
|
||||
redraw={opts => {
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user