mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-09 09:17:09 +00:00
Changing leaflet dependency handling
This commit is contained in:
Vendored
+4
-3
@@ -1,12 +1,12 @@
|
||||
// Type definitions for Leaflet.heat v0.2.0
|
||||
// Type definitions for Leaflet.heat 0.2
|
||||
// Project: https://github.com/Leaflet/Leaflet.heat
|
||||
// Definitions by: Önder Ceylan <https://github.com/onderceylan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="leaflet" />
|
||||
import * as L from 'leaflet';
|
||||
|
||||
declare namespace L {
|
||||
declare module 'leaflet' {
|
||||
type HeatLatLngTuple = [number, number, number];
|
||||
|
||||
interface ColorGradientConfig {
|
||||
@@ -26,6 +26,7 @@ declare namespace L {
|
||||
setOptions(options: HeatMapOptions): HeatLayer;
|
||||
addLatLng(latlng: LatLng | HeatLatLngTuple): HeatLayer;
|
||||
setLatLngs(latlngs: Array<LatLng | HeatLatLngTuple>): HeatLayer;
|
||||
redraw(): TileLayer;
|
||||
}
|
||||
|
||||
function heatLayer(latlngs: Array<LatLng | HeatLatLngTuple>, options: HeatMapOptions): HeatLayer;
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
const 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(50.5, 30.5),
|
||||
zoom: 15,
|
||||
});
|
||||
import * as L from 'leaflet';
|
||||
import 'leaflet.heat';
|
||||
|
||||
const osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||
const osmAttrib = '© <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
|
||||
const osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib});
|
||||
const map = new L.Map('map', {
|
||||
layers: [osm],
|
||||
center: new L.LatLng(50.5, 30.5),
|
||||
zoom: 15,
|
||||
});
|
||||
|
||||
// Each point in the input array can be either an array like [50.5, 30.5, 0.5], or a Leaflet LatLng object.
|
||||
const heat: L.HeatLayer = L.heatLayer([
|
||||
|
||||
Reference in New Issue
Block a user