Extending FeatureLoader type and refactoring loadFeaturesXhr

This commit is contained in:
Simon Seyock committed 2020-10-06 10:29:07 +02:00
1 parent 1ec6713f31
commit 393e83cd29
2 files changed
+123 -102

No files matched your search

+17 -6
View File
@@ -528,11 +528,22 @@ export default VectorTile;
* @param {string} url URL.
*/
export function defaultLoadFunction(tile, url) {
const loader = loadFeaturesXhr(
url,
tile.getFormat(),
tile.onLoad.bind(tile),
tile.onError.bind(tile)
tile.setLoader(
/**
* @param {import("../extent.js").Extent} extent Extent.
* @param {number} resolution Resolution.
* @param {import("../proj/Projection.js").default} projection Projection.
*/
function (extent, resolution, projection) {
loadFeaturesXhr(
url,
tile.getFormat(),
extent,
resolution,
projection,
tile.onLoad.bind(tile),
tile.onError.bind(tile)
);
}
);
tile.setLoader(loader);
}