I need to introduce few additional properties to existing object properties set.
like:
- ID
- Geo Location
- etc
Whenever I draw a shape, I need to add additional properties to the shape and need to get from toDataLessJSON()
I need to introduce few additional properties to existing object properties set.
like:
Whenever I draw a shape, I need to add additional properties to the shape and need to get from toDataLessJSON()
As of version 1.7.0 levon's code stopped working. All you need to do is to fix as follows:
You have to receive
properties
argument and pass it on totoObject
.Here's a code for adding custom properties and saving them in JSON serialization for any object on canvas. (I used standard javascript object properties, but it works for me)
And you then include the custom attribute in object serialization.