Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove google maps, use OpenStreetMap instead #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 137 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"chart.js": "^2.8.0",
"core-js": "^2.6.5",
"moment": "^2.24.0",
"ol": "^6.4.3",
"register-service-worker": "^1.6.2",
"vue": "^2.6.10",
"vue-chartjs": "^3.4.2",
Expand Down
20 changes: 20 additions & 0 deletions public/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.map-popup {
background-color: white;
box-shadow: 0 1px 4px rgba(0,0,0,0.2);
padding: 15px;
border-radius: 10px;
border: 1px solid #cccccc;
bottom: 12px;
min-width: 280px;
}

.map-popup > .map-popup-head {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #cccccc;
margin-bottom: 1em;
}

.map-popup > .map-popup-head > h1 {
font-size: 1.2em;
}
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="preload" href="<%= BASE_URL %>css/materialicons.css" as="style">
<link rel="stylesheet" href="<%= BASE_URL %>css/roboto.css">
<link rel="stylesheet" href="<%= BASE_URL %>css/materialicons.css">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAKSYlV4PJBbGMju4hFYkFLZLMlscENnWQ"></script>
<link rel="stylesheet" href="<%= BASE_URL %>css/styles.css">
</head>
<body>
<noscript>
Expand Down
17 changes: 17 additions & 0 deletions src/assets/marker-finish.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/marker-start.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 3 additions & 22 deletions src/components/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
import storage from '../utils/storage';
import cars from '../utils/cars';
import general from '../utils/general';
import EvNotifyMap from "../utils/EvNotifyMap";

export default {
data: () => ({
Expand Down Expand Up @@ -410,29 +411,9 @@
return `${this.$root.MomentJS(end).format('MMMM Do YYYY')} ${this.$root.MomentJS(start).format('HH:mm')}-${this.$root.MomentJS(end).format('HH:mm')}`
},
showLastPosition() {
const markerLocation = {
lat: this.syncData.latitude,
lng: this.syncData.longitude
};

if (!this.showMap || !this.syncData.last_location || !this.syncData.latitude || !this.syncData.longitude) return;
// eslint-disable-next-line
const map = new google.maps.Map(this.$refs.map, {
zoom: 14,
center: markerLocation
});
// eslint-disable-next-line
const infoWindow = new google.maps.InfoWindow({
content: `Last location from ${this.lastLocationTimestamp}`
});
// eslint-disable-next-line
const marker = new google.maps.Marker({
position: markerLocation,
map,
title: 'Last location'
});

marker.addListener('click', () => infoWindow.open(map, marker));
new EvNotifyMap(this.$refs.map)
.addLastLocation([this.syncData.longitude, this.syncData.latitude], this.lastLocationTimestamp);
}
},
watch: {
Expand Down
Loading