3

I want to animate YMKPlacemarkMapObject when tapped. I tried, but not working.

    func onMapObjectTap(with mapObject: YMKMapObject, point: YMKPoint) -> Bool {

        guard let placemark = mapObject as? YMKPlacemarkMapObject else { return false }

        let iconStyle: YMKIconStyle = YMKIconStyle()

        UIView.animate(withDuration: 1.0, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 5, options: .curveEaseInOut, animations: {
            iconStyle.scale = 2
            placemark.setIconStyleWith(iconStyle)
        }) { _ in
            iconStyle.scale = 1
            placemark.setIconStyleWith(iconStyle)
        }
    }

When using Google Maps, I can easily access markers imageView and transform it. For Yandex Maps I could not find a way to access placemarks imageView. Is there a way to access imageView?

serdar aylanc
  • 1,307
  • 2
  • 20
  • 37

1 Answers1

0

YMKPlacemarkMapObject does not support UIView animation, but you can animate any property of YMKPlacemarkMapObject manually using CADisplayLink for example.

I would like also suggest you to ask questions here. In this case it will be answered (by mapkit developers) faster.