First foray into asynch JS loading, this is a little snippet of the Surftourist maps code
✓ Published0🌍 Public
DDylanFM
Last edited Jun 30, 2011
Created on Jun 30, 2011
This example demonstrates asynchronous loading of the Google Maps JavaScript API and supplementary mapping libraries to initialize an interactive map. It first checks for the presence of `google.maps` and, if absent, dynamically injects a script tag with a callback function to continue setup. The code then uses Modernizr.load to test for the `InfoBox` and `RickMarker` classes, loading a fallback script if needed. After dependencies load, it chains methods to configure the map, process points, add markers, draw lines, and set bounds, ultimately triggering a custom `mapsLoaded.ST` event. The map’s data comes from markers and points processed at runtime, with the Google Maps API serving as the core rendering engine.
AI-generated description