Skip to content

Commit

Permalink
remove google maps, use OpenStreetMap instead
Browse files Browse the repository at this point in the history
  • Loading branch information
yankee42 committed Dec 8, 2020
1 parent c439f5d commit 6f59f09
Show file tree
Hide file tree
Showing 10 changed files with 460 additions and 93 deletions.
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.
19 changes: 3 additions & 16 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 @@ -417,22 +418,8 @@
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

0 comments on commit 6f59f09

Please sign in to comment.