Skip to content

Commit

Permalink
Merge pull request #2795 from AnalyticalGraphicsInc/UrlTemplateImager…
Browse files Browse the repository at this point in the history
…yProvider

Add UrlTemplateImageryProvider
  • Loading branch information
pjcozzi committed Jun 16, 2015
2 parents c1d67e7 + 91e9583 commit c8bd90e
Show file tree
Hide file tree
Showing 16 changed files with 1,149 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Change Log
* Fixed an issue where `Camera` functions would throw an exception if used from within a `Scene.morphComplete` callback [#2776](https://github.com/AnalyticalGraphicsInc/cesium/issues/2776).
* `Model` can now load Binary glTF from a Uint8Array.
* Added a new camera mode for horizon views. When the camera is looking at the horizon and a point on terrain above the camera is picked, the camera moves in the plane containing the camera position, up and right vectors.
* Added `UrlTemplateImageryProvider`. This new imagery provider allows access to a wide variety of imagery sources, including OpenStreetMap, TMS, WMTS, WMS, WMS-C, and various custom schemes, by specifying a URL template to use to request imagery tiles.

### 1.10 - 2015-06-01

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Ayush Khandelwal](https://github.com/ayk115)
* [Aditya Raisinghani](https://github.com/adi2412)
* [Ilia Choly](https://github.com/icholy)
* [Farouk Abdou](https://github.com/kaktus40)

Also see [our contributors page](http://cesiumjs.org/contributors.html) for more information.
2 changes: 2 additions & 0 deletions Source/Scene/ArcGisMapServerImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ define([
* @see SingleTileImageryProvider
* @see TileMapServiceImageryProvider
* @see WebMapServiceImageryProvider
* @see WebMapTileServiceImageryProvider
* @see UrlTemplateImageryProvider
*
* @see {@link http://resources.esri.com/help/9.3/arcgisserver/apis/rest/|ArcGIS Server REST API}
* @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
Expand Down
2 changes: 2 additions & 0 deletions Source/Scene/BingMapsImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ define([
* @see SingleTileImageryProvider
* @see TileMapServiceImageryProvider
* @see WebMapServiceImageryProvider
* @see WebMapTileServiceImageryProvider
* @see UrlTemplateImageryProvider
*
* @see {@link http://msdn.microsoft.com/en-us/library/ff701713.aspx|Bing Maps REST Services}
* @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
Expand Down
8 changes: 5 additions & 3 deletions Source/Scene/GoogleEarthImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ define([
* ]
* }
* @param {String} [options.path="/default_map"] The path of the Google Earth server hosting the imagery.
* @param {Number} [options.maximumLevel=23] The maximum level-of-detail supported by the Google Earth
* Enterprise server.
* @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the Google Earth
* Enterprise server, or undefined if there is no limit.
* @param {TileDiscardPolicy} [options.tileDiscardPolicy] The policy that determines if a tile
* is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass
* a {@link NeverTileDiscardPolicy} for this parameter.
Expand All @@ -86,6 +86,8 @@ define([
* @see SingleTileImageryProvider
* @see TileMapServiceImageryProvider
* @see WebMapServiceImageryProvider
* @see WebMapTileServiceImageryProvider
* @see UrlTemplateImageryProvider
*
* @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
*
Expand Down Expand Up @@ -132,7 +134,7 @@ define([

this._tileWidth = 256;
this._tileHeight = 256;
this._maximumLevel = defaultValue(options.maximumLevel, 23);
this._maximumLevel = options.maximumLevel;
this._imageUrlTemplate = this._url + this._path + '/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}';

this._errorEvent = new Event();
Expand Down
7 changes: 5 additions & 2 deletions Source/Scene/OpenStreetMapImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ define([
* @param {Object} [options.proxy] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL.
* @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle of the layer.
* @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider.
* @param {Number} [options.maximumLevel=18] The maximum level-of-detail supported by the imagery provider.
* @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
* @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
* @param {Credit|String} [options.credit='MapQuest, Open Street Map and contributors, CC-BY-SA'] A credit for the data source, which is displayed on the canvas.
*
* @see ArcGisMapServerImageryProvider
* @see BingMapsImageryProvider
* @see GoogleEarthImageryProvider
* @see SingleTileImageryProvider
* @see TileMapServiceImageryProvider
* @see WebMapServiceImageryProvider
* @see WebMapTileServiceImageryProvider
* @see UrlTemplateImageryProvider
*
* @see {@link http://wiki.openstreetmap.org/wiki/Main_Page|OpenStreetMap Wiki}
* @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
Expand Down Expand Up @@ -78,7 +81,7 @@ define([
this._tileHeight = 256;

this._minimumLevel = defaultValue(options.minimumLevel, 0);
this._maximumLevel = defaultValue(options.maximumLevel, 18);
this._maximumLevel = options.maximumLevel;

this._rectangle = defaultValue(options.rectangle, this._tilingScheme.rectangle);

Expand Down
2 changes: 2 additions & 0 deletions Source/Scene/SingleTileImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ define([
* @see OpenStreetMapImageryProvider
* @see TileMapServiceImageryProvider
* @see WebMapServiceImageryProvider
* @see WebMapTileServiceImageryProvider
* @see UrlTemplateImageryProvider
*/
var SingleTileImageryProvider = function(options) {
options = defaultValue(options, {});
Expand Down
7 changes: 4 additions & 3 deletions Source/Scene/TileMapServiceImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ define([
* @param {Number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
* this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
* to result in rendering problems.
* @param {Number} [options.maximumLevel=18] The maximum level-of-detail supported by the imagery provider.
* @param {Number} [options.maximumLevel] The maximum level-of-detail supported by the imagery provider, or undefined if there is no limit.
* @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.
* @param {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the ellipsoidal
* surface is broken into tiles. If this parameter is not provided, a {@link WebMercatorTilingScheme}
Expand All @@ -64,9 +64,10 @@ define([
* @see BingMapsImageryProvider
* @see GoogleEarthImageryProvider
* @see OpenStreetMapImageryProvider
* @see WebMapTileServiceImageryProvider
* @see SingleTileImageryProvider
* @see WebMapServiceImageryProvider
* @see WebMapTileServiceImageryProvider
* @see UrlTemplateImageryProvider
*
* @see {@link http://www.maptiler.org/|MapTiler}
* @see {@link http://www.klokan.cz/projects/gdal2tiles/|GDDAL2Tiles}
Expand Down Expand Up @@ -248,7 +249,7 @@ define([
that._tileWidth = defaultValue(options.tileWidth, 256);
that._tileHeight = defaultValue(options.tileHeight, 256);
that._minimumLevel = defaultValue(options.minimumLevel, 0);
that._maximumLevel = defaultValue(options.maximumLevel, 18);
that._maximumLevel = options.maximumLevel;
that._tilingScheme = defined(options.tilingScheme) ? options.tilingScheme : new WebMercatorTilingScheme({ ellipsoid : options.ellipsoid });
that._rectangle = defaultValue(options.rectangle, that._tilingScheme.rectangle);
that._ready = true;
Expand Down
Loading

0 comments on commit c8bd90e

Please sign in to comment.