Created
July 3, 2023 13:52
-
-
Save tmdesigned/514cc4c9e7f836a57ffffbf0c8c4a4ef to your computer and use it in GitHub Desktop.
Set up globals and listeners
This file contains hidden or 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