Make VectorTile source work with multiple layers

This commit is contained in:
Andreas Hocevar
2017-07-09 14:08:08 +02:00
parent 4a0f97ac6a
commit 7739239e89
5 changed files with 64 additions and 33 deletions
+6 -4
View File
@@ -122,11 +122,12 @@ ol.VectorTile.prototype.getProjection = function() {
/**
* @param {ol.layer.Layer} layer Layer.
* @param {string} key Key.
* @return {ol.render.ReplayGroup} Replay group.
*/
ol.VectorTile.prototype.getReplayGroup = function(key) {
return this.replayGroups_[key];
ol.VectorTile.prototype.getReplayGroup = function(layer, key) {
return this.replayGroups_[ol.getUid(layer) + ',' + key];
};
@@ -182,11 +183,12 @@ ol.VectorTile.prototype.setProjection = function(projection) {
/**
* @param {ol.layer.Layer} layer Layer.
* @param {string} key Key.
* @param {ol.render.ReplayGroup} replayGroup Replay group.
*/
ol.VectorTile.prototype.setReplayGroup = function(key, replayGroup) {
this.replayGroups_[key] = replayGroup;
ol.VectorTile.prototype.setReplayGroup = function(layer, key, replayGroup) {
this.replayGroups_[ol.getUid(layer) + ',' + key] = replayGroup;
};