Merge pull request #1 from RiON69/RiON69-Leaflet-PolylineMeasure-1

Add Leaflet.PolylineMeasure typings
This commit is contained in:
RiON69
2017-11-06 16:26:12 +06:00
committed by GitHub
4 changed files with 78 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
// 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
/// <reference types="leaflet" />
declare module L {
namespace Control {
export interface PolylineMeasure extends L.Control {
new (options?: PolylineMeasureOptions): any;
}
export 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;
}
}
export namespace control {
export function polylineMeasure (options?: Control.PolylineMeasureOptions): Control.PolylineMeasure;
}
}
@@ -0,0 +1,12 @@
import * as L from 'leaflet';
import 'leaflet.polylinemeasure';
let 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,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"DOM"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"leaflet-polylinemeasure-tests.ts"
]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }