From 5c076280448c28d6cf731fb1b2e04dd6c115d84a Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 9 May 2016 08:56:55 -0600 Subject: [PATCH] Return id if no data is present --- src/ol/source/tileutfgridsource.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ol/source/tileutfgridsource.js b/src/ol/source/tileutfgridsource.js index 96dbeb2b4e..752e602dd7 100644 --- a/src/ol/source/tileutfgridsource.js +++ b/src/ol/source/tileutfgridsource.js @@ -336,7 +336,7 @@ ol.source.TileUTFGridTile_.prototype.getImage = function(opt_context) { * @return {Object} The data. */ ol.source.TileUTFGridTile_.prototype.getData = function(coordinate) { - if (!this.grid_ || !this.keys_ || !this.data_) { + if (!this.grid_ || !this.keys_) { return null; } var xRelative = (coordinate[0] - this.extent_[0]) / @@ -359,7 +359,16 @@ ol.source.TileUTFGridTile_.prototype.getData = function(coordinate) { } code -= 32; - return (code in this.keys_) ? this.data_[this.keys_[code]] : null; + var data = null; + if (code in this.keys_) { + var id = this.keys_[code]; + if (this.data_ && id in this.data_) { + data = this.data_[id]; + } else { + data = id; + } + } + return data; };