|
|
### _onCreated
|
|
### _onCreated in DrawTools.js
|
|
|
Only one element at a time goes to the _onCreated-function.
|
|
Only one element at a time goes to the _onCreated-function.
|
|
|
#### General
|
|
#### General
|
|
|
_leaflet_id is unique for every element.
|
|
_leaflet_id is unique for every element.
|
| ... | @@ -59,7 +59,7 @@ e |
... | @@ -59,7 +59,7 @@ e |
|
|
└── _latlngs
|
|
└── _latlngs
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### _onEdited ja _onDeleted
|
|
### _onEdited and _onDeleted in DrawTools.js
|
|
|
_onEdited and _onDeleted functions are fired when the user edits or deletes elements and clicks Save. Thus the object that is given to these functions is a list of elements with some additional information. The essential part of this object is that each drawn element is listed under their leaflet ids, not just a basic array. It's necessary to use eachLayer function, if one wants to do something with single elements.
|
|
_onEdited and _onDeleted functions are fired when the user edits or deletes elements and clicks Save. Thus the object that is given to these functions is a list of elements with some additional information. The essential part of this object is that each drawn element is listed under their leaflet ids, not just a basic array. It's necessary to use eachLayer function, if one wants to do something with single elements.
|
|
|
```
|
|
```
|
|
|
e
|
|
e
|
| ... | @@ -89,4 +89,4 @@ Marker, TextBox and Circle coordinates are saved as a single set of coordinates. |
... | @@ -89,4 +89,4 @@ Marker, TextBox and Circle coordinates are saved as a single set of coordinates. |
|
|
|
|
|
|
|
Type determines what type of a drawing it is. If it's a circle or a textbox, there's an extra field for radius and text, respectively.
|
|
Type determines what type of a drawing it is. If it's a circle or a textbox, there's an extra field for radius and text, respectively.
|
|
|
|
|
|
|
|
drawingIsActive is a boolean value for whether the drawing is deleted or not. faction has information related to the faction that drew the drawing, and mapDrawingId is, well, the id of the drawing which is generated in the back-end. |
|
drawingIsActive is a boolean value for whether the drawing is deleted or not; drawings will never be removed from the database completely, as they are still needed for replays. faction has information related to the faction that drew the drawing, and mapDrawingId is, well, the id of the drawing which is generated in the back-end. |
|
\ No newline at end of file |
|
\ No newline at end of file |