Initial commit to new repo
This commit is contained in:
parent
a267f9bfcc
commit
a5173c981b
292 changed files with 17472 additions and 0 deletions
15
public/assets/js/maps.js
Normal file
15
public/assets/js/maps.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
//This code runs on page load and looks for <div class="map">, then adds map
|
||||
var mapDivs = document.querySelectorAll('.map');
|
||||
for(var i = 0; i < mapDivs.length; i++) {
|
||||
var mapDiv = mapDivs[i];
|
||||
var latitude = mapDiv.dataset.latitude;
|
||||
var longitude = mapDiv.dataset.longitude;
|
||||
L.mapbox.accessToken = 'pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiVlpndW1EYyJ9.aP9fxAqLKh7lj0LpFh5k1w';
|
||||
var map = L.mapbox.map(mapDiv, 'jonnybarnes.gnoihnim')
|
||||
.setView([latitude, longitude], 15)
|
||||
.addLayer(L.mapbox.tileLayer('jonnybarnes.gnoihnim', {
|
||||
detectRetina: true,
|
||||
}));
|
||||
var marker = L.marker([latitude, longitude]).addTo(map);
|
||||
map.scrollWheelZoom.disable();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue