Skip to content

Commit

Permalink
example(GeoJSON raster): center the camera initial position on the di…
Browse files Browse the repository at this point in the history
…splayed features
  • Loading branch information
mgermerie authored and gchoqueux committed Jun 21, 2021
1 parent 8ccc1a3 commit 8d8ac2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/source_file_geojson_raster.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@
});

return view.addLayer(pyoLayer);
}).then(FeatureToolTip.addLayer);
}).then(FeatureToolTip.addLayer).then(() => {
// Center the camera on the data extents
const layersExtent = ariegeSource.extent.clone();
layersExtent.union(view.getLayerById('pyrenees-orientales').source.extent);
view.controls.lookAtCoordinate(layersExtent, false);
});


debug.createTileDebugUI(menuGlobe.gui, view);
</script>
Expand Down

0 comments on commit 8d8ac2c

Please sign in to comment.