Add FullscreenControl component type definition added in react-map-gl 4.1

This commit is contained in:
Sander Siim
2019-03-20 16:14:47 +02:00
parent 74cfd562f6
commit 5d13cc220d
2 changed files with 11 additions and 1 deletions

View File

@@ -1,7 +1,8 @@
// Type definitions for react-map-gl 4.0
// Type definitions for react-map-gl 4.1
// Project: https://github.com/uber/react-map-gl#readme
// Definitions by: Robert Imig <https://github.com/rimig>
// Fabio Berta <https://github.com/fnberta>
// Sander Siim <https://github.com/sandersiim>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
@@ -309,6 +310,13 @@ export interface NavigationControlProps extends BaseControlProps {
export class NavigationControl extends BaseControl<NavigationControlProps> {}
export interface FullscreenControlProps extends BaseControlProps {
className?: string;
container?: HTMLElement | null;
}
export class FullscreenControl extends BaseControl<FullscreenControlProps> {}
export interface DraggableControlProps extends BaseControlProps {
draggable?: boolean;
onDrag?: (event: DragEvent) => void;

View File

@@ -5,6 +5,7 @@ import {
CanvasOverlay,
SVGOverlay,
HTMLOverlay,
FullscreenControl,
CanvasRedrawOptions,
HTMLRedrawOptions,
SVGRedrawOptions,
@@ -37,6 +38,7 @@ class MyMap extends React.Component<{}, State> {
width={400}
ref={this.setRefInteractive}
>
<FullscreenControl className="test-class" container={document.querySelector('body')} />
<CanvasOverlay
redraw={opts => {
const {