Skip to content

Commit 78eacd7

Browse files
committed
remove google maps, use OpenStreetMap instead
1 parent c439f5d commit 78eacd7

File tree

10 files changed

+469
-99
lines changed

10 files changed

+469
-99
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"chart.js": "^2.8.0",
1212
"core-js": "^2.6.5",
1313
"moment": "^2.24.0",
14+
"ol": "^6.4.3",
1415
"register-service-worker": "^1.6.2",
1516
"vue": "^2.6.10",
1617
"vue-chartjs": "^3.4.2",

public/css/styles.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.map-popup {
2+
background-color: white;
3+
box-shadow: 0 1px 4px rgba(0,0,0,0.2);
4+
padding: 15px;
5+
border-radius: 10px;
6+
border: 1px solid #cccccc;
7+
bottom: 12px;
8+
min-width: 280px;
9+
}
10+
11+
.map-popup > .map-popup-head {
12+
display: flex;
13+
justify-content: space-between;
14+
border-bottom: 1px solid #cccccc;
15+
margin-bottom: 1em;
16+
}
17+
18+
.map-popup > .map-popup-head > h1 {
19+
font-size: 1.2em;
20+
}

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link rel="preload" href="<%= BASE_URL %>css/materialicons.css" as="style">
1212
<link rel="stylesheet" href="<%= BASE_URL %>css/roboto.css">
1313
<link rel="stylesheet" href="<%= BASE_URL %>css/materialicons.css">
14-
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKSYlV4PJBbGMju4hFYkFLZLMlscENnWQ"></script>
14+
<link rel="stylesheet" href="<%= BASE_URL %>css/styles.css">
1515
</head>
1616
<body>
1717
<noscript>

src/assets/marker-finish.svg

Lines changed: 17 additions & 0 deletions
Loading

src/assets/marker-start.svg

Lines changed: 12 additions & 0 deletions
Loading

src/components/Dashboard.vue

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@
259259
import storage from '../utils/storage';
260260
import cars from '../utils/cars';
261261
import general from '../utils/general';
262+
import EvNotifyMap from "../utils/EvNotifyMap";
262263
263264
export default {
264265
data: () => ({
@@ -410,29 +411,9 @@
410411
return `${this.$root.MomentJS(end).format('MMMM Do YYYY')} ${this.$root.MomentJS(start).format('HH:mm')}-${this.$root.MomentJS(end).format('HH:mm')}`
411412
},
412413
showLastPosition() {
413-
const markerLocation = {
414-
lat: this.syncData.latitude,
415-
lng: this.syncData.longitude
416-
};
417-
418414
if (!this.showMap || !this.syncData.last_location || !this.syncData.latitude || !this.syncData.longitude) return;
419-
// eslint-disable-next-line
420-
const map = new google.maps.Map(this.$refs.map, {
421-
zoom: 14,
422-
center: markerLocation
423-
});
424-
// eslint-disable-next-line
425-
const infoWindow = new google.maps.InfoWindow({
426-
content: `Last location from ${this.lastLocationTimestamp}`
427-
});
428-
// eslint-disable-next-line
429-
const marker = new google.maps.Marker({
430-
position: markerLocation,
431-
map,
432-
title: 'Last location'
433-
});
434-
435-
marker.addListener('click', () => infoWindow.open(map, marker));
415+
new EvNotifyMap(this.$refs.map)
416+
.addLastLocation([this.syncData.longitude, this.syncData.latitude], this.lastLocationTimestamp);
436417
}
437418
},
438419
watch: {

0 commit comments

Comments
 (0)