mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-02 08:10:05 +00:00
Merge pull request #30688 from Fluccioni/missing-mapbox-classic-definition
feat(mapbox): add missing styleLayer definition
This commit is contained in:
15
types/mapbox/index.d.ts
vendored
15
types/mapbox/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for Mapbox 1.6
|
||||
// Project: https://www.mapbox.com/mapbox.js/
|
||||
// Definitions by: Maxime Fabre <https://github.com/anahkiasen>
|
||||
// Florian Luccioni <https://github.com/Fluccioni>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -153,6 +154,20 @@ declare global {
|
||||
getGeoJSON(): any;
|
||||
}
|
||||
|
||||
// StyleLayer
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* L.mapbox.styleLayer provides a way to integrate styles created with Mapbox Studio into your map.
|
||||
*/
|
||||
function styleLayer(url: string, options?: StyleLayerOptions): StyleLayer;
|
||||
|
||||
interface StyleLayerOptions extends Leaflet.TileLayerOptions {
|
||||
sanitizer?(template: string): string;
|
||||
}
|
||||
|
||||
type StyleLayer = Leaflet.TileLayer;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////// GEOCODING /////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -4,6 +4,8 @@ const mapboxTiles = L.tileLayer('https://{s}.tiles.mapbox.com/v3/examples.map-i8
|
||||
|
||||
const map = L.map('map').addLayer(mapboxTiles).setView(new L.LatLng([42.3610, -71.0587]), 15);
|
||||
|
||||
const lightTiles = L.mapbox.styleLayer('mapbox://styles/mapbox/light-v9').addTo(map);
|
||||
|
||||
const coordinates = document.getElementById('coordinates');
|
||||
|
||||
const marker = L.marker(new L.LatLng([0, 0]), {
|
||||
|
||||
Reference in New Issue
Block a user