From e63b117ade40061f92e2fac774d469f2eabea9da Mon Sep 17 00:00:00 2001 From: roemhildtg Date: Thu, 2 Nov 2017 11:37:22 -0500 Subject: [PATCH] fix feature layer menu heatmaps --- widgets/HeatMap.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/widgets/HeatMap.js b/widgets/HeatMap.js index 0ed446e..ed78e74 100644 --- a/widgets/HeatMap.js +++ b/widgets/HeatMap.js @@ -33,12 +33,13 @@ define([ topic.subscribe(this.topic, lang.hitch(this, 'initHeatMap')); }, initHeatMap: function (r) { - var layerId = r.layer.id + r.subLayer.id; - if (!this._heatMapLayers[r.layer.id]) { - this._heatMapLayers[r.layer.id] = {}; - } + var layerId = [ + r.layer.id, + (r.subLayer ? r.subLayer.id : 'feature'), + 'heatmap' + ].join('-'); if (!this._heatMapLayers[layerId]) { - var serviceURL = r.layer.url + '/' + r.subLayer.id; + var serviceURL = r.layer.url + (r.subLayer ? '/' + r.subLayer.id : ''); var heatmapFeatureLayerOptions = { mode: FeatureLayer.MODE_SNAPSHOT, outFields: ['*'],