Я просто внедрил здесь SDK в свой проект для первого теста, но я не могу никуда попасть, и на этом сайте нет поддержки kotlin
try{
mapfragment!!.init { error ->
if (error == OnEngineInitListener.Error.NONE) {
// retrieve a reference of the map from the map fragment
var fragmentMap = mapfragment.map
map = mapfragment.map
// Set the map center to the Vancouver region (no animation)
map!!.setCenter(GeoCoordinate(49.196261, -123.004773, 0.0), Map.Animation.NONE)
// Set the zoom level to the average between min and max
map!!.zoomLevel = (map!!.maxZoomLevel + map!!.minZoomLevel) / 2
} else {
println("ERROR: Cannot initialize Map Fragment")
}
}
}
catch
(e: Exception)
{
Log.e("exception","map",e)
}catch
(ej: java.lang.Exception)
{
Log.e("exception","map",ej)
}
эта часть mapfragment!!.init
дает мне исключение
java.lang.ClassCastException: com.here.android.mpa.mapping.MapView не может быть приведен к com.here.android.mpa.mapping.SupportMapFragment
это мой макет
<fragment
class="com.here.android.mpa.mapping.SupportMapFragment"
android:id="@+id/mapfragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>