Created
July 26, 2023 18:36
-
-
Save LosantGists/8324e7031ba692daf0e32d46aec55b9f to your computer and use it in GitHub Desktop.
Sets up variables and listeners
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
// Excerpt from https://github.com/Losant/google-map-advanced-markers/blob/main/custom-head-content.html | |
// Initialize globals | |
const markers = {}; | |
let devices = []; | |
let map; | |
let numSelected = 0; | |
let AdvancedMarkerElement; | |
let bounds; | |
let selectedAttribute = $('#attribute-selector').val() || 'battery'; | |
// Rebuild markers when changing attribute | |
$(document).on('change','#attribute-selector',() => { | |
selectedAttribute = $('#attribute-selector').val(); | |
resetMarkers(); | |
setAllMarkers(); | |
}); | |
// ...other functions... | |
initMap(); | |
DashboardBlock.on('change', updateMap); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment