Merge pull request #8145 from onikiienko/master

leaflet-curve TypeScript type definitions
This commit is contained in:
Horiuchi_H
2016-02-19 12:20:16 +09:00
2 changed files with 46 additions and 0 deletions
+33
View File
@@ -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 = '&copy; <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);
+13
View File
@@ -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;
}