Add tileJSON option to ol.source.TileUTFGrid

This commit is contained in:
Andreas Hocevar
2016-03-24 17:43:48 +01:00
parent 2159a35bb8
commit c0de5a6835
2 changed files with 21 additions and 3 deletions
+7 -1
View File
@@ -49,7 +49,13 @@ ol.source.TileUTFGrid = function(options) {
*/
this.template_ = undefined;
ol.net.jsonp(options.url, this.handleTileJSONResponse.bind(this));
if (options.url) {
ol.net.jsonp(options.url, this.handleTileJSONResponse.bind(this));
} else if (options.tileJSON) {
this.handleTileJSONResponse(options.tileJSON);
} else {
goog.asserts.fail('Either url or tileJSON options must be provided');
}
};
goog.inherits(ol.source.TileUTFGrid, ol.source.Tile);