Skip to content

Commit 43c0809

Browse files
committed
fix: crash on empty GEOJson in data
1 parent 27da975 commit 43c0809

File tree

4 files changed

+224
-218
lines changed

4 files changed

+224
-218
lines changed

docs/images/tutorial-step2.png

63.1 KB
Loading

docs/images/tutorial-step3.png

-16.4 KB
Loading

docs/tutorial.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ Now scroll down to behavior section of the properties and toggle the following i
2020
## Step 2 - Connect onSave event
2121
<img align="right" src="images/tutorial-step2.png" >
2222

23-
Add an new interaction by clicking `+Add` on the right side of Event Handlers. Select the `onSave` event and for Action `Run Javascript`. Copy the javascript below into the script field.
23+
Add an new interaction by clicking `+Add` on the right side of Event Handlers. Select the `onModify` event and for Action `Run Javascript`. Copy the javascript below into the script field.
2424

2525
```js
26-
localStorage.setItem(geo1.getFeatures('draw'))
26+
geo1.getFeatures('draw').then((features)=>{
27+
localStorage.setItem('draw',features)
28+
})
2729
```
2830
<br clear="right"/>
2931

@@ -33,7 +35,8 @@ localStorage.setItem(geo1.getFeatures('draw'))
3335
On the bottom of your screen within the `Data Queries` click on `+New` and select `Run Javascript Code`, change the trigger when to `When the Application (Page) loads` and copy the code below into the code box.
3436

3537
```js
36-
return geo1.setFeatures('draw',localStorage.getItem('draw'),true)
38+
geo1.setFeatures('draw',localStorage.values.draw,true)
39+
return localStorage.values.draw
3740
```
3841

3942
## Step 4 - Start drawing

0 commit comments

Comments
 (0)