Merge pull request #21266 from RiON69/master

Add Leaflet.PolylineMeasure typings
This commit is contained in:
Daniel Rosenwasser
2017-11-10 13:59:34 -08:00
committed by GitHub
4 changed files with 77 additions and 0 deletions
+41
View File
@@ -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: '&copy; <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" }