-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
19 lines (12 loc) · 869 Bytes
/
scripts.js
File metadata and controls
19 lines (12 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var map = L.map('CHCMap').setView([40.7127, -74.005973], 13); //pointing the map to New York City
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var HealthCenterArray = mappingHealthCenterData.rows; //creating an array for the data, pulling all the rows
/*
* A loop in which each location's full address, name, and telephone number are displayed in a blue popup'
*/
for (var i = 0; i < HealthCenterArray.length; i++) {
var EachLocation = HealthCenterArray[i];
var marker = L.marker([EachLocation.latitude, EachLocation.longitude]).addTo(map); //dotting the marker location
marker.bindPopup("<b>" + EachLocation.FullAddress + "</b><br>" + EachLocation.NameofCenter + "</b><br>" + EachLocation.TelephoneNumber);} //what the popup has