Merge pull request #53 from TouchInstinct/fix/yandex_map

fix/yandex_map
This commit is contained in:
Oleg 2019-08-19 14:21:54 +03:00 committed by GitHub
commit b1989ad300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -53,11 +53,14 @@ dependencies {
implementation project(':lifecycle')
implementation project(':lifecycle-rx')
implementation project(':navigation')
implementation project(':templates')
implementation project(':recyclerview-adapters')
implementation project(':recyclerview-calendar')
implementation project(':kotlin-extensions')
implementation project(':livedata-location')
implementation project(':tabbar-navigation')
implementation project(':base-map')
implementation project(':yandex-map')
implementation project(':google-map')
}
```
Можно подключать только те модули, которые вам необходимы.

View File

@ -17,13 +17,16 @@ import ru.touchin.basemap.AbstractMapManager
class YandexMapManager(
mapView: MapView,
apiKey: String,
private val isDebug: Boolean = false
) : AbstractMapManager<MapView, Map, Point>(mapView), MapLoadedListener, CameraListener, InputListener {
companion object {
private const val CAMERA_ANIMATION_DURATION = 1f
private const val CAMERA_OFFSET_ZOOM = 3f
// Call in Application.onCreate()
fun setApiKey(apiKey: String) = MapKitFactory.setApiKey(apiKey)
}
private val userLocationLayer by lazy {
@ -31,7 +34,6 @@ class YandexMapManager(
}
init {
MapKitFactory.setApiKey(apiKey)
MapKitFactory.initialize(mapView.context)
}