Skip to content

Commit a8caf55

Browse files
committed
Closes #128. Fixes merge conflict
2 parents ba658d0 + e5edd4b commit a8caf55

File tree

8 files changed

+19
-8
lines changed

8 files changed

+19
-8
lines changed

dist/data_formatter.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/data_formatter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/partials/editor.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ <h5 class="section-heading">Map Data Options</h5>
5757
<label class="gf-form-label width-12">Table Label Field</label>
5858
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.tableLabel" ng-change="ctrl.refresh()" ng-model-onblur />
5959
</div>
60+
<div class="gf-form" ng-show="ctrl.panel.locationData === 'table'">
61+
<label class="gf-form-label width-12">Geohash Field</label>
62+
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.tableGeohash" ng-change="ctrl.refresh()" ng-model-onblur />
63+
</div>
6064
<div class="gf-form" ng-show="ctrl.panel.locationData === 'geohash'">
6165
<label class="gf-form-label width-12">ES Metric Field</label>
6266
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.esMetric" ng-change="ctrl.refresh()" ng-model-onblur />

dist/worldmap_ctrl.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/worldmap_ctrl.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/data_formatter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ export default class DataFormatter {
147147
let longitude = datapoint.longitude;
148148
let key = `${latitude}_${longitude}`;
149149

150-
if (datapoint.geohash) {
151-
const encodedGeohash = datapoint.geohash;
150+
if (datapoint[this.ctrl.panel.tableGeohash]) {
151+
const encodedGeohash = datapoint[this.ctrl.panel.tableGeohash];
152152
const decodedGeohash = decodeGeoHash(encodedGeohash);
153153

154154
latitude = decodedGeohash.latitude;
@@ -157,6 +157,7 @@ export default class DataFormatter {
157157
key = encodedGeohash;
158158
}
159159

160+
160161
const dataValue = {
161162
key: key,
162163
locationName: datapoint[this.ctrl.panel.tableLabel] || 'n/a',

src/partials/editor.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ <h5 class="section-heading">Map Data Options</h5>
5757
<label class="gf-form-label width-12">Table Label Field</label>
5858
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.tableLabel" ng-change="ctrl.refresh()" ng-model-onblur />
5959
</div>
60+
<div class="gf-form" ng-show="ctrl.panel.locationData === 'table'">
61+
<label class="gf-form-label width-12">Geohash Field</label>
62+
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.tableGeohash" ng-change="ctrl.refresh()" ng-model-onblur />
63+
</div>
6064
<div class="gf-form" ng-show="ctrl.panel.locationData === 'geohash'">
6165
<label class="gf-form-label width-12">ES Metric Field</label>
6266
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.esMetric" ng-change="ctrl.refresh()" ng-model-onblur />

src/worldmap_ctrl.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const panelDefaults = {
2828
decimals: 0,
2929
hideEmpty: false,
3030
hideZero: false,
31-
stickyLabels: false
31+
stickyLabels: false,
32+
tableGeohash: 'geohash'
3233
};
3334

3435
const mapCenters = {

0 commit comments

Comments
 (0)