forked from Radhika025/Sakura_Team-058
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakeMap.js
28 lines (26 loc) · 838 Bytes
/
MakeMap.js
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
function initMap() {
let map = new google.maps.Map(document.getElementById("map"), {
zoom: 13,
center: {lat: 37.775, lng: -122.434},
mapTypeId: "roadmap",
});
map.data.addGeoJson(
getBoundaries()
);
map.data.setStyle(function (feature) {
let district = feature.getProperty('DISTRICT');
let color = "green";
if (district === "CENTRAL" || district === "MISSION") {
color = "orange";
} else if (district === "BAYVIEW" || district === "TARAVAL" || district === "INGLESIDE") {
color = "yellow";
} else if (district === "SOUTHERN" || district === "NORTHERN") {
color = "red";
}
return {
fillColor: color,
strokeWeight: 0.5,
strokeColor: color
}
});
}