Functions
-
import {setWithCredentials} from 'ol/featureloader';Setter for the withCredentials configuration for the XHR.
Name Type Description xhrWithCredentialsboolean The value of withCredentials to set. Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/
-
import {xhr} from 'ol/featureloader';Create an XHR feature loader for a
urlandformat. The feature loader loads features (with XHR), parses the features, and adds them to the vector source.Name Type Description urlstring | FeatureUrlFunction Feature URL service.
formatFeatureFormat<FeatureType> Feature format.
Returns:
The feature loader.
Type Definitions
-
VectorSourcesources use a function of this type to load features.This function takes up to 5 arguments. These are an
Extentrepresenting the area to be loaded, a{number}representing the resolution (map units per pixel), aProjectionfor the projection, an optional success callback that should get the loaded features passed as an argument and an optional failure callback with no arguments. If the callbacks are not used, the corresponding vector source will not fire'featuresloadend'and'featuresloaderror'events.thiswithin the function is bound to theVectorSourceit's called from.The function is responsible for loading the features and adding them to the source.
-
VectorSourcesources use a function of this type to get the url to load features from.This function takes an
Extentrepresenting the area to be loaded, a{number}representing the resolution (map units per pixel) and anProjectionfor the projection as arguments and returns a{string}representing the URL.