Skip to content

Commit

Permalink
adds a map on the car page using leaflet #25
Browse files Browse the repository at this point in the history
  • Loading branch information
Karyum committed May 15, 2017
1 parent bf44283 commit f6157eb
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .eslintcache
Original file line number Diff line number Diff line change
@@ -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}}}
{"/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}}}
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
],
"rules": {
"linebreak-style": 0
},
"globals": {
"L": true
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
npm-debug.log
.eslintcache
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"handlebars": "^4.0.8",
"hapi": "^16.1.1",
"inert": "^4.2.0",
"leaflet": "^1.0.3",
"vision": "^4.1.1"
},
"devDependencies": {
Expand Down
12 changes: 12 additions & 0 deletions public/main.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
/* eslint-env browser */
console.log('OY');

setTimeout(function () {
const mymap = L.map('mapid', {
center: [32.699, 35.303],
zoomControl: false,
attributionControl: false,
zoom: 15,
});

L.tileLayer(
'https://api.mapbox.com/styles/v1/mapbox/light-v9/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1Ijoia2FyeXVtIiwiYSI6ImNqMjAzNGU4ZjAxa3EycW4xazFxcHZ6a2QifQ.m_dNO1l1sMkM7r4d5nlRRQ').addTo(mymap);
}, 50);
3 changes: 3 additions & 0 deletions public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@


/* Sizing */
#mapid {
height: 360px;
}
8 changes: 6 additions & 2 deletions src/views/carRoute.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<div id="app-background" class="navy-background">
{{> header}}
</div>
<div id="mapid"></div>


<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-A7vV8IFfih/D732iSSKi20u/ooOfj/AGehOKq0f4vLT1Zr2Y+RX7C+w8A1gaSasGtRUZpF/NZgzSAu4/Gc41Lg=="
crossorigin=""></script>
5 changes: 4 additions & 1 deletion src/views/layout/default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ=="
crossorigin=""/>
<title>PAS</title>
</head>
<body>

{{{content}}}

<script type="text/javascript" src="/main.js"></script>
<script type="text/javascript" src="/main.js"></script>
</body>
</html>

0 comments on commit f6157eb

Please sign in to comment.