This page describes how to track Resource updates to render Footprints on the Reference Map.
You as a developer should listen for changes to the third-party viewer map extent. When it changes, footprints should be updated.
To listen to resource changes, use these signals :
When any of these events occur, footprints should be refreshed.
Use the getStreamingFootprints2D to retrieve footprints for a 2D map.
getStreamingFootprints2D function.
For javascript, see https://www.npmjs.com/package/debounce
/** * Update footprint data. * Assumes global scale,crs,minX,minY,maxX and maxY properties are available in this context. */ function updateFootprints() { // Get map extent var bounds = Bounds.fromXY(crs,minX,minY,maxX,maxY); // Get map objects var mapObjects = viewer.getStreamingFootprints2D(null/*resourceIds*/,bounds,scale).then(renderFootprints); // Render map objects renderMapObjects(mapObjects); } // Listen to signals viewer.onResourceOpened.add(updateFootprints); viewer.onResourceClosed.add(updateFootprints);
See Rendering MapObjects.