Last active
June 7, 2019 15:48
-
-
Save joeyfigaro/ffe5c5e33f0029b09e05541eb6647bb2 to your computer and use it in GitHub Desktop.
# Flight-Planning (KML Imports)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Flight-Planning (KML Imports) | |
Flight Planning* | |
# User dropped / attached KML file via advanced settings | |
Empty* | |
add KML file -> KML Added | |
KML Added | |
remove KML file -> Empty | |
# Begins as soon as a user drops/attaches a KML file | |
Create Readable File | |
succeeded -> Convert to GeoJSON | |
failed -> KML Added With Error Messaging | |
# Passes File contents to @mapbox/togeojson | |
Convert to GeoJSON | |
succeeded -> Validate GeoJSON | |
failed -> KML Added With Error Messaging | |
# Checks for a single Polygon feature | |
Validate GeoJSON | |
# GeoJSON has one Polygon | |
succeeded -> Upload KML to S3 | |
# GeoJSON doesn't contain a Polygon, or has more than one | |
failed -> KML Added With Error Messaging | |
# Saves the attached KML file in S3 under the relevant mission | |
Upload KML to S3 | |
succeeded -> With KML Upload Succeeded Messaging | |
failed -> With KML Upload Failed Messaging | |
KML Added With Error Messaging | |
retry -> KML Added | |
# Add new Polygon/Flight Boundary to the map | |
Update Map | |
With KML Upload Succeeded Messaging* | |
# This is an odd state because technically the important parts succeeded... | |
# the map is updated, but the KML won't be saved to the mission | |
With KML Upload Failed Messaging | |
retry -> Upload KML to S3 | |
dismiss -> KML Added | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function render(model){ | |
let current_state_name = model.active_states[0].name; | |
return $("h1", | |
{style: {color: "darkBlue"}}, | |
`The current state is: ${current_state_name}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment