-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
r8n5n
authored and
r8n5n
committed
Feb 6, 2016
1 parent
8378107
commit dbd19a7
Showing
3 changed files
with
116 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,58 @@ | ||
$(document).foundation(); | ||
|
||
|
||
|
||
var map = L.map('map').setView([53.38159, -1.47148], 13); | ||
|
||
|
||
|
||
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', | ||
{ | ||
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors', | ||
maxZoom: 18, | ||
zoom: 13, | ||
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + | ||
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + | ||
'Imagery © <a href="http://mapbox.com">Mapbox</a>', | ||
id: 'mapbox.streets' | ||
}).addTo(map); | ||
|
||
|
||
map.locate(); | ||
|
||
function onLocationFound(e) { | ||
var radius = e.accuracy / 2; | ||
|
||
L.marker(e.latlng).addTo(map) | ||
.bindPopup("You are within " + radius + " meters from this point").openPopup(); | ||
|
||
L.circle(e.latlng, radius).addTo(map); | ||
|
||
} | ||
|
||
map.on('locationfound', onLocationFound); | ||
|
||
|
||
var popup = L.popup(); | ||
|
||
function onMapClick(e) { | ||
popup | ||
.setLatLng(e.latlng) | ||
.setContent("You clicked the map at " + e.latlng.toString()) | ||
.openOn(map); | ||
} | ||
|
||
map.on('click', onMapClick); | ||
|
||
|
||
var postoffices = L.tileLayer.wms('http://52.16.129.211:8080/geoserver/sheffugees/wms', | ||
{ | ||
layers: 'shefugees:postoffices', | ||
tiled: true, | ||
format: 'image/png', | ||
transparent: true, | ||
maxZoom: 18, | ||
minZoom: 12, | ||
continuousWorld: true | ||
}).addTo(map); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,9 @@ and open the template in the editor. | |
li a{ | ||
display: block; | ||
} | ||
} | ||
|
||
|
||
#map { | ||
height: 400px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters