From beb2cd9c859c896502a7536df3377c1a2b067250 Mon Sep 17 00:00:00 2001 From: Ivo Berger Date: Sat, 14 Sep 2019 16:26:24 +0200 Subject: [PATCH] adds android gmaps extensions, renames internal Location class --- README.md | 12 ++--- android/build.gradle.kts | 8 ++- .../statikgmapsapi/android/GMapsExtensions.kt | 50 +++++++++++++++++++ build.gradle.kts | 2 +- buildSrc/src/main/kotlin/Libs.kt | 6 +++ buildSrc/src/main/kotlin/Versions.kt | 2 + .../statikgmapsapi/core/PolylineUtil.kt | 10 ++-- .../statikgmapsapi/core/StatikGMapsUrl.kt | 8 +-- .../{Location.kt => StatikMapsLocation.kt} | 12 ++--- .../statikgmapsapi/core/Downscale.kt | 14 +++--- .../ivoberger/statikgmapsapi/core/Location.kt | 40 +++++++++++++++ .../statikgmapsapi/core/LocationDataClass.kt | 35 ------------- .../statikgmapsapi/core/PathTransformation.kt | 22 ++++---- .../core/RequirementsChecking.kt | 18 +++---- .../statikgmapsapi/core/UrlGeneration.kt | 10 ++-- 15 files changed, 158 insertions(+), 91 deletions(-) rename core/src/main/java/com/ivoberger/statikgmapsapi/core/{Location.kt => StatikMapsLocation.kt} (74%) create mode 100644 core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/Location.kt delete mode 100644 core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/LocationDataClass.kt diff --git a/README.md b/README.md index 9071405..628469f 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ URL does not exceed 8192 characters. // supply your API key followed by a lambda to set the options val staticMap = StatikGMapsUrl("yourApiKey") { size = 500 to 250 - center = Location(.0, .0) - markers = listOf(Location(51.507222, -0.1275), Location(address = "London"), Location(48.8589507, 2.2770204)) + center = StatikMapsLocation(.0, .0) + markers = listOf(StatikMapsLocation(51.507222, -0.1275), StatikMapsLocation(address = "London"), StatikMapsLocation(48.8589507, 2.2770204)) zoom = 4 scale = 2 } @@ -53,9 +53,9 @@ val staticMap = StatikGMapsUrl("yourApiKey", baseUrl = "customBaseUrlWithoutHttp // either center & zoom or markers, path or visible required center = null zoom = null - markers = listOf() // each list entry equals one marker - path = listOf() - visible = listOf() // specifies locations that should be in the viewport + markers = listOf() // each list entry equals one marker + path = listOf() + visible = listOf() // specifies locations that should be in the viewport scale = 1 mapType = null @@ -129,7 +129,7 @@ dependencies { [google-api-specs]: https://developers.google.com/maps/documentation/maps-static/dev-guide [google-api-params]: https://developers.google.com/maps/documentation/maps-static/dev-guide#URL_Parameters -[google-api-locations]: https://developers.google.com/maps/documentation/maps-static/dev-guide#Locations +[google-api-locations]: https://developers.google.com/maps/documentation/maps-static/dev-guide#StatikMapsLocations [google-api-url]: https://developers.google.com/maps/documentation/maps-static/dev-guide#url-size-restriction [google-maps-styling]: https://developers.google.com/maps/documentation/maps-static/styling [google-api-imagesize]: https://developers.google.com/maps/documentation/maps-static/dev-guide#Imagesizes diff --git a/android/build.gradle.kts b/android/build.gradle.kts index f7d9769..1abb565 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,5 +1,3 @@ -import com.dicedmelon.gradle.jacoco.android.JacocoAndroidUnitTestReportExtension - plugins { id("com.android.library") kotlin("android") @@ -33,3 +31,9 @@ publishing { } } } + +dependencies { + api(Libs.play_services_location) + api(Libs.play_services_maps) + api(project(":core")) +} diff --git a/android/src/main/java/com/ivoberger/statikgmapsapi/android/GMapsExtensions.kt b/android/src/main/java/com/ivoberger/statikgmapsapi/android/GMapsExtensions.kt index 62c7868..d3a000c 100644 --- a/android/src/main/java/com/ivoberger/statikgmapsapi/android/GMapsExtensions.kt +++ b/android/src/main/java/com/ivoberger/statikgmapsapi/android/GMapsExtensions.kt @@ -1,2 +1,52 @@ package com.ivoberger.statikgmapsapi.android +import android.location.Location +import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.Marker +import com.google.android.gms.maps.model.Polyline +import com.google.android.gms.maps.model.PolylineOptions +import com.ivoberger.statikgmapsapi.core.StatikGMapsUrl +import com.ivoberger.statikgmapsapi.core.StatikMapsLocation + +fun Marker.toStatikMapsLocation() = position.toStatikMapsLocation() +fun Location.toStatikMapsLocation() = StatikMapsLocation(latitude, longitude) +fun LatLng.toStatikMapsLocation() = StatikMapsLocation(latitude, longitude) + +fun List.toPath() = map { StatikMapsLocation(it.latitude, it.longitude) } + +/** + * Sets the path from the points of the given [Polyline] + */ +fun StatikGMapsUrl.path(polyline: Polyline) = + run { path = polyline.points.map { StatikMapsLocation(it.latitude, it.longitude) } } + +/** + * Sets the path from the points of the given [PolylineOptions] + */ +fun StatikGMapsUrl.path(polyline: PolylineOptions) = + run { path = polyline.points.map { it.toStatikMapsLocation() } } + +/** + * Sets the path from the points of the given [List] of [LatLng] + */ +fun StatikGMapsUrl.path(latLngPath: List) = + run { path = latLngPath.map { it.toStatikMapsLocation() } } + +/** + * Adds the given [Marker] to [StatikGMapsUrl.markers] + */ +fun StatikGMapsUrl.marker(marker: Marker) = marker(marker.position) + +/** + * Adds the given [LatLng] to [StatikGMapsUrl.markers] + */ +fun StatikGMapsUrl.marker(marker: LatLng) = markers.add(marker.toStatikMapsLocation()) + +/** + * Adds the given [Location] to [StatikGMapsUrl.markers] + */ +fun StatikGMapsUrl.marker(marker: Location) = markers.add(marker.toStatikMapsLocation()) + + +fun StatikGMapsUrl.visible(latLng: LatLng) = visible.add(latLng.toStatikMapsLocation()) +fun StatikGMapsUrl.visible(location: Location) = visible.add(location.toStatikMapsLocation()) diff --git a/build.gradle.kts b/build.gradle.kts index c1757f4..4479c20 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ allprojects { subprojects { group = "com.ivoberger.statikgmapsapi" - version = "0.4.0" + version = "0.5.0" apply(plugin = "org.jetbrains.dokka") diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt index 1bdef56..51b8b59 100644 --- a/buildSrc/src/main/kotlin/Libs.kt +++ b/buildSrc/src/main/kotlin/Libs.kt @@ -26,6 +26,12 @@ object Libs { const val jacoco_android: String = "com.dicedmelon.gradle:jacoco-android:" + Versions.jacoco_android + const val play_services_location: String = "com.google.android.gms:play-services-location:" + + Versions.com_google_android_gms + + const val play_services_maps: String = "com.google.android.gms:play-services-maps:" + + Versions.com_google_android_gms + const val de_fayard_buildsrcversions_gradle_plugin: String = "de.fayard.buildSrcVersions:de.fayard.buildSrcVersions.gradle.plugin:" + Versions.de_fayard_buildsrcversions_gradle_plugin diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 3466b83..53c49b7 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -20,6 +20,8 @@ object Versions { const val jacoco_android: String = "0.1.4" + const val com_google_android_gms: String = "17.0.0" + const val de_fayard_buildsrcversions_gradle_plugin: String = "0.5.0" const val android_maven_publish: String = "3.6.2" diff --git a/core/src/main/java/com/ivoberger/statikgmapsapi/core/PolylineUtil.kt b/core/src/main/java/com/ivoberger/statikgmapsapi/core/PolylineUtil.kt index 5d0c6f4..3cb03cd 100644 --- a/core/src/main/java/com/ivoberger/statikgmapsapi/core/PolylineUtil.kt +++ b/core/src/main/java/com/ivoberger/statikgmapsapi/core/PolylineUtil.kt @@ -12,7 +12,7 @@ import kotlin.math.sqrt * @receiver path as pair of doubles * @return encoded polyline */ -fun List.encode(): String { +fun List.encode(): String { val result: MutableList = mutableListOf() var prevLat = 0 @@ -61,7 +61,7 @@ private fun splitIntoChunks(toEncode: Int): List { /** * https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm */ -internal fun List.simplify(epsilon: Double): List { +internal fun List.simplify(epsilon: Double): List { // Find the point with the maximum distance var dmax = 0.0 var index = 0 @@ -77,8 +77,8 @@ internal fun List.simplify(epsilon: Double): List { // If max distance is greater than epsilon, recursively simplify return if (dmax > epsilon) { // Recursive call - val recResults1: List = subList(0, index + 1).simplify(epsilon) - val recResults2: List = subList(index, end).simplify(epsilon) + val recResults1: List = subList(0, index + 1).simplify(epsilon) + val recResults2: List = subList(index, end).simplify(epsilon) // Build the result list listOf(recResults1.subList(0, recResults1.lastIndex), recResults2).flatMap { it.toList() } @@ -88,7 +88,7 @@ internal fun List.simplify(epsilon: Double): List { } private fun perpendicularDistance( - pt: Location, lineFrom: Location, lineTo: Location + pt: StatikMapsLocation, lineFrom: StatikMapsLocation, lineTo: StatikMapsLocation ): Double = abs( (lineTo.longitude!! - lineFrom.longitude!!) diff --git a/core/src/main/java/com/ivoberger/statikgmapsapi/core/StatikGMapsUrl.kt b/core/src/main/java/com/ivoberger/statikgmapsapi/core/StatikGMapsUrl.kt index 8eb160c..86e52e0 100644 --- a/core/src/main/java/com/ivoberger/statikgmapsapi/core/StatikGMapsUrl.kt +++ b/core/src/main/java/com/ivoberger/statikgmapsapi/core/StatikGMapsUrl.kt @@ -77,7 +77,7 @@ class StatikGMapsUrl( * (required if markers, path or visible not present) * defines the center of the map, equidistant from all edges of the map. */ - var center: Location? = null + var center: StatikMapsLocation? = null /** * (required if markers, path or visible not present) * defines the zoom level of the map, which determines the magnification level of the map. @@ -89,15 +89,15 @@ class StatikGMapsUrl( /** * List of markers to display on the map */ - var markers: List = listOf() + var markers: MutableList = mutableListOf() /** * List of locations constituting a path to be drawn on the map */ - var path: List = listOf() + var path: List = listOf() /** * List of locations to be wihtin the maps viewport */ - var visible: List = listOf() + var visible: MutableList = mutableListOf() /** * Specifies if the path should be encoded * See https://developers.google.com/maps/documentation/utilities/polylinealgorithm for more information diff --git a/core/src/main/java/com/ivoberger/statikgmapsapi/core/Location.kt b/core/src/main/java/com/ivoberger/statikgmapsapi/core/StatikMapsLocation.kt similarity index 74% rename from core/src/main/java/com/ivoberger/statikgmapsapi/core/Location.kt rename to core/src/main/java/com/ivoberger/statikgmapsapi/core/StatikMapsLocation.kt index a1c77c5..99d48b1 100644 --- a/core/src/main/java/com/ivoberger/statikgmapsapi/core/Location.kt +++ b/core/src/main/java/com/ivoberger/statikgmapsapi/core/StatikMapsLocation.kt @@ -4,7 +4,7 @@ package com.ivoberger.statikgmapsapi.core * Container to hold a location either by latitude and longitude or an address * Latitude and longitude will be checked for validity, addresses won't. */ -data class Location( +data class StatikMapsLocation( val latitude: Double? = null, val longitude: Double? = null, val address: String? = null @@ -25,18 +25,18 @@ data class Location( /** - * Creates a [Location] from a [Pair] of [Double] + * Creates a [StatikMapsLocation] from a [Pair] of [Double] */ -fun Pair.toLocation() = Location(first, second) +fun Pair.toLocation() = StatikMapsLocation(first, second) /** - * Creates a [List] of [Location] from a [List] of [Pair] of [Double] + * Creates a [List] of [StatikMapsLocation] from a [List] of [Pair] of [Double] */ fun List>.toLocations() = map { it.toLocation() } /** - * Converts a list of [Location]s to a valid URL parameter string + * Converts a list of [StatikMapsLocation]s to a valid URL parameter string */ -internal fun List.toUrlParam(): String = fold("") { param, location -> +internal fun List.toUrlParam(): String = fold("") { param, location -> "${if (param.isNotBlank()) "$param|" else ""}$location" } diff --git a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/Downscale.kt b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/Downscale.kt index 8a96077..0d6f460 100644 --- a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/Downscale.kt +++ b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/Downscale.kt @@ -12,7 +12,7 @@ class Downscale : StringSpec({ var origSize = 300 to 170 val url = StatikGMapsUrl("placeholder") { size = origSize - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 14 } url.toString() @@ -31,7 +31,7 @@ class Downscale : StringSpec({ var origSize = 300 to 170 val url = StatikGMapsUrl("placeholder") { size = origSize - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 14 downscale = false } @@ -49,7 +49,7 @@ class Downscale : StringSpec({ "IllegalArgumentException should be thrown as size exceeds limits but downscaling is forbidden" { val url = StatikGMapsUrl("placeholder") { - center = Location(address = "London") + center = StatikMapsLocation(address = "London") zoom = 14 downscale = false }.apply { size = 700 to 100 } @@ -79,7 +79,7 @@ class Downscale : StringSpec({ var origRatio = origSize.first / origSize.second.toFloat() var url = StatikGMapsUrl("placeholder") { size = origSize - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 14 } url.toString() @@ -91,7 +91,7 @@ class Downscale : StringSpec({ origRatio = origSize.first / origSize.second.toFloat() url = StatikGMapsUrl("placeholder") { size = origSize - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 14 } url.toString() @@ -103,7 +103,7 @@ class Downscale : StringSpec({ origRatio = origSize.first / origSize.second.toFloat() url = StatikGMapsUrl("placeholder") { size = origSize - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 14 scale = 4 premiumPlan = true @@ -117,7 +117,7 @@ class Downscale : StringSpec({ origRatio = origSize.first / origSize.second.toFloat() url = StatikGMapsUrl("placeholder") { size = origSize - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 14 scale = 4 premiumPlan = true diff --git a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/Location.kt b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/Location.kt new file mode 100644 index 0000000..5d76403 --- /dev/null +++ b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/Location.kt @@ -0,0 +1,40 @@ +package com.ivoberger.statikgmapsapi.core + +import io.kotlintest.shouldThrow +import io.kotlintest.specs.StringSpec + +class Location : StringSpec({ + "Should create a valid location" { + for (lat in -90..90) { + for (lng in -180..180) { + StatikMapsLocation(lat.toDouble(), lng.toDouble()) + } + } + StatikMapsLocation(address = "London") + } + "Missing parameters should result in an exception" { + shouldThrow { StatikMapsLocation() } + shouldThrow { StatikMapsLocation(.0) } + shouldThrow { StatikMapsLocation(longitude = .0) } + } + "Providing wrong combinations of parameters should result on an exception" { + shouldThrow { StatikMapsLocation(90.0, .0, "London") } + shouldThrow { + StatikMapsLocation( + longitude = .0, + address = "London" + ) + } + shouldThrow { StatikMapsLocation(.0, address = "London") } + } + "Out of range coordinates should result in an exception" { + shouldThrow { StatikMapsLocation(91.0, .0) } + shouldThrow { StatikMapsLocation(-91.0, .0) } + shouldThrow { StatikMapsLocation(.0, 181.0) } + shouldThrow { StatikMapsLocation(.0, -181.0) } + } + "A non-null but blank or empty address should result in an exception" { + shouldThrow { StatikMapsLocation(address = "") } + shouldThrow { StatikMapsLocation(address = " ") } + } +}) diff --git a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/LocationDataClass.kt b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/LocationDataClass.kt deleted file mode 100644 index 0bfc7d4..0000000 --- a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/LocationDataClass.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.ivoberger.statikgmapsapi.core - -import io.kotlintest.shouldThrow -import io.kotlintest.specs.StringSpec - -class LocationDataClass : StringSpec({ - "Should create a valid location" { - for (lat in -90..90) { - for (lng in -180..180) { - Location(lat.toDouble(), lng.toDouble()) - } - } - Location(address = "London") - } - "Missing parameters should result in an exception" { - shouldThrow { Location() } - shouldThrow { Location(.0) } - shouldThrow { Location(longitude = .0) } - } - "Providing wrong combinations of parameters should result on an exception" { - shouldThrow { Location(90.0, .0, "London") } - shouldThrow { Location(longitude = .0, address = "London") } - shouldThrow { Location(.0, address = "London") } - } - "Out of range coordinates should result in an exception" { - shouldThrow { Location(91.0, .0) } - shouldThrow { Location(-91.0, .0) } - shouldThrow { Location(.0, 181.0) } - shouldThrow { Location(.0, -181.0) } - } - "A non-null but blank or empty address should result in an exception" { - shouldThrow { Location(address = "") } - shouldThrow { Location(address = " ") } - } -}) diff --git a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/PathTransformation.kt b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/PathTransformation.kt index e67de99..5f3232b 100644 --- a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/PathTransformation.kt +++ b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/PathTransformation.kt @@ -10,16 +10,16 @@ import io.kotlintest.specs.StringSpec class PathTransformation : StringSpec({ - val locations = (0..999).map { Location(it % 90.0, it % 180.0) } + val locations = (0..999).map { StatikMapsLocation(it % 90.0, it % 180.0) } "ToString should automatically detect if simplification is necessary" { var url = StatikGMapsUrl("placeholder") { size = 300 to 170 path = listOf( - Location(.0, .0), - Location(.0, 10.0), - Location(5.0, .0), - Location(7.0, .6) + StatikMapsLocation(.0, .0), + StatikMapsLocation(.0, 10.0), + StatikMapsLocation(5.0, .0), + StatikMapsLocation(7.0, .6) ) } url.toString() shouldEndWith url.path.toUrlParam() @@ -42,12 +42,12 @@ class PathTransformation : StringSpec({ } val testPath = listOf( - Location(41.0, -87.0), - Location(41.5, -87.0), - Location(41.5, -87.75), - Location(40.555, -87.555), - Location(40.555, -88.0), - Location(42.0, -88.0) + StatikMapsLocation(41.0, -87.0), + StatikMapsLocation(41.5, -87.0), + StatikMapsLocation(41.5, -87.75), + StatikMapsLocation(40.555, -87.555), + StatikMapsLocation(40.555, -88.0), + StatikMapsLocation(42.0, -88.0) ) // result from https://developers.google.com/maps/documentation/utilities/polylineutility val encodedTestPath = "_yfyF~d_rO_t`B??nnqCfqwDwae@?f|uAgfyG?" diff --git a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/RequirementsChecking.kt b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/RequirementsChecking.kt index 71916c9..1d55dcc 100644 --- a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/RequirementsChecking.kt +++ b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/RequirementsChecking.kt @@ -14,7 +14,7 @@ class RequirementsChecking : StringSpec({ shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) }.toString() } shouldThrow { @@ -28,14 +28,14 @@ class RequirementsChecking : StringSpec({ shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 21 }.toString() } shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = -1 }.toString() } @@ -44,7 +44,7 @@ class RequirementsChecking : StringSpec({ shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 5 scale = 0 }.toString() @@ -52,7 +52,7 @@ class RequirementsChecking : StringSpec({ shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 5 scale = 3 }.toString() @@ -61,7 +61,7 @@ class RequirementsChecking : StringSpec({ shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 5 scale = 4 }.toString() @@ -69,7 +69,7 @@ class RequirementsChecking : StringSpec({ shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - center = Location(.0, .0) + center = StatikMapsLocation(.0, .0) zoom = 5 scale = 3 premiumPlan = true @@ -81,13 +81,13 @@ class RequirementsChecking : StringSpec({ shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - path = (0..799).map { Location(it % 90.0, it % 180.0) } + path = (0..799).map { StatikMapsLocation(it % 90.0, it % 180.0) } }.toString() } shouldThrow { StatikGMapsUrl("key") { size = 500 to 500 - path = (0..1500).map { Location(it % 90.0, it % 180.0) } + path = (0..1500).map { StatikMapsLocation(it % 90.0, it % 180.0) } encodePath = true }.toString() } diff --git a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/UrlGeneration.kt b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/UrlGeneration.kt index 89a009e..a75e0a3 100644 --- a/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/UrlGeneration.kt +++ b/core/src/test/kotlin/com/ivoberger/statikgmapsapi/core/UrlGeneration.kt @@ -7,11 +7,11 @@ class UrlGeneration : StringSpec({ val testValues = object { val size = 500 to 250 - val center = Location(.0, .0) - val locationList = listOf( - Location(51.507222, -0.1275), - Location(address = "London"), - Location(48.8589507, 2.2770204) + val center = StatikMapsLocation(.0, .0) + val locationList = mutableListOf( + StatikMapsLocation(51.507222, -0.1275), + StatikMapsLocation(address = "London"), + StatikMapsLocation(48.8589507, 2.2770204) ) val zoom = 4 val scale = 2