Skip to content

Commit 01150a0

Browse files
committed
map javascript moved to static/js
1 parent 4ba6c70 commit 01150a0

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

application/static/js/home.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
/* Your custom JavaScript here */
4+
var map = L.map('map').setView([-37.87, 175.475], 5);
5+
var tiles = L.tileLayer('http://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png',
6+
{
7+
id: 'examples.map-i86nkdio'
8+
}).addTo(map);

application/templates/home/home.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,5 @@ <h1 id="">THIS IS HOME</h1>
1919

2020

2121
{% block tail_script %}
22-
<script>
23-
var map = L.map('map').setView([-37.87, 175.475], 5);
24-
var tiles = L.tileLayer('http://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png',
25-
{
26-
id: 'examples.map-i86nkdio'
27-
}).addTo(map);
28-
</script>
22+
<script src="/static/js/home.js"></script>
2923
{% endblock tail_script %}

application/templates/home/home_base.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
{% block head_script %}
55
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
66
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
7-
{% endblock head_script %}
7+
{% endblock head_script %}
8+
9+

0 commit comments

Comments
 (0)