Created
September 9, 2016 16:27
-
-
Save MichaelCPell/86a3c99450a9171718a010ee17fcebb6 to your computer and use it in GitHub Desktop.
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
var addMarker; | |
$(document).ready(function(){ | |
var mymap = L.map('mapid').setView([35.7796, -78.6382], 13); | |
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', { | |
maxZoom: 18, | |
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(mymap); | |
addMarker = function(lat, lng){ | |
latlng = {lat: lat, lng: lng}; | |
L.marker(latlng).addTo(mymap); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment