-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start rendering the basics of a map.
So far we have all the points showing, and are able to give detailed information on the unit and address. Future changes should hopefully allow selecting a point and then going to the unit page. Be able to pull unit information from the unit pin report #6
- Loading branch information
1 parent
bacaa50
commit 66012dc
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function initMap() { | ||
const map = new google.maps.Map(document.getElementById("map"), { | ||
zoom: 10, | ||
center: { lat: 37.333438, lng: -121.909562 }, | ||
}); | ||
|
||
map.data.loadGeoJson('unit_geojson') | ||
|
||
map.data.setStyle(function(feature) { | ||
return { | ||
title: feature.getProperty('name'), | ||
}}); | ||
|
||
map.data.addListener('mouseover', function(event) { | ||
document.getElementById('info-box').innerHTML = | ||
event.feature.getProperty('name') + '<br>' + event.feature.getProperty('address_line') + ' ' + event.feature.getProperty('city') + " " + event.feature.getProperty('state') + " " + event.feature.getProperty('zip') | ||
}); | ||
} | ||
|
||
window.initMap = initMap; |
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