forked from ryerson-ggl/tutorial-express-leaflet
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebmap.js
More file actions
25 lines (22 loc) · 1.01 KB
/
webmap.js
File metadata and controls
25 lines (22 loc) · 1.01 KB
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
// Import the leaflet package
var L = require('leaflet');
// Creates a leaflet map binded to an html <div> with id "map"
// setView will set the initial map view to the location at coordinates
// 13 represents the initial zoom level with higher values being more zoomed in
var map = L.map('map').setView([43.659752, -79.378161], 20);
// Adds the basemap tiles to your web map
// Additional providers are available at: https://leaflet-extras.github.io/leaflet-providers/preview/
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> © <a href="https://carto.com/attributions">CARTO</a>',
subdomains: 'abcd',
maxZoom: 21
}).addTo(map);
// Adds a popup marker to the webmap for GGL address
L.circleMarker([38.829772, -77.305550]).addTo(map)
.bindPopup(
'<b>Geography and Geoinformation Science Dept.</b><br>' +
'Exploratory Hall<br>' +
'George Mason University<br>' +
'Fairfax, VA'
)
.openPopup();