Skip to content

Commit 20f8737

Browse files
EthShawErikBoesen
authored andcommitted
Move openURLKey to after event markers are added
getTBAQuery is asynchronous since it accesses TBA, so we have to open the url requested key (?key=eventCode) in the callback after all the events are added, instead of after the request function is called. If this is not done, the event markers probably won't exist when openURLKey is called, so an event marker specified in the url will not be opened, it will just be ignored.
1 parent ede0393 commit 20f8737

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ function initMap() { // Initialize Google Map
208208

209209
createEventMarker(event);
210210
}
211+
212+
openURLKey(); // Show POST Argument Specified Marker
211213
});
212214

213215
for (team of teams) createTeamMarker(team);
214-
215-
openURLKey(); // Show POST Argument Specified Marker
216216

217217
map.addListener('center_changed', function() { // Bind POST Arguement Update to map position change
218218
lat = map.center.lat();

0 commit comments

Comments
 (0)