Initial commit
This commit is contained in:
22
public/assets/js/login.js
Normal file
22
public/assets/js/login.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// Where you want to render the map.
|
||||
var element = document.getElementById('map');
|
||||
|
||||
// Height has to be set. You can do this in CSS too.
|
||||
element.style = 'height:300px;';
|
||||
|
||||
// Create Leaflet map on map element.
|
||||
var map = L.map(element);
|
||||
|
||||
// Add OSM tile layer to the Leaflet map.
|
||||
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
|
||||
}).addTo(map);
|
||||
|
||||
// Target's GPS coordinates.
|
||||
var target = L.latLng('7.9527706', '-1.0307118');
|
||||
|
||||
// Set map's center to target with zoom 14.
|
||||
map.setView(target, 7);
|
||||
|
||||
// Place a marker on the same location.
|
||||
L.marker(target).addTo(map);
|
||||
Reference in New Issue
Block a user