Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PointFeatureDsl {
- // ...
- }
- class FeatureCollectionDsl {
- fun point(lat: Double, lng: Double, init: PointFeatureDsl.() -> Unit = {}) {
- // ...
- }
- fun toGeoJson(): FeatureCollection {
- // ...
- return FeatureCollection()
- }
- }
- fun featureCollection(init: FeatureCollectionDsl.() -> Unit) =
- FeatureCollectionDsl()
- .apply(init)
- .toGeoJson()
- fun main(args: Array<String>) {
- featureCollection {
- point(1.1, 1.2)
- point (2.1, 2.2 ){
- // ...
- }
- }
- }
Add Comment
Please, Sign In to add comment