-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapMaker.js
More file actions
29 lines (21 loc) · 861 Bytes
/
MapMaker.js
File metadata and controls
29 lines (21 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
CurrentLocation();
L.mapbox.accessToken = 'pk.eyJ1IjoiZ29vZGVqb25haGdtYWlsY29tIiwiYSI6ImNqd3pkejdzaTFmOW80OW50eGJ0Y2x2cHYifQ.57F313PTCf3RtS3ZfzwEsg'
var map = L.mapbox.map('map')
.setView([42.3601, -71.0589], 8)
.addLayer(L.mapbox.styleLayer('mapbox://styles/goodejonahgmailcom/cjx0oogokixj41cpburxs21kx'))
map.addControl(new customControl());
window.addEventListener('DOMContentLoaded', map);
var turbopropIcon = L.icon({
iconUrl: 'turboprop.svg',
iconSize: [50, 50],
iconAnchor: [25, 16],
});
function CurrentLocation() {
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(CreateMarker)
}
}
function CreateMarker(position){
var home = L.marker([position.coords.latitude, position.coords.longitude], {title: 'Current Location'}).addTo(map);
home.bindPopup("Current Location").openPopup();
}