Commits

chunquedong committed 03dedf0 Draft

Serialization test

  • Participants
  • Parent commits e5f4d8d

Comments (0)

Files changed (3)

File chunmap/database/fan/DataUnit.fan

 using chunmapData
 using slanActor
 
+@Serializable
 class DataUnit
 {
   Str skey

File chunmap/model/fan/geom/Geometry.fan

 ** Model a geometry. Base class for `Point`,`LineString`,`Polygon`...
 **
 @Js
+@Serializable { simple = true }
 abstract class Geometry
 {
   **

File example/Shape.fan

 using chunmapModel
 using chunmapUtil
 using chunmapView
+using chunmapData
 using chunmapRaster
 
 class Main
       EdgePane
       {
         center = InsetPane { size = Size(900,500); content = map }
-        bottom = Button{ text = "reset"; onAction.add { map.ctrl.fullView.renderMap.refreshAll }}
+        bottom = Button
+        {
+          text = "reset";
+          onAction.add
+          {
+            map.ctrl.fullView.renderMap.refreshAll
+            lyr := layer0 as VectorLayer
+            lyr.dataSource.each(Condition.empty) |f|
+            {
+              buf := StrBuf()
+              buf.out.writeObj(f, ["indent":2])
+              echo(buf.toStr)
+            }
+          }
+        }
       },
     }.open
   }