Remove extent option for sources
Most of our uses of source extent were cargo cult programming. The source extent was seldom and inconsistently used. Instead, layers can now be configured with an extent, and layer renderers limit rendering (and data requests) to the layer extent. For vector sources, the `getExtent` method returns the extent of currently loaded features (this was the case before and after this change). For tile based sources, we will likely want to allow easy construction of tile grids based on an extent (this is not possible before or after this change, but could be added later).
This commit is contained in:
+1
-161
@@ -2622,7 +2622,6 @@ olx.source.BingMapsOptions.prototype.tileLoadFunction;
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* format: ol.format.Feature,
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike}}
|
||||
@@ -2638,13 +2637,6 @@ olx.source.FormatVectorOptions;
|
||||
olx.source.FormatVectorOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.FormatVectorOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Format.
|
||||
* @type {ol.format.Feature}
|
||||
@@ -2669,7 +2661,6 @@ olx.source.FormatVectorOptions.prototype.projection;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* defaultProjection: ol.proj.ProjectionLike,
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* object: (GeoJSONObject|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -2695,13 +2686,6 @@ olx.source.GeoJSONOptions.prototype.attributions;
|
||||
olx.source.GeoJSONOptions.prototype.defaultProjection;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.GeoJSONOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -2748,7 +2732,6 @@ olx.source.GeoJSONOptions.prototype.urls;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* doc: (Document|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* node: (Node|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -2774,13 +2757,6 @@ olx.source.GPXOptions.prototype.attributions;
|
||||
olx.source.GPXOptions.prototype.doc;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.GPXOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -2827,7 +2803,6 @@ olx.source.GPXOptions.prototype.urls;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -2857,13 +2832,6 @@ olx.source.TileImageOptions.prototype.attributions;
|
||||
olx.source.TileImageOptions.prototype.crossOrigin;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.TileImageOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -2928,7 +2896,6 @@ olx.source.TileImageOptions.prototype.tileUrlFunction;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* defaultProjection: ol.proj.ProjectionLike,
|
||||
* extent: (ol.Extent|undefined),
|
||||
* format: ol.format.Feature,
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* object: (GeoJSONObject|undefined),
|
||||
@@ -2956,13 +2923,6 @@ olx.source.TileVectorOptions.prototype.attributions;
|
||||
olx.source.TileVectorOptions.prototype.defaultProjection;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.TileVectorOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Format.
|
||||
* @type {ol.format.Feature}
|
||||
@@ -3024,7 +2984,6 @@ olx.source.TileVectorOptions.prototype.urls;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* defaultProjection: ol.proj.ProjectionLike,
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* object: (GeoJSONObject|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -3049,13 +3008,6 @@ olx.source.TopoJSONOptions.prototype.attributions;
|
||||
olx.source.TopoJSONOptions.prototype.defaultProjection;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.TopoJSONOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -3144,7 +3096,6 @@ olx.source.IGCOptions.prototype.urls;
|
||||
* @typedef {{url: (string|undefined),
|
||||
* displayDpi: (number|undefined),
|
||||
* metersPerUnit: (number|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* hidpi: (boolean|undefined),
|
||||
* useOverlay: (boolean|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -3177,13 +3128,6 @@ olx.source.MapGuideOptions.prototype.displayDpi;
|
||||
olx.source.MapGuideOptions.prototype.metersPerUnit;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.MapGuideOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Use the `ol.Map#pixelRatio` value when requesting the image from the remote
|
||||
* server. Default is `true`.
|
||||
@@ -3232,7 +3176,6 @@ olx.source.MapGuideOptions.prototype.params;
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* defaultStyle: (Array.<ol.style.Style>|undefined),
|
||||
* doc: (Document|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* node: (Node|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -3265,13 +3208,6 @@ olx.source.KMLOptions.prototype.defaultStyle;
|
||||
olx.source.KMLOptions.prototype.doc;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.KMLOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -3338,21 +3274,13 @@ olx.source.MapQuestOptions.prototype.tileLoadFunction;
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{extent: (ol.Extent|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* @typedef {{projection: ol.proj.ProjectionLike,
|
||||
* tileGrid: (ol.tilegrid.TileGrid|undefined)}}
|
||||
* @api
|
||||
*/
|
||||
olx.source.TileDebugOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.TileDebugOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Projection.
|
||||
* @type {ol.proj.ProjectionLike}
|
||||
@@ -3418,7 +3346,6 @@ olx.source.OSMOptions.prototype.url;
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* defaultStyle: (Array.<ol.style.Style>|undefined),
|
||||
* doc: (Document|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* node: (Node|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -3452,13 +3379,6 @@ olx.source.OSMXMLOptions.prototype.defaultStyle;
|
||||
olx.source.OSMXMLOptions.prototype.doc;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.OSMXMLOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -3511,7 +3431,6 @@ olx.source.OSMXMLOptions.prototype.urls;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* canvasFunction: ol.CanvasFunctionType,
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* ratio: (number|undefined),
|
||||
@@ -3543,13 +3462,6 @@ olx.source.ImageCanvasOptions.prototype.attributions;
|
||||
olx.source.ImageCanvasOptions.prototype.canvasFunction;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.ImageCanvasOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -3589,7 +3501,6 @@ olx.source.ImageCanvasOptions.prototype.state;
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* ratio: (number|undefined),
|
||||
@@ -3608,13 +3519,6 @@ olx.source.ImageVectorOptions;
|
||||
olx.source.ImageVectorOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.ImageVectorOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -3663,7 +3567,6 @@ olx.source.ImageVectorOptions.prototype.style;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* hidpi: (boolean|undefined),
|
||||
* serverType: (ol.source.wms.ServerType|string|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -3691,13 +3594,6 @@ olx.source.ImageWMSOptions.prototype.attributions;
|
||||
olx.source.ImageWMSOptions.prototype.crossOrigin;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.ImageWMSOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Use the `ol.Map#pixelRatio` value when requesting the image from the remote
|
||||
* server. Default is `true`.
|
||||
@@ -3816,7 +3712,6 @@ olx.source.StamenOptions.prototype.url;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* imageExtent: (ol.Extent|undefined),
|
||||
* imageSize: (ol.Size|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -3841,13 +3736,6 @@ olx.source.ImageStaticOptions.prototype.attributions;
|
||||
olx.source.ImageStaticOptions.prototype.crossOrigin;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.ImageStaticOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Extent of the image.
|
||||
* @type {ol.Extent|undefined}
|
||||
@@ -3885,7 +3773,6 @@ olx.source.ImageStaticOptions.prototype.url;
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* format: ol.format.Feature,
|
||||
* loader: function(this: ol.source.ServerVector, ol.Extent, number, ol.proj.Projection),
|
||||
* strategy: (function(ol.Extent, number): Array.<ol.Extent>|undefined),
|
||||
@@ -3903,13 +3790,6 @@ olx.source.ServerVectorOptions;
|
||||
olx.source.ServerVectorOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.ServerVectorOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Format.
|
||||
* @type {ol.format.Feature}
|
||||
@@ -3980,7 +3860,6 @@ olx.source.TileJSONOptions.prototype.url;
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* params: Object.<string,*>,
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* gutter: (number|undefined),
|
||||
* hidpi: (boolean|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
@@ -4019,13 +3898,6 @@ olx.source.TileWMSOptions.prototype.params;
|
||||
olx.source.TileWMSOptions.prototype.crossOrigin;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.TileWMSOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* The size in pixels of the gutter around image tiles to ignore. By setting
|
||||
* this property to a non-zero value, images will be requested that are wider
|
||||
@@ -4112,7 +3984,6 @@ olx.source.TileWMSOptions.prototype.urls;
|
||||
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* features: (Array.<ol.Feature>|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -4129,13 +4000,6 @@ olx.source.VectorOptions;
|
||||
olx.source.VectorOptions.prototype.attributions;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.VectorOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Features.
|
||||
* @type {Array.<ol.Feature>|undefined}
|
||||
@@ -4168,7 +4032,6 @@ olx.source.VectorOptions.prototype.state;
|
||||
* @typedef {{arrayBuffer: (ArrayBuffer|undefined),
|
||||
* attributions: (Array.<ol.Attribution>|undefined),
|
||||
* doc: (Document|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* format: ol.format.Feature,
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* node: (Node|undefined),
|
||||
@@ -4203,13 +4066,6 @@ olx.source.StaticVectorOptions.prototype.attributions;
|
||||
olx.source.StaticVectorOptions.prototype.doc;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.StaticVectorOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Format.
|
||||
* @type {ol.format.Feature}
|
||||
@@ -4269,7 +4125,6 @@ olx.source.StaticVectorOptions.prototype.urls;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* crossOrigin: (string|null|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* tileGrid: ol.tilegrid.WMTS,
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
@@ -4304,13 +4159,6 @@ olx.source.WMTSOptions.prototype.attributions;
|
||||
olx.source.WMTSOptions.prototype.crossOrigin;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.WMTSOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
@@ -4422,7 +4270,6 @@ olx.source.WMTSOptions.prototype.urls;
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* crossOrigin: (null|string|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|olx.LogoOptions|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* maxZoom: (number|undefined),
|
||||
@@ -4452,13 +4299,6 @@ olx.source.XYZOptions.prototype.attributions;
|
||||
olx.source.XYZOptions.prototype.crossOrigin;
|
||||
|
||||
|
||||
/**
|
||||
* Extent.
|
||||
* @type {ol.Extent|undefined}
|
||||
*/
|
||||
olx.source.XYZOptions.prototype.extent;
|
||||
|
||||
|
||||
/**
|
||||
* Logo.
|
||||
* @type{string|olx.LogoOptions|undefined}
|
||||
|
||||
Reference in New Issue
Block a user