volga-volga / react-native-yamap

React Native Yandex Maps | Яндекс Карты | Yandex.MapKit implementation for react native | YandexMaps
151 stars 84 forks source link

Animation setCenter doesn't work #91

Closed AlmiranteTim closed 2 years ago

AlmiranteTim commented 2 years ago
no matter what I write in duration - doesn't work, no animation

mapYandexRef.setCenter({
  lat: lat,
  lon: lng,
  zoom: 12,
  duration: 2000
});
alexdarh commented 2 years ago

setCenter(center: { lon: number, lat: number }, zoom: number = 10, azimuth: number = 0, tilt: number = 0, duration: number = 0, animation: Animation = Animation.SMOOTH)

trry set Animation = .....

AlmiranteTim commented 2 years ago

setCenter(center: { lon: number, lat: number }, zoom: number = 10, azimuth: number = 0, tilt: number = 0, duration: number = 0, animation: Animation = Animation.SMOOTH)

trry set Animation = .....

I tried Animation.SMOOTH and Animation.LINEAR It also doesn't work

mapYandexRef.setCenter({ lat: lat, lon: lng, zoom: 12, duration: 2000, animation: Animation.SMOOTH } )

alexdarh commented 2 years ago

mapYandexRef.current.setCenter({......

alexdarh commented 2 years ago

and try this the object inside round brackets must pe point type

This code work: this.map.current.setCenter( {...this.state.marker}, 16.5, 0, 0, 0.1, Animation.LINEAR, );

Your code must be like this: mapYandexRef.current.setCenter({ lat: lat, lon: lng}, zoom: 12, duration: 2000, animation: Animation.SMOOTH )

AlmiranteTim commented 2 years ago

and try this the object inside round brackets must pe point type

This code work: this.map.current.setCenter( {...this.state.marker}, 16.5, 0, 0, 0.1, Animation.LINEAR, );

Your code must be like this: mapYandexRef.current.setCenter({ lat: lat, lon: lng}, zoom: 12, duration: 2000, animation: Animation.SMOOTH )

Thank you, it works: mapYandexRef.setCenter( { lat: lat, lon: lng }, 12, 0, 0, 0.3, Animation.LINEAR, );