Skip to content

Commit f6157eb

Browse files
committed
adds a map on the car page using leaflet #25
1 parent bf44283 commit f6157eb

File tree

8 files changed

+31
-4
lines changed

8 files changed

+31
-4
lines changed

.eslintcache

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"/home/philawsophizing/GitHub/PAS/src/routes/home.js":{"size":116,"mtime":1494850472513,"hashOfConfig":"1jsap0i","results":{"filePath":"/home/philawsophizing/GitHub/PAS/src/routes/home.js","messages":[],"errorCount":0,"warningCount":0}},"/home/philawsophizing/GitHub/PAS/src/routes/index.js":{"size":143,"mtime":1494838230753,"hashOfConfig":"1jsap0i","results":{"filePath":"/home/philawsophizing/GitHub/PAS/src/routes/index.js","messages":[],"errorCount":0,"warningCount":0}},"/home/philawsophizing/GitHub/PAS/src/routes/static.js":{"size":124,"mtime":1494838309952,"hashOfConfig":"1jsap0i","results":{"filePath":"/home/philawsophizing/GitHub/PAS/src/routes/static.js","messages":[],"errorCount":0,"warningCount":0}},"/home/philawsophizing/GitHub/PAS/src/server.js":{"size":682,"mtime":1494850369267,"hashOfConfig":"1jsap0i","results":{"filePath":"/home/philawsophizing/GitHub/PAS/src/server.js","messages":[],"errorCount":0,"warningCount":0}},"/home/philawsophizing/GitHub/PAS/src/views/helpers/helper.js":{"size":0,"mtime":1494837773673,"hashOfConfig":"1jsap0i","results":{"filePath":"/home/philawsophizing/GitHub/PAS/src/views/helpers/helper.js","messages":[],"errorCount":0,"warningCount":0}}}
1+
{"/home/mario/Desktop/13week/PAS/src/routes/carPage.js":{"size":229,"mtime":1494852194925,"hashOfConfig":"1332v2a","results":{"filePath":"/home/mario/Desktop/13week/PAS/src/routes/carPage.js","messages":[],"errorCount":0,"warningCount":0}},"/home/mario/Desktop/13week/PAS/src/routes/home.js":{"size":116,"mtime":1494851794508,"hashOfConfig":"1332v2a","results":{"filePath":"/home/mario/Desktop/13week/PAS/src/routes/home.js","messages":[],"errorCount":0,"warningCount":0}},"/home/mario/Desktop/13week/PAS/src/routes/index.js":{"size":201,"mtime":1494852181684,"hashOfConfig":"1332v2a","results":{"filePath":"/home/mario/Desktop/13week/PAS/src/routes/index.js","messages":[],"errorCount":0,"warningCount":0}},"/home/mario/Desktop/13week/PAS/src/routes/static.js":{"size":124,"mtime":1494850305137,"hashOfConfig":"1332v2a","results":{"filePath":"/home/mario/Desktop/13week/PAS/src/routes/static.js","messages":[],"errorCount":0,"warningCount":0}},"/home/mario/Desktop/13week/PAS/src/server.js":{"size":649,"mtime":1494851794508,"hashOfConfig":"1332v2a","results":{"filePath":"/home/mario/Desktop/13week/PAS/src/server.js","messages":[],"errorCount":0,"warningCount":0}},"/home/mario/Desktop/13week/PAS/src/views/helpers/helper.js":{"size":0,"mtime":1494850305137,"hashOfConfig":"1332v2a","results":{"filePath":"/home/mario/Desktop/13week/PAS/src/views/helpers/helper.js","messages":[],"errorCount":0,"warningCount":0}}}

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
],
66
"rules": {
77
"linebreak-style": 0
8+
},
9+
"globals": {
10+
"L": true
811
}
912
}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
npm-debug.log
3+
.eslintcache

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"handlebars": "^4.0.8",
2929
"hapi": "^16.1.1",
3030
"inert": "^4.2.0",
31+
"leaflet": "^1.0.3",
3132
"vision": "^4.1.1"
3233
},
3334
"devDependencies": {

public/main.js

+12
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
/* eslint-env browser */
22
console.log('OY');
3+
4+
setTimeout(function () {
5+
const mymap = L.map('mapid', {
6+
center: [32.699, 35.303],
7+
zoomControl: false,
8+
attributionControl: false,
9+
zoom: 15,
10+
});
11+
12+
L.tileLayer(
13+
'https://api.mapbox.com/styles/v1/mapbox/light-v9/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1Ijoia2FyeXVtIiwiYSI6ImNqMjAzNGU4ZjAxa3EycW4xazFxcHZ6a2QifQ.m_dNO1l1sMkM7r4d5nlRRQ').addTo(mymap);
14+
}, 50);

public/style.css

+3
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@
2727

2828

2929
/* Sizing */
30+
#mapid {
31+
height: 360px;
32+
}

src/views/carRoute.hbs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
<div id="app-background" class="navy-background">
21
{{> header}}
3-
</div>
2+
<div id="mapid"></div>
3+
4+
5+
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
6+
integrity="sha512-A7vV8IFfih/D732iSSKi20u/ooOfj/AGehOKq0f4vLT1Zr2Y+RX7C+w8A1gaSasGtRUZpF/NZgzSAu4/Gc41Lg=="
7+
crossorigin=""></script>

src/views/layout/default.hbs

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<link rel="stylesheet" href="/style.css">
7+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
8+
integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ=="
9+
crossorigin=""/>
710
<title>PAS</title>
811
</head>
912
<body>
1013

1114
{{{content}}}
1215

13-
<script type="text/javascript" src="/main.js"></script>
16+
<script type="text/javascript" src="/main.js"></script>
1417
</body>
1518
</html>

0 commit comments

Comments
 (0)