@types\mapbox-gl Change RasterSource URL to optional.

This commit is contained in:
Lenny
2018-03-23 08:39:11 -05:00
parent f2982c1754
commit 371c3bad16
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -610,7 +610,7 @@ declare namespace mapboxgl {
interface RasterSource extends Source {
type: 'raster';
url: string;
url?: string;
tiles?: string[];
minzoom?: number;
maxzoom?: number;
+16
View File
@@ -205,6 +205,22 @@ var videoSourceObj = new mapboxgl.VideoSource({
map.addSource('some id', videoSourceObj); // add
map.removeSource('some id'); // remove
/**
* Add Raster Source /// made URL optional to allow only tiles.
*/
map.addSource('radar', {
type: 'raster',
tiles: ['https://nowcoast.noaa.gov/arcgis/services/nowcoast/radar_meteo_imagery_nexrad_time/MapServer/WmsServer?bbox={bbox-epsg-3857}&service=WMS&request=GetMap&version=1.3.0&layers=1&styles=&format=image/png&transparent=true&height=256&width=256&crs=EPSG:3857'],
tileSize: 256
})
map.addLayer({
id: 'radar',
type: 'raster',
source: 'radar',
paint: {}
})
/**
* Popup
*/