Merge pull request #12789 from ahocevar/mapbox-vector-layer-tilejson
Handle TileJSON urls in Mapbox Style document
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {
|
||||
import MapboxVectorLayer, {
|
||||
getMapboxPath,
|
||||
normalizeSourceUrl,
|
||||
normalizeSpriteUrl,
|
||||
@@ -91,4 +91,29 @@ describe('ol/layer/MapboxVector', () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe('TileJSON', function () {
|
||||
it('lets ol-mapbox-style handle TileJSON URLs', function (done) {
|
||||
const layer = new MapboxVectorLayer({
|
||||
styleUrl:
|
||||
'data:,' +
|
||||
encodeURIComponent(
|
||||
JSON.stringify({
|
||||
version: 8,
|
||||
sources: {
|
||||
'foo': {
|
||||
url: '/spec/ol/data/tilejson.json',
|
||||
type: 'vector',
|
||||
},
|
||||
},
|
||||
})
|
||||
),
|
||||
});
|
||||
layer.on('change:source', function () {
|
||||
// we only get here when a new source was set, which is what ol-mapbox-style's
|
||||
// setupVectorSource() does.
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user