Skip to content

Instantly share code, notes, and snippets.

@stakancheck
Created January 27, 2024 13:26
Show Gist options
  • Save stakancheck/2d363985405a93ccc1717aefd3625263 to your computer and use it in GitHub Desktop.
Save stakancheck/2d363985405a93ccc1717aefd3625263 to your computer and use it in GitHub Desktop.
YandexMapProtocolImpl (iosApp)
class YandexMapProtocolImpl: YandexMapProtocol {
var mapViewController: MapViewController
var viewController: UIViewController
init() {
self.mapViewController = MapViewController()
self.viewController = (self.mapViewController as UIViewController)
}
func addCameraListener(onDragged: @escaping () -> Void) {
mapViewController.addCameraListener(onDragged: onDragged)
}
func addMapListener(onPositionSelect: @escaping (KotlinDouble, KotlinDouble) -> Void) {
mapViewController.addInputListener(
onPositionSelect: { latitude, longitude in
onPositionSelect(KotlinDouble(value: latitude), KotlinDouble(value: longitude))
}
)
}
func addMapPointListener(onPointClick: @escaping (KotlinLong) -> Void) {
mapViewController.addPointListener(onPointClick: onPointClick)
}
func onMapMove(latLng: LatLng) {
mapViewController.mapMove(latLng: latLng)
}
func onMapStart() {
mapViewController.startMap()
}
func onMapStop() {
mapViewController.stopMap()
}
func setupFocusRect(bottomFocusAreaPadding: Int32) {
mapViewController.updateFocusArea(bottomFocusAreaPadding: Int(bottomFocusAreaPadding))
}
func updateCustomPoint(latLng: LatLng?, visible: Bool) {
mapViewController.updateCustomPoint(latLng: latLng, visible: visible)
}
func updateMyPoint(latLng: LatLng?, visible: Bool) {
mapViewController.updateMyPoint(latLng: latLng, visible: visible)
}
func updatePointsCollection(points: [PointMapModel]) {
mapViewController.updatePointsCollection(points: points)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment