You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cesium/geovis.html
+18-5Lines changed: 18 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -826,9 +826,9 @@ <h1>The App</h1>
826
826
<p>As a bonus, I tossed in a few buttons below the main view to simplify the interface. We can load all 23K of our fire data (spanning 2000-2022), if we click “Load Fires!”.</p>
827
827
<p>After a second or two the fire events will be loaded and we’ll notice the timeline has changed with a new start time somewhere in the year 2000.</p>
<h1>A Note on Map Tiles and Base Layers Cesium is built to work with all sorts</h1>
831
-
<p>of geospatial layers, which are the visual projections of the geography that we want see rendered. We build maps by adding layers (from various sources) and then we can place interactive 3d geometry in the context of these layers.</p>
<p>Cesium is built to work with all sorts of geospatial layers, which are the visual projections of the geography that we want see rendered. We build maps by adding layers (from various sources) and then we can place interactive 3d geometry in the context of these layers.</p>
832
832
<p>Most layers come in the form of “map tiles”, which are 3d coordinates mapping a visible chunk of the earth at a particular altitude. So when we zoom into a particular view of the current projection of the earth, the visible tiles are loaded on the fly. This means we either need a tile server or our own local tiles (like a specially oriented directory structure) to serve up typical map layers.</p>
833
833
<p>Cesium refers to the underlying layer as the base layer. They provide access to several online map tile providers by way of their “layer picker” interface. This means you can switch the underlyin visual layers at any point if you want to see different features (e.g. topology vs roads vs political boundaries vs 3D terrain…)</p>
834
834
<p>Some of the layers Cesium provides appear to be available to you during development time, but if you publish something e.g. on clojure civitas or another domain, you might find that the tile server refuses to send tiles and the visual view is just a default blue tileset (e.g. nothing).</p>
<h2class="anchored" data-anchor-id="geojson-for-complex-polygonal-layers-state-boundaries">GeoJSON For Complex Polygonal Layers (State Boundaries)</h2>
846
846
<p>Since not every layer has state boundaries baked in, I added a layer from open source state boundaries via GeoJSON. We get the added benefit of having states recognized as named entities in Cesium, so clicking on a state boundary will pop up some information about the entity (in this case, the name).</p>
847
847
<p>This layer can be toggled using the “Toggle States” button. With some base layers, it may look better to have it toggled off since the current translucent grey polygon fill may collide with interesting visual features.</p>
<h3class="anchored" data-anchor-id="side-note---clay-local-files-vs.-quarto">Side Note - Clay Local Files vs. Quarto</h3>
850
+
<p>Normally, we can just reference files that are local to our notebook’s folder, like images and script tags, and Clay will pick them up just fine. When we go to publish on the Quarto web site, Clay will emit a baked document in .qmd format, wherein only the references to assets in use will be picked up and copied over as static assets.</p>
851
+
<p>As a consequence of how this Quarto site builds stuff, if we want to have our topojson file available for our CesiumJS app to pull locally, we have to reference it somewhere to indicate it should be copied to the static site (or we stick it in a global resources file etc.).</p>
852
+
<p>This work-around applies to any resource we want to have inside a webapp like geojson or other data, since Quarto isn’t going to know that. We can communicate our need by adding some reference to the doc, like a download link using the hiccup below.</p>
<p>This is a common idiom in CesiumJS. There is a natural correspondence between geospatial entities and interactive analysis. Cesium enables workflows for interactive selection and viewing; we can tap into these flows with cljs and make even more interesting stuff.</p>
0 commit comments