diff --git a/src/partials/editor.html b/src/partials/editor.html index 63c474e..507b838 100644 --- a/src/partials/editor.html +++ b/src/partials/editor.html @@ -4,7 +4,7 @@
Map Visual Options
-
diff --git a/src/worldmap_ctrl.ts b/src/worldmap_ctrl.ts index adbb6a9..1d183f7 100644 --- a/src/worldmap_ctrl.ts +++ b/src/worldmap_ctrl.ts @@ -48,6 +48,7 @@ const mapCenters = { Europe: { mapCenterLatitude: 46, mapCenterLongitude: 14 }, "West Asia": { mapCenterLatitude: 26, mapCenterLongitude: 53 }, "SE Asia": { mapCenterLatitude: 10, mapCenterLongitude: 106 }, + 'First GeoHash': {mapCenterLatitude: 0, mapCenterLongitude: 0}, "Last GeoHash": { mapCenterLatitude: 0, mapCenterLongitude: 0 } }; @@ -206,11 +207,19 @@ export default class WorldmapCtrl extends MetricsPanelCtrl { if (this.data.length && this.panel.mapCenter === "Last GeoHash") { this.centerOnLastGeoHash(); + } else if (this.data.length && this.panel.mapCenter === 'First GeoHash') { + this.centerOnFirstGeoHash(); } else { this.render(); } } + centerOnFirstGeoHash() { + mapCenters[this.panel.mapCenter].mapCenterLatitude = _.first(this.data).locationLatitude; + mapCenters[this.panel.mapCenter].mapCenterLongitude = _.first(this.data).locationLongitude; + this.setNewMapCenter(); + } + centerOnLastGeoHash() { const last: any = _.last(this.data); mapCenters[this.panel.mapCenter].mapCenterLatitude = last.locationLatitude;