Created
January 27, 2024 13:26
-
-
Save stakancheck/2d363985405a93ccc1717aefd3625263 to your computer and use it in GitHub Desktop.
YandexMapProtocolImpl (iosApp)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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