Skip to content

Commit

Permalink
Fixed showing table prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ajturner committed Jul 20, 2023
1 parent beba967 commit 932d73f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/components/hub-compass-map/hub-compass-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,21 @@ export class HubCompassMap {
this.webMap.add(datasetLayer);
this.datasetEls[datasetId] ||= {}
this.datasetEls[datasetId].layer = datasetLayer;
// if(this.showTable) {
// this.addTable(datasetId, datasetLayer);
// }

}

/**
* Render tables after the elements are there
*/
async componentDidRender() {
console.debug("hub-compass-map: componentDidRender", this.datasetEls)
Object.keys(this.datasetEls).forEach((datasetId) => {
if(!this.datasetEls[datasetId].table) {
this.addTable(datasetId, this.datasetEls[datasetId].layer)
}
})
if(this.showTable) {
Object.keys(this.datasetEls).forEach((datasetId) => {
if(!this.datasetEls[datasetId].table) {
this.addTable(datasetId, this.datasetEls[datasetId].layer)
}
})
}

}

Expand Down Expand Up @@ -374,7 +374,7 @@ export class HubCompassMap {
ref={(el) => this.tableEl = el}
id="tableDiv"
>
{this.renderTables(this.datasetIds)}
{this.showTable ? this.renderTables(this.datasetIds) : ''}
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
componentEl.datasetIds = [];
componentEl.showLayers = true;
componentEl.showSearch = true;
componentEl.showTable = true;
componentEl.showTable = false;

function moveMap(center, zoom) {
componentEl.center = center;
Expand Down

0 comments on commit 932d73f

Please sign in to comment.