Skip to main content

Posts

Showing posts with the label CesiumJS

Things I Learned: Using URLs to Store Web App State in Cesium Sandcastle

 With Cesium Ion Sandcastle users can try out various parts of the Cesium JS library to create maps. Once their code is working, they can also share those maps with the code. I initially wondered about the infrastructure that required to store and then serve every single map examples code. Then, I realized that the code isn't stored in a server, it's in the share URL! I originally started to put this together when I noticed how long a typical Cesium Sandcastle is. They tend to look like this: except longer. The seemingly random characters are a base64 encoded transcript of the JavaScript code along with the html and styling for the Sandcastle project. The fact that everything was encoded in the URL made me wonder what else could be achieved with the URL. A lot, it turns out. NOTE : I discovered it's important to place your additional URL args before the #c anchor that contains the Sandcastle code. Otherwise, your args get interpreted as being part of the JavaScript that...