Commit 9c13e4d1 authored by wind.wang's avatar wind.wang

fix kotlin check

parent 106eed06
...@@ -17,7 +17,7 @@ fun ReadableMap.toLatLng(): LatLng { ...@@ -17,7 +17,7 @@ fun ReadableMap.toLatLng(): LatLng {
} }
fun ReadableArray.toLatLngList(): ArrayList<LatLng> { fun ReadableArray.toLatLngList(): ArrayList<LatLng> {
return ArrayList((0..(this.size() - 1)).map { this.getMap(it).toLatLng() }) return ArrayList((0..(this.size() - 1)).map { this.getMap(it)!!.toLatLng() })
} }
fun LatLng.toWritableMap(): WritableMap { fun LatLng.toWritableMap(): WritableMap {
......
...@@ -15,7 +15,7 @@ class AMapMultiPoint(context: Context) : ReactViewGroup(context), AMapOverlay { ...@@ -15,7 +15,7 @@ class AMapMultiPoint(context: Context) : ReactViewGroup(context), AMapOverlay {
fun setPoints(points: ReadableArray) { fun setPoints(points: ReadableArray) {
items = ArrayList((0 until points.size()) items = ArrayList((0 until points.size())
.map { .map {
val data = points.getMap(it) val data = points.getMap(it)!!
val item = MultiPointItem(data.toLatLng()) val item = MultiPointItem(data.toLatLng())
if (data.hasKey("title")) { if (data.hasKey("title")) {
item.title = data.getString("title") item.title = data.getString("title")
......
...@@ -171,7 +171,7 @@ class AMapView(context: Context) : TextureMapView(context) { ...@@ -171,7 +171,7 @@ class AMapView(context: Context) : TextureMapView(context) {
var rotation = currentCameraPosition.bearing var rotation = currentCameraPosition.bearing
if (target.hasKey("coordinate")) { if (target.hasKey("coordinate")) {
coordinate = target.getMap("coordinate").toLatLng() coordinate = target.getMap("coordinate")?.toLatLng()
} }
if (target.hasKey("zoomLevel")) { if (target.hasKey("zoomLevel")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment