diff --git a/src/components/EarthMap.vue b/src/components/EarthMap.vue
index 863dc6c..5f29e83 100644
--- a/src/components/EarthMap.vue
+++ b/src/components/EarthMap.vue
@@ -6,26 +6,49 @@
import { Component, Prop, Vue } from 'vue-property-decorator'
import mapboxgl from 'mapbox-gl/dist/mapbox-gl'
+interface Location {
+ name?: string
+ lat: number
+ lon: number
+}
+
@Component
export default class EarthMap extends Vue {
- @Prop({ type: Number, required: true })
- private lat!: number
- @Prop({ type: Number, required: true })
- private lon!: number
+ @Prop({ type: Array, default: () => [] })
+ private locations!: Location[]
private mounted() {
- const center = [this.lon, this.lat]
mapboxgl.accessToken = process.env.VUE_APP_MAPBOX_KEY
+ const markers = this.locations.map((location) => [
+ location.lon,
+ location.lat
+ ])
+ const latitudes = this.locations.map((location: Location) => location.lat)
+ const longitudes = this.locations.map((location: Location) => location.lon)
+ const minLat = Math.min(...latitudes)
+ const maxLat = Math.min(...latitudes)
+ const minLon = Math.min(...longitudes)
+ const maxLon = Math.min(...longitudes)
+
const earth = new mapboxgl.Map({
container: 'earth',
style: 'mapbox://styles/mapbox/streets-v11',
- center,
- zoom: 12
+ bounds: [
+ [minLon, minLat],
+ [maxLon, maxLat]
+ ],
+ fitBoundsOptions: {
+ padding: 15,
+ maxZoom: 12
+ }
})
earth.addControl(new mapboxgl.NavigationControl())
- new mapboxgl.Marker().setLngLat(center).addTo(earth)
+
+ markers.forEach((marker) => {
+ new mapboxgl.Marker().setLngLat(marker).addTo(earth)
+ })
}
}
@@ -35,5 +58,6 @@ export default class EarthMap extends Vue {
.earth-container {
min-height: 50vh;
+ height: 100%;
}
\ No newline at end of file
diff --git a/src/utils/icons.ts b/src/utils/icons.ts
index 0aa7184..deb01c6 100644
--- a/src/utils/icons.ts
+++ b/src/utils/icons.ts
@@ -15,9 +15,10 @@ import {
faGift,
faDollarSign,
faEuroSign,
- faExchangeAlt,
faInbox,
+ faExchangeAlt,
faEquals,
+ faGlobeEurope,
faMinus,
faInfinity,
faHandHoldingUsd,
@@ -54,8 +55,9 @@ library.add(
faDollarSign,
faEuroSign,
faExchangeAlt,
- faInbox,
faEquals,
+ faGlobeEurope,
+ faInbox,
faMinus,
faInfinity,
faHandHoldingUsd,
diff --git a/src/views/accounts/AccountItem.vue b/src/views/accounts/AccountItem.vue
index 26f0608..bb1e08e 100644
--- a/src/views/accounts/AccountItem.vue
+++ b/src/views/accounts/AccountItem.vue
@@ -58,6 +58,15 @@