Add supported media type list to feature formats

This commit is contained in:
Tim Schaub
2021-09-04 11:06:52 -06:00
parent ac4e472353
commit c8067bebbb
9 changed files with 104 additions and 5 deletions

View File

@@ -76,6 +76,12 @@ class FeatureFormat {
* @type {import("../proj/Projection.js").default|undefined}
*/
this.defaultFeatureProjection = undefined;
/**
* A list media types supported by the format in descending order of preference.
* @type {Array<string>}
*/
this.supportedMediaTypes = null;
}
/**

View File

@@ -132,6 +132,8 @@ class GMLBase extends XMLFeature {
'featureMember': makeArrayPusher(this.readFeaturesInternal),
'featureMembers': makeReplacer(this.readFeaturesInternal),
};
this.supportedMediaTypes = ['application/gml+xml'];
}
/**

View File

@@ -82,6 +82,11 @@ class GeoJSON extends JSONFeature {
* @private
*/
this.extractGeometryName_ = options.extractGeometryName;
this.supportedMediaTypes = [
'application/geo+json',
'application/vnd.geo+json',
];
}
/**

View File

@@ -489,6 +489,8 @@ class KML extends XMLFeature {
this.iconUrlFunction_ = options.iconUrlFunction
? options.iconUrlFunction
: defaultIconUrlFunction;
this.supportedMediaTypes = ['application/vnd.google-earth.kml+xml'];
}
/**

View File

@@ -89,6 +89,11 @@ class MVT extends FeatureFormat {
* @type {string}
*/
this.idProperty_ = options.idProperty;
this.supportedMediaTypes = [
'application/vnd.mapbox-vector-tile',
'application/x-protobuf',
];
}
/**