mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
Merge pull request #8145 from onikiienko/master
leaflet-curve TypeScript type definitions
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/// <reference path="../leaflet/leaflet.d.ts" />
|
||||
/// <reference path="leaflet-curve.d.ts" />
|
||||
|
||||
|
||||
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
||||
osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}),
|
||||
map = new L.Map('map', {layers: [osm], center: new L.LatLng(-37.7772, 175.2756), zoom: 15 }),
|
||||
objectToSetOnMap = {
|
||||
"color": "black",
|
||||
start: {
|
||||
x: 37.64903402157866,
|
||||
y: -3.6474609375000004
|
||||
},
|
||||
vertex: {
|
||||
x: 38.839707613545144,
|
||||
y: -1.9555664062500002
|
||||
},
|
||||
end: {
|
||||
x: 39.977120098439634,
|
||||
y: -3.6474609375000004
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
L.curve(
|
||||
[
|
||||
'M',[objectToSetOnMap.start.x, objectToSetOnMap.start.y],
|
||||
'C',[objectToSetOnMap.start.x, objectToSetOnMap.start.y], [objectToSetOnMap.vertex.x, objectToSetOnMap.vertex.y], [objectToSetOnMap.end.x, objectToSetOnMap.end.y],
|
||||
'T',[objectToSetOnMap.end.x, objectToSetOnMap.end.y]
|
||||
],
|
||||
{color: objectToSetOnMap.color}
|
||||
).addTo(map);
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for leaflet-curve 0.0.1
|
||||
// Project: https://github.com/onikiienko/Leaflet.curve
|
||||
// Definitions by: Onikiienko <https://github.com/onikiienko>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../leaflet/leaflet.d.ts" />
|
||||
|
||||
declare module L {
|
||||
/**
|
||||
* Drawing Bezier curves and other complex shapes.
|
||||
*/
|
||||
function curve(path: any[], options?: L.PathOptions): Path;
|
||||
}
|
||||
Reference in New Issue
Block a user