surfstudio / yandex-mapkit-lite-flutter

Made by Surf 🏄
MIT License
3 stars 0 forks source link

[BUG] YandexMapController.moveCamera not working on static map #24

Open vmeretin opened 2 months ago

vmeretin commented 2 months ago

Expected behavior

Camera animating on new position

Actual behavior

Camera not animating on new position

Video/Screenshot

IMG_D11C256053C5-1

Details

Flutter version: 3.22.0

Dart version: 3.4.0

Platform: iOS only

Example of usage

class YandexMapsStaticWidget extends StatelessWidget {
  final double latitude;
  final double longitude;
  final VoidCallback onPressed;

  const YandexMapsStaticWidget({
    required this.latitude,
    required this.longitude,
    required this.onPressed,
  });

  @override
  Widget build(BuildContext context) => YandexMap(
        tiltGesturesEnabled: false,
        zoomGesturesEnabled: false,
        rotateGesturesEnabled: false,
        scrollGesturesEnabled: false,
        mapObjects: [
          PlacemarkMapObject(
            mapId: MapObjectId('$latitude, $longitude'),
            point: Point(
              latitude: latitude,
              longitude: longitude,
            ),
            icon: PlacemarkIcon.single(PlacemarkIconStyle(
              image: BitmapDescriptor.fromAssetImage('assets/icons/map_selected.png'),
            )),
            opacity: 1,
          ),
        ],
        onMapCreated: (yandexMapController) async {
          await yandexMapController.setMapStyle(YandexMapsConstants.style);
          await yandexMapController.moveCamera(
            CameraUpdate.newCameraPosition(CameraPosition(
              target: Point(
                latitude: latitude,
                longitude: longitude,
              ),
              zoom: MapConstants.initialStaticZoom,
            )),
            animation: const MapAnimation(duration: 0.1),
          );
        },
        onMapTap: (point) => onPressed(),
      );
}

What did you try to solve

null animation parameter in moveCamera method

Checklist for self-check

github-actions[bot] commented 2 months ago

Link to Pyrus task