Module: ol/featureloader

ol/featureloader


import * as olFeatureloader from 'ol/featureloader';

Methods

module:ol/featureloader.setWithCredentials(xhrWithCredentials)

featureloader.js, line 150
import {setWithCredentials} from 'ol/featureloader';

Setter for the withCredentials configuration for the XHR.

Name Type Description
xhrWithCredentials boolean

The value of withCredentials to set. Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/

module:ol/featureloader.xhr(url, format){module:ol/featureloader~FeatureLoader}

featureloader.js, line 127
import {xhr} from 'ol/featureloader';

Create an XHR feature loader for a url and format. The feature loader loads features (with XHR), parses the features, and adds them to the vector source.

Name Type Description
url string | module:ol/featureloader~FeatureUrlFunction

Feature URL service.

format module:ol/format/Feature~FeatureFormat

Feature format.

Returns:
The feature loader.

Type Definitions

FeatureLoader()

featureloader.js, line 14

module:ol/source/Vector sources use a function of this type to load features.

This function takes an module:ol/extent~Extent representing the area to be loaded, a {number} representing the resolution (map units per pixel) and an module:ol/proj/Projection for the projection as arguments. this within the function is bound to the module:ol/source/Vector it's called from.

The function is responsible for loading the features and adding them to the source.

FeatureUrlFunction()

featureloader.js, line 32

module:ol/source/Vector sources use a function of this type to get the url to load features from.

This function takes an module:ol/extent~Extent representing the area to be loaded, a {number} representing the resolution (map units per pixel) and an module:ol/proj/Projection for the projection as arguments and returns a {string} representing the URL.