Guest User

Untitled

a guest
Dec 18th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. class PointFeatureDsl {
  2. // ...
  3. }
  4.  
  5. class FeatureCollectionDsl {
  6. fun point(lat: Double, lng: Double, init: PointFeatureDsl.() -> Unit = {}) {
  7. // ...
  8. }
  9.  
  10. fun toGeoJson(): FeatureCollection {
  11. // ...
  12. return FeatureCollection()
  13. }
  14. }
  15.  
  16. fun featureCollection(init: FeatureCollectionDsl.() -> Unit) =
  17. FeatureCollectionDsl()
  18. .apply(init)
  19. .toGeoJson()
  20.  
  21. fun main(args: Array<String>) {
  22. featureCollection {
  23. point(1.1, 1.2)
  24. point (2.1, 2.2 ){
  25. // ...
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment