mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Merge pull request #21266 from RiON69/master
Add Leaflet.PolylineMeasure typings
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
// Type definitions for leaflet.polylinemeasure 1.0
|
||||
// Project: https://github.com/ppete2/Leaflet.PolylineMeasure#readme
|
||||
// Definitions by: Rinat Sultanov <https://github.com/RiON69>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as L from 'leaflet';
|
||||
|
||||
declare module 'leaflet' {
|
||||
namespace Control {
|
||||
interface PolylineMeasure extends Control {
|
||||
new (options?: PolylineMeasureOptions): any;
|
||||
}
|
||||
|
||||
interface PolylineMeasureOptions {
|
||||
position?: string;
|
||||
unit?: string;
|
||||
measureControlTitleOn?: string;
|
||||
measureControlTitleOff?: string;
|
||||
measureControlLabel?: string;
|
||||
measureControlClasses?: any[];
|
||||
backgroundColor?: string;
|
||||
cursor?: string;
|
||||
clearMeasurementsOnStop?: boolean;
|
||||
showMeasurementsClearControl?: boolean;
|
||||
clearControlTitle?: string;
|
||||
clearControlLabel?: string;
|
||||
clearControlClasses?: any[];
|
||||
showUnitControl?: boolean;
|
||||
tempLine?: any;
|
||||
fixedLine?: any;
|
||||
startCircle?: any;
|
||||
intermedCircle?: any;
|
||||
currentCircle?: any;
|
||||
endCircle?: any;
|
||||
}
|
||||
}
|
||||
|
||||
namespace control {
|
||||
function polylineMeasure(options?: Control.PolylineMeasureOptions): Control.PolylineMeasure;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import * as L from 'leaflet';
|
||||
import 'leaflet.polylinemeasure';
|
||||
|
||||
const map = L.map('map', {center: L.latLng(43.24209, 76.87743), zoom: 15});
|
||||
|
||||
L.tileLayer("http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png", {
|
||||
subdomains: ['a', 'b', 'c'],
|
||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
}).addTo(map);
|
||||
|
||||
L.control.polylineMeasure().addTo(map);
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"DOM"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"leaflet.polylinemeasure-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user