Skip to content

Commit 4639f12

Browse files
committed
Merge pull request DefinitelyTyped#7496 from wcomartin/master
Add leaflet.fullscreen library definitions
2 parents 81b951f + c4df2bf commit 4639f12

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/// <reference path="leaflet.fullscreen.d.ts" />
2+
3+
var map: L.Map;
4+
5+
// Defaults
6+
var icon: L.Control.Fullscreen = L.control.fullscreen({
7+
position: 'topleft',
8+
title: 'Full Screen',
9+
titleCancel: 'Exit Full Screen',
10+
forceSeparateButton: false,
11+
forcePseudoFullscreen: false
12+
});
13+
14+
icon.addTo(map);
15+
16+
17+
// My Usage
18+
19+
L.control.fullscreen({
20+
position: 'topleft',
21+
content: '<i class="fa fa-arrows-alt"></i>',
22+
forceSeparateButton: true,
23+
}).addTo(map);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Type definitions for Leaflet.fullscreen v1.3.0
2+
// Project: https://github.com/brunob/leaflet.fullscreen
3+
// Definitions by: William Comartin <https://github.com/wcomartin>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="../leaflet/leaflet.d.ts" />
7+
8+
declare module L {
9+
10+
namespace Control {
11+
12+
export interface Fullscreen extends L.Control {}
13+
14+
export interface FullscreenOptions {
15+
content?: string,
16+
position?: string,
17+
title?: string,
18+
titleCancel?: string,
19+
forceSeparateButton?: boolean,
20+
forcePseudoFullscreen?: boolean
21+
}
22+
}
23+
24+
namespace control {
25+
26+
/**
27+
* Creates a fullscreen control.
28+
*/
29+
export function fullscreen(options?: Control.FullscreenOptions): L.Control.Fullscreen;
30+
31+
}
32+
}

0 commit comments

Comments
 (0)