{"id":358604,"date":"2024-05-21T00:15:26","date_gmt":"2024-05-21T00:15:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=358604"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T00:15:26","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=358604","title":{"rendered":"<span>Flutter Yandex Mapkit: \u043a\u0430\u043a \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u042f\u043d\u0434\u0435\u043a\u0441 \u041a\u0430\u0440\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 Flutter. \u0427\u0430\u0441\u0442\u044c 2<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/fd0\/5c9\/569\/fd05c95695f644cd82ed5508bdada97d.jpg\" width=\"1958\" height=\"1103\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fd0\/5c9\/569\/fd05c95695f644cd82ed5508bdada97d.jpg\" data-blurred=\"true\"\/><\/figure>\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 <\/em><a href=\"https:\/\/habr.com\/ru\/users\/aakhlestova\/\"><em>\u0410\u043d\u043d\u0430 \u0410\u0445\u043b\u0451\u0441\u0442\u043e\u0432\u0430<\/em><\/a><em>, \u044f Flutter-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 <\/em><a href=\"https:\/\/friflex.com\/\"><em><u>Friflex<\/u><\/em><\/a><em>. \u0412 <\/em><a href=\"https:\/\/habr.com\/ru\/companies\/friflex\/articles\/769662\/\"><em><u>\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/u><\/em><\/a><em> \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b Yandex Mapkit \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 Flutter. \u041c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043d\u0438\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u043f\u0440\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u0430\u0440\u0442\u044b.<\/em><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0437\u043e\u043d\u044b \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u0438 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0440\u043e\u0436\u043d\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u0410 \u0434\u043e \u0442\u043e\u0447\u043a\u0438 \u0411 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Yandex MapKit.<\/p>\n<p>\u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 MapScreen:<\/p>\n<details class=\"spoiler\">\n<summary>\u0444\u0430\u0439\u043b map_screen.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">import 'package:flutter\/material.dart'; import 'package:yandex_mapkit\/yandex_mapkit.dart'; import 'package:yandex_mapkit_demo\/data\/map_point.dart'; import 'package:yandex_mapkit_demo\/presentation\/clusterized_icon_painter.dart';   class MapScreen extends StatefulWidget {  const MapScreen({super.key});    @override  State&lt;MapScreen> createState() => _MapScreenState(); }   class _MapScreenState extends State&lt;MapScreen> {  late final YandexMapController _mapController;  var _mapZoom = 0.0;    @override  void dispose() {    _mapController.dispose();    super.dispose();  }    @override  Widget build(BuildContext context) {    return Scaffold(      appBar: AppBar(title: const Text('Yandex Mapkit Demo')),      body: YandexMap(        onMapCreated: (controller) async {          _mapController = controller;          \/\/ \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u043c \u0432\u0438\u0434 \u043a\u0430\u0440\u0442\u044b \u0431\u043b\u0438\u0436\u0435 \u043a \u0415\u0432\u0440\u043e\u043f\u0435          await _mapController.moveCamera(            CameraUpdate.newCameraPosition(              const CameraPosition(                target: Point(                  latitude: 50,                  longitude: 20,                ),                zoom: 3,              ),            ),          );        },        onCameraPositionChanged: (cameraPosition, _, __) {          setState(() {            _mapZoom = cameraPosition.zoom;          });        },        mapObjects: [          _getClusterizedCollection(            placemarks: _getPlacemarkObjects(context),          ),        ],      ),    );  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432  ClusterizedPlacemarkCollection _getClusterizedCollection({    required List&lt;PlacemarkMapObject> placemarks,  }) {    return ClusterizedPlacemarkCollection(        mapId: const MapObjectId('clusterized-1'),        placemarks: placemarks,        radius: 50,        minZoom: 15,        onClusterAdded: (self, cluster) async {          return cluster.copyWith(            appearance: cluster.appearance.copyWith(              opacity: 1.0,              icon: PlacemarkIcon.single(                PlacemarkIconStyle(                  image: BitmapDescriptor.fromBytes(                    await ClusterIconPainter(cluster.size)                        .getClusterIconBytes(),                  ),                ),              ),            ),          );        },        onClusterTap: (self, cluster) async {          await _mapController.moveCamera(            animation: const MapAnimation(                type: MapAnimationType.linear, duration: 0.3),            CameraUpdate.newCameraPosition(              CameraPosition(                target: cluster.placemarks.first.point,                zoom: _mapZoom + 1,              ),            ),          );        });  } }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;MapPoint> _getMapPoints() {  return const [    MapPoint(name: '\u041c\u043e\u0441\u043a\u0432\u0430', latitude: 55.755864, longitude: 37.617698),    MapPoint(name: '\u041b\u043e\u043d\u0434\u043e\u043d', latitude: 51.507351, longitude: -0.127696),    MapPoint(name: '\u0420\u0438\u043c', latitude: 41.887064, longitude: 12.504809),    MapPoint(name: '\u041f\u0430\u0440\u0438\u0436', latitude: 48.856663, longitude: 2.351556),    MapPoint(name: '\u0421\u0442\u043e\u043a\u0433\u043e\u043b\u044c\u043c', latitude: 59.347360, longitude: 18.341573),  ]; }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;PlacemarkMapObject> _getPlacemarkObjects(BuildContext context) {  return _getMapPoints()      .map(        (point) => PlacemarkMapObject(          mapId: MapObjectId('MapObject $point'),          point: Point(latitude: point.latitude, longitude: point.longitude),          opacity: 1,          icon: PlacemarkIcon.single(            PlacemarkIconStyle(              image: BitmapDescriptor.fromAssetImage(                'assets\/icons\/map_point.png',              ),              scale: 2,            ),          ),          onTap: (_, __) => showModalBottomSheet(            context: context,            builder: (context) => _ModalBodyView(              point: point,            ),          ),        ),      )      .toList(); }   \/\/\/ \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0438\u0306 \u043e \u0442\u043e\u0447\u043a\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 class _ModalBodyView extends StatelessWidget {  const _ModalBodyView({required this.point});    final MapPoint point;    @override  Widget build(BuildContext context) {    return Padding(      padding: const EdgeInsets.symmetric(vertical: 40),      child: Column(        mainAxisSize: MainAxisSize.min,        children: [          Text(point.name, style: const TextStyle(fontSize: 20)),          const SizedBox(height: 20),          Text(            '${point.latitude}, ${point.longitude}',            style: const TextStyle(              fontSize: 16,              color: Colors.grey,            ),          ),        ],      ),    );  } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db4\/d31\/480\/db4d31480a5770aff5609ffdb0827e5f.gif\" width=\"1046\" height=\"581\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db4\/d31\/480\/db4d31480a5770aff5609ffdb0827e5f.gif\"\/><\/figure>\n<h3>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u0430, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u0447\u043a\u043e\u0439.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043d\u043e \u0438 \u0433\u0434\u0435-\u043b\u0438\u0431\u043e \u0435\u0449\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0433\u043e\u0440\u043e\u0434\u0430), \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438. \u041e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u2014 <a href=\"https:\/\/pub.dev\/packages\/geolocator\"><u>geolocator<\/u><\/a> \u0438 <a href=\"https:\/\/pub.dev\/packages\/location\"><u>location<\/u><\/a>. \u042d\u0442\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 GPS \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0441\u0442\u0430\u0442\u0443\u0441\u044b.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u043a\u0430\u0440\u0442\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>YandexMap \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442 \u043d\u0430 \u0441\u043b\u043e\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043b\u043e\u0439 \u2014 \u0442\u043e\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u0430\u0440\u0442\u044b (\u043c\u0430\u0440\u043a\u0435\u0440\u044b, \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b, \u0437\u043e\u043d\u044b \u0438 \u0442.\u0434.). \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u043e\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<p>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u044f \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043a\u0430\u0440\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430 \u200b\u200b<code>toggleUserLayer()<\/code>. \u0427\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043b\u043e\u0439, \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 visible \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>true<\/code>, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u2014\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, <code>false<\/code>.<\/p>\n<p>\u0422.\u043a. \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u2014 <a href=\"https:\/\/pub.dev\/packages\/permission_handler\"><u>permission_handler<\/u><\/a>.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430 Android \u0432 \u0444\u0430\u0439\u043b\u0435 <em>AndroidManifest.xml<\/em>:\u00a0<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"xml\">&lt;uses-permission android:name=\"android.permission.INTERNET\" \/> &lt;uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" \/><\/code><\/pre>\n<ul>\n<li>\n<p>\u043d\u0430 IOS \u0432 \u0444\u0430\u0439\u043b\u0435 <em>Info.plist<\/em>:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"xml\">&lt;key>NSLocationWhenInUseUsageDescription&lt;\/key> &lt;string>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u0438&lt;\/string><\/code><\/pre>\n<ul>\n<li>\n<p>\u0442\u0430\u043a\u0436\u0435 \u043d\u0430 IOS \u0432 \u0444\u0430\u0439\u043b\u0435 <em>Podfile<\/em>:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"ruby\">post_install do |installer|  installer.pods_project.targets.each do |target|    flutter_additional_ios_build_settings(target)    target.build_configurations.each do |config|      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [        '$(inherited)',        'PERMISSION_LOCATION=1',      ]    end  end end<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>permission_handler<\/code> \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u0432\u044b\u0437\u0432\u0430\u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>Permission.location.request()<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0431\u0430 \u043a\u0435\u0439\u0441\u0430 \u2014 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0430\u043b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0434\u0430\u043d\u043e, \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043e \u2014 \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0444\u0430\u0439\u043b <em>map_screen.dart<\/em> \u043c\u0435\u0442\u043e\u0434 <code>_initLocationLayer()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443:<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  \/\/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f  \/\/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f - \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435  Future&lt;void> _initLocationLayer() async {    final locationPermissionIsGranted =        await Permission.location.request().isGranted;      if (locationPermissionIsGranted) {      await _mapController.toggleUserLayer(visible: true);    } else {      WidgetsBinding.instance.addPostFrameCallback((_) {        ScaffoldMessenger.of(context).showSnackBar(          const SnackBar(            content: Text('\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f'),          ),        );      });    }  }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043b\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>onMapCreated<\/code> \u0432\u0438\u0434\u0436\u0435\u0442\u0430 YandexMap \u0432 \u0444\u0430\u0439\u043b\u0435 <em>map_screen.dart<\/em>:<\/p>\n<pre><code class=\"dart\">onMapCreated: (controller) async {          _mapController = controller;          await _initLocationLayer();        },<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0443 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 YandexMap \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>onUserLocationAdded<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c nullable \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>_userLocation<\/code> \u0442\u0438\u043f\u0430 CameraPosition. \u0417\u0430\u0442\u0435\u043c \u0432 <code>onUserLocationAdded<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>getUserCameraPosition()<\/code> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>_userLocation<\/code> \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e, \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043c \u043a\u0430\u0440\u0442\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0431\u044b\u043b\u0430 \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u044d\u043a\u0440\u0430\u043d\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u0435\u0440\u043d\u0435\u043c \u043c\u0430\u0440\u043a\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>copyWith<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u0430 UserLocationView. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u043e\u0447\u043a\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u043a\u0435\u0440\u0430 \u042f\u043d\u0434\u0435\u043a\u0441\u0430 \u0437\u0435\u043b\u0435\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0441 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e 50% . \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0435\u0440\u043d\u0435\u043c \u0442\u043e\u0442 \u0436\u0435 \u043c\u0430\u0440\u043a\u0435\u0440, \u043d\u043e \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0435\u043c\u0443 100% \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"dart\">onUserLocationAdded: (view) async {          \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f          _userLocation = await _mapController.getUserCameraPosition();          \/\/ \u0435\u0441\u043b\u0438 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438          if (_userLocation != null) {            await _mapController.moveCamera(              CameraUpdate.newCameraPosition(                _userLocation!.copyWith(zoom: 10),              ),              animation: const MapAnimation(                type: MapAnimationType.linear,                duration: 0.3,              ),            );          }          \/\/ \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043c\u0430\u0440\u043a\u0435\u0440\u0430 - \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u043c          return view.copyWith(            pin: view.pin.copyWith(              opacity: 1,            ),          );        },<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<details class=\"spoiler\">\n<summary>\u0424\u0430\u0439\u043b map_screen.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">import 'package:flutter\/material.dart'; import 'package:permission_handler\/permission_handler.dart'; import 'package:yandex_mapkit\/yandex_mapkit.dart'; import 'package:yandex_mapkit_demo\/data\/map_point.dart'; import 'package:yandex_mapkit_demo\/presentation\/clusterized_icon_painter.dart';   class MapScreen extends StatefulWidget {  const MapScreen({super.key});    @override  State&lt;MapScreen> createState() => _MapScreenState(); }   class _MapScreenState extends State&lt;MapScreen> {  late final YandexMapController _mapController;  var _mapZoom = 0.0;    CameraPosition? _userLocation;    @override  void dispose() {    _mapController.dispose();    super.dispose();  }    @override  Widget build(BuildContext context) {    return Scaffold(      appBar: AppBar(title: const Text('Yandex Mapkit Demo')),      body: YandexMap(        onMapCreated: (controller) async {          _mapController = controller;          await _initLocationLayer();        },        onCameraPositionChanged: (cameraPosition, _, __) {          setState(() {            _mapZoom = cameraPosition.zoom;          });        },        mapObjects: [          _getClusterizedCollection(            placemarks: _getPlacemarkObjects(context),          ),        ],        onUserLocationAdded: (view) async {          \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f          _userLocation = await _mapController.getUserCameraPosition();          \/\/ \u0435\u0441\u043b\u0438 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438          if (_userLocation != null) {            await _mapController.moveCamera(              CameraUpdate.newCameraPosition(                _userLocation!.copyWith(zoom: 10),              ),              animation: const MapAnimation(                type: MapAnimationType.linear,                duration: 0.3,              ),            );          }          \/\/ \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043c\u0430\u0440\u043a\u0435\u0440\u0430 - \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u043c          return view.copyWith(            pin: view.pin.copyWith(              opacity: 1,            ),          );        },      ),    );  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432  ClusterizedPlacemarkCollection _getClusterizedCollection({    required List&lt;PlacemarkMapObject> placemarks,  }) {    return ClusterizedPlacemarkCollection(        mapId: const MapObjectId('clusterized-1'),        placemarks: placemarks,        radius: 50,        minZoom: 15,        onClusterAdded: (self, cluster) async {          return cluster.copyWith(            appearance: cluster.appearance.copyWith(              opacity: 1.0,              icon: PlacemarkIcon.single(                PlacemarkIconStyle(                  image: BitmapDescriptor.fromBytes(                    await ClusterIconPainter(cluster.size)                        .getClusterIconBytes(),                  ),                ),              ),            ),          );        },        onClusterTap: (self, cluster) async {          await _mapController.moveCamera(            animation: const MapAnimation(                type: MapAnimationType.linear, duration: 0.3),            CameraUpdate.newCameraPosition(              CameraPosition(                target: cluster.placemarks.first.point,                zoom: _mapZoom + 1,              ),            ),          );        });  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  \/\/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f  \/\/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f - \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435  Future&lt;void> _initLocationLayer() async {    final locationPermissionIsGranted =        await Permission.location.request().isGranted;      if (locationPermissionIsGranted) {      await _mapController.toggleUserLayer(visible: true);    } else {      WidgetsBinding.instance.addPostFrameCallback((_) {        ScaffoldMessenger.of(context).showSnackBar(          const SnackBar(            content: Text('\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f'),          ),        );      });    }  } }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;MapPoint> _getMapPoints() {  return const [    MapPoint(name: '\u041c\u043e\u0441\u043a\u0432\u0430', latitude: 55.755864, longitude: 37.617698),    MapPoint(name: '\u041b\u043e\u043d\u0434\u043e\u043d', latitude: 51.507351, longitude: -0.127696),    MapPoint(name: '\u0420\u0438\u043c', latitude: 41.887064, longitude: 12.504809),    MapPoint(name: '\u041f\u0430\u0440\u0438\u0436', latitude: 48.856663, longitude: 2.351556),    MapPoint(name: '\u0421\u0442\u043e\u043a\u0433\u043e\u043b\u044c\u043c', latitude: 59.347360, longitude: 18.341573),  ]; }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;PlacemarkMapObject> _getPlacemarkObjects(BuildContext context) {  return _getMapPoints()      .map(        (point) => PlacemarkMapObject(          mapId: MapObjectId('MapObject $point'),          point: Point(latitude: point.latitude, longitude: point.longitude),          opacity: 1,          icon: PlacemarkIcon.single(            PlacemarkIconStyle(              image: BitmapDescriptor.fromAssetImage(                'assets\/icons\/map_point.png',              ),              scale: 2,            ),          ),          onTap: (_, __) => showModalBottomSheet(            context: context,            builder: (context) => _ModalBodyView(              point: point,            ),          ),        ),      )      .toList(); }   \/\/\/ \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0438\u0306 \u043e \u0442\u043e\u0447\u043a\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 class _ModalBodyView extends StatelessWidget {  const _ModalBodyView({required this.point});    final MapPoint point;    @override  Widget build(BuildContext context) {    return Padding(      padding: const EdgeInsets.symmetric(vertical: 40),      child: Column(        mainAxisSize: MainAxisSize.min,        children: [          Text(point.name, style: const TextStyle(fontSize: 20)),          const SizedBox(height: 20),          Text(            '${point.latitude}, ${point.longitude}',            style: const TextStyle(              fontSize: 16,              color: Colors.grey,            ),          ),        ],      ),    );  } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7ec\/baf\/f31\/7ecbaff31fd0429eaa7b3b1e994f9051.gif\" width=\"1236\" height=\"695\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7ec\/baf\/f31\/7ecbaff31fd0429eaa7b3b1e994f9051.gif\"\/><\/figure>\n<h3>\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u043e\u043d \u043d\u0430 \u043a\u0430\u0440\u0442\u0435<\/h3>\n<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432 YandexMapkit \u2014 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u043e\u0432, \u0438\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u2014 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043e\u043d \u043d\u0430 \u043a\u0430\u0440\u0442\u0435. \u0422\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>PolygonMapObject<\/code>.\u00a0\u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442:<\/p>\n<ul>\n<li>\n<p><code>mapid<\/code> \u2014 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p><code>polygon<\/code> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 Polygon, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0437\u0430\u0434\u0430\u0442\u044c \u0446\u0432\u0435\u0442 \u0438 \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u043e\u0431\u0432\u043e\u0434\u043a\u0438, \u0446\u0432\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u044b. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430\u0436\u0430\u0442\u0438\u044f. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u0430\u0440\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0445 \u0442\u043e\u0447\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Polygon \u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u043e\u0440\u043c \u2014 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043a\u043e\u043b\u0435\u0446:<\/p>\n<ul>\n<li>\n<p>\u0432\u043d\u0435\u0448\u043d\u0435\u0435 \u043a\u043e\u043b\u044c\u0446\u043e (outerRing) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u0437\u043e\u043d\u044b, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c;<\/p>\n<\/li>\n<li>\n<p>\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043a\u043e\u043b\u044c\u0446\u0430 (innerRings) \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u0430\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043a\u043e\u043b\u044c\u0446\u043e\u043c \u0437\u043e\u043d\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u043f\u043b\u043e\u0448\u043d\u043e\u0439, \u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0437\u043e\u043d\u044b-\u00ab\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u00bb.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043a\u043e\u043b\u0435\u0446 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u043e\u0439 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0444\u0438\u0433\u0443\u0440\u0430 \u0441\u0430\u043c\u0430 \u043f\u0440\u0438\u043c\u0435\u0442 \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u0443\u044e \u0444\u043e\u0440\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0442\u043e\u0447\u043a\u0443 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 AppBar \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b MapScreen \u043a\u043d\u043e\u043f\u043a\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u0433\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u0435\u043a \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u00bb, \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u0441 \u043d\u0430\u0437\u0430\u0434 \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u043e\u043d\u0443. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043d\u043e\u043f\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<details class=\"spoiler\">\n<summary>\u0424\u0430\u0439\u043b settings_screen.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">import 'package:flutter\/material.dart'; import 'package:yandex_mapkit\/yandex_mapkit.dart';   \/\/\/ \u042d\u043a\u0440\u0430\u043d \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u043e\u0447\u0435\u043a \/\/\/ \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 class SettingsScreen extends StatefulWidget {  const SettingsScreen({super.key});    @override  State&lt;SettingsScreen> createState() => _SettingsScreenState(); }   class _SettingsScreenState extends State&lt;SettingsScreen> {  \/\/\/ \u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u0442\u044b  late List&lt;TextEditingController> _latControllers;    \/\/\/ \u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043b\u0433\u043e\u0442\u044b  late List&lt;TextEditingController> _lonControllers;    \/\/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  var _pointCount = 3;    @override  void initState() {    super.initState();    \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442,    \/\/ \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0440\u0438 \u0442\u043e\u0447\u043a\u0438    _latControllers = _getTextControllersList(_pointCount);    _lonControllers = _getTextControllersList(_pointCount);  }    @override  void dispose() {    \/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442    for (final controller in _latControllers) {      controller.dispose();    }    for (final controller in _lonControllers) {      controller.dispose();    }    super.dispose();  }    @override  Widget build(BuildContext context) {    return Scaffold(      appBar: AppBar(title: const Text('Settings Screen')),      body: Stack(        children: [          Padding(            padding: const EdgeInsets.all(20.0),            child: SingleChildScrollView(              child: Column(                children: [                  ...List.generate(                    _pointCount,                    (index) => _LatLongTextFields(                      latController: _latControllers[index],                      lonController: _lonControllers[index],                    ),                  ),                  const SizedBox(height: 40),                  ElevatedButton(                    child: const Text('\u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u044c'),                    onPressed: () {                      Navigator.pop(context, _getPointsFromText());                    },                  )                ],              ),            ),          ),          Align(            alignment: Alignment.bottomRight,            child: Padding(              padding: const EdgeInsets.all(20.0),              child: Column(                mainAxisSize: MainAxisSize.min,                children: [                  FloatingActionButton(                    heroTag: 'add',                    child: const Icon(Icons.add),                    onPressed: () {                      setState(() {                        _pointCount++;                        _latControllers.add(TextEditingController());                        _lonControllers.add(TextEditingController());                      });                    },                  ),                  const SizedBox(height: 16),                  FloatingActionButton(                    heroTag: 'remove',                    child: const Icon(Icons.remove),                    onPressed: () {                      setState(() {                        _pointCount--;                        _latControllers.removeLast();                        _lonControllers.removeLast();                      });                    },                  ),                ],              ),            ),          )        ],      ),    );  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u043e\u043b\u0435\u0439  List&lt;TextEditingController> _getTextControllersList(int count) {    return List.generate(count, (index) => TextEditingController());  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u043e\u0447\u0435\u043a \u043f\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f  List&lt;Point> _getPointsFromText() {    final points = &lt;Point>[];    for (int index = 0; index &lt; _pointCount; index++) {      final doubleLat = double.tryParse(_latControllers[index].text);      final doubleLon = double.tryParse(_lonControllers[index].text);        if (doubleLat != null &amp;&amp; doubleLon != null) {        points.add(Point(latitude: doubleLat, longitude: doubleLon));      }    }    return points;  } }   \/\/\/ \u0412\u0438\u0434\u0436\u0435\u0442, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u0442\u044b \u0438 \u0434\u043e\u043b\u0433\u043e\u0442\u044b class _LatLongTextFields extends StatelessWidget {  const _LatLongTextFields({    required this.latController,    required this.lonController,  });    \/\/\/ \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0438\u0440\u043e\u0442\u044b  final TextEditingController latController;    \/\/\/ \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043b\u0433\u043e\u0442\u044b  final TextEditingController lonController;    @override  Widget build(BuildContext context) {    return Row(      children: [        Expanded(          child: TextField(            controller: latController,            decoration: const InputDecoration(              labelText: '\u0428\u0438\u0440\u043e\u0442\u0430',            ),            keyboardType: TextInputType.number,          ),        ),        const SizedBox(width: 16),        Expanded(          child: TextField(            controller: lonController,            decoration: const InputDecoration(              labelText: '\u0414\u043e\u043b\u0433\u043e\u0442\u0430',            ),            keyboardType: TextInputType.number,          ),        ),      ],    );  } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/36b\/1fd\/14f\/36b1fd14f875e73982c537b3000f5575.jpg\" width=\"1058\" height=\"596\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/36b\/1fd\/14f\/36b1fd14f875e73982c537b3000f5575.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u043e\u043d\u0443 \u043f\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0442\u043e\u0447\u043a\u0430\u043c, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0444\u0430\u0439\u043b\u0435 <em>map_screen.dart<\/em> \u043c\u0435\u0442\u043e\u0434 <code>_getPolygonMapObject()<\/code>. \u041e\u043d \u0432\u0435\u0440\u043d\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u043e\u043d\u044b \u0433\u043e\u043b\u0443\u0431\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0441 \u0441\u0438\u043d\u0435\u0439 \u043e\u0431\u0432\u043e\u0434\u043a\u043e\u0439 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c. \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u0437\u043e\u043d\u044b \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u043e \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438:<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u044b \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 PolygonMapObject _getPolygonMapObject(  BuildContext context, {  required List&lt;Point> points, }) {  return PolygonMapObject(    mapId: const MapObjectId('polygon map object'),    polygon: Polygon(      \/\/ \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u043b\u0438\u043d\u0438\u044f \u0437\u043e\u043d\u044b      outerRing: LinearRing(        points: points,      ),      \/\/ \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u043b\u0438\u043d\u0438\u044f \u0437\u043e\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0435      innerRings: const [],    ),    strokeColor: Colors.blue,    strokeWidth: 3.0,    fillColor: Colors.blue.withOpacity(0.2),    onTap: (_, point) => showModalBottomSheet(      context: context,      builder: (context) => _ModalBodyView(        point: MapPoint(          name: '\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442',          latitude: point.latitude,          longitude: point.longitude,        ),      ),    ),  ); }<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043f\u043e\u043b\u0435 mapObjects \u0432\u0438\u0434\u0436\u0435\u0442\u0430 YandexMap \u0432 \u0444\u0430\u0439\u043b\u0435 <em>map_screen.dart<\/em>:<\/p>\n<pre><code class=\"dart\">mapObjects: [          _getClusterizedCollection(            placemarks: _getPlacemarkObjects(context),          ),          _getPolygonMapObject(context, points: _polygonPointsList ?? []),        ],<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<details class=\"spoiler\">\n<summary>\u0424\u0430\u0439\u043b map_screen.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">import 'package:flutter\/material.dart'; import 'package:permission_handler\/permission_handler.dart'; import 'package:yandex_mapkit\/yandex_mapkit.dart'; import 'package:yandex_mapkit_demo\/data\/map_point.dart'; import 'package:yandex_mapkit_demo\/presentation\/clusterized_icon_painter.dart'; import 'package:yandex_mapkit_demo\/presentation\/settings_screen.dart';   class MapScreen extends StatefulWidget {  const MapScreen({super.key});    @override  State&lt;MapScreen> createState() => _MapScreenState(); }   class _MapScreenState extends State&lt;MapScreen> {  \/\/\/ \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0430\u043c\u0438  late final YandexMapController _mapController;    \/\/\/ \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u043a\u0430\u0440\u0442\u044b  var _mapZoom = 0.0;    \/\/\/ \u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f  CameraPosition? _userLocation;    \/\/\/ \u0421\u043f\u0438\u0441\u043e\u043a \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c  List&lt;Point>? _polygonPointsList;    @override  void dispose() {    _mapController.dispose();    super.dispose();  }    @override  Widget build(BuildContext context) {    return Scaffold(      appBar: AppBar(        title: const Text('Yandex Mapkit Demo'),        actions: [          IconButton(            onPressed: () async {              _polygonPointsList = await Navigator.push(                context,                MaterialPageRoute(                  builder: (context) => const SettingsScreen(),                ),              );              setState(() {});            },            icon: const Icon(              Icons.settings_outlined,              color: Colors.white,            ),          ),        ],      ),      body: YandexMap(        onMapCreated: (controller) async {          _mapController = controller;          await _initLocationLayer();        },        onCameraPositionChanged: (cameraPosition, _, __) {          setState(() {            _mapZoom = cameraPosition.zoom;          });        },        mapObjects: [          _getClusterizedCollection(            placemarks: _getPlacemarkObjects(context),          ),          _getPolygonMapObject(context, points: _polygonPointsList ?? []),        ],        onUserLocationAdded: (view) async {          \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f          _userLocation = await _mapController.getUserCameraPosition();          \/\/ \u0435\u0441\u043b\u0438 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438          if (_userLocation != null) {            await _mapController.moveCamera(              CameraUpdate.newCameraPosition(                _userLocation!.copyWith(zoom: 10),              ),              animation: const MapAnimation(                type: MapAnimationType.linear,                duration: 0.3,              ),            );          }          \/\/ \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043c\u0430\u0440\u043a\u0435\u0440\u0430 - \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u043c          return view.copyWith(            pin: view.pin.copyWith(              opacity: 1,            ),          );        },      ),    );  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432  ClusterizedPlacemarkCollection _getClusterizedCollection({    required List&lt;PlacemarkMapObject> placemarks,  }) {    return ClusterizedPlacemarkCollection(        mapId: const MapObjectId('clusterized-1'),        placemarks: placemarks,        radius: 50,        minZoom: 15,        onClusterAdded: (self, cluster) async {          return cluster.copyWith(            appearance: cluster.appearance.copyWith(              opacity: 1.0,              icon: PlacemarkIcon.single(                PlacemarkIconStyle(                  image: BitmapDescriptor.fromBytes(                    await ClusterIconPainter(cluster.size)                        .getClusterIconBytes(),                  ),                ),              ),            ),          );        },        onClusterTap: (self, cluster) async {          await _mapController.moveCamera(            animation: const MapAnimation(                type: MapAnimationType.linear, duration: 0.3),            CameraUpdate.newCameraPosition(              CameraPosition(                target: cluster.placemarks.first.point,                zoom: _mapZoom + 1,              ),            ),          );        });  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  \/\/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f  \/\/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f - \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435  Future&lt;void> _initLocationLayer() async {    final locationPermissionIsGranted =        await Permission.location.request().isGranted;      if (locationPermissionIsGranted) {      await _mapController.toggleUserLayer(visible: true);    } else {      WidgetsBinding.instance.addPostFrameCallback((_) {        ScaffoldMessenger.of(context).showSnackBar(          const SnackBar(            content: Text('\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f'),          ),        );      });    }  } }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;MapPoint> _getMapPoints() {  return const [    MapPoint(name: '\u041c\u043e\u0441\u043a\u0432\u0430', latitude: 55.755864, longitude: 37.617698),    MapPoint(name: '\u041b\u043e\u043d\u0434\u043e\u043d', latitude: 51.507351, longitude: -0.127696),    MapPoint(name: '\u0420\u0438\u043c', latitude: 41.887064, longitude: 12.504809),    MapPoint(name: '\u041f\u0430\u0440\u0438\u0436', latitude: 48.856663, longitude: 2.351556),    MapPoint(name: '\u0421\u0442\u043e\u043a\u0433\u043e\u043b\u044c\u043c', latitude: 59.347360, longitude: 18.341573),  ]; }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;PlacemarkMapObject> _getPlacemarkObjects(BuildContext context) {  return _getMapPoints()      .map(        (point) => PlacemarkMapObject(          mapId: MapObjectId('MapObject $point'),          point: Point(latitude: point.latitude, longitude: point.longitude),          opacity: 1,          icon: PlacemarkIcon.single(            PlacemarkIconStyle(              image: BitmapDescriptor.fromAssetImage(                'assets\/icons\/map_point.png',              ),              scale: 2,            ),          ),          onTap: (_, __) => showModalBottomSheet(            context: context,            builder: (context) => _ModalBodyView(              point: point,            ),          ),        ),      )      .toList(); }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u044b \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 PolygonMapObject _getPolygonMapObject(  BuildContext context, {  required List&lt;Point> points, }) {  return PolygonMapObject(    mapId: const MapObjectId('polygon map object'),    polygon: Polygon(      \/\/ \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u043b\u0438\u043d\u0438\u044f \u0437\u043e\u043d\u044b      outerRing: LinearRing(        points: points,      ),      \/\/ \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u043b\u0438\u043d\u0438\u044f \u0437\u043e\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0435      innerRings: const [],    ),    strokeColor: Colors.blue,    strokeWidth: 3.0,    fillColor: Colors.blue.withOpacity(0.2),    onTap: (_, point) => showModalBottomSheet(      context: context,      builder: (context) => _ModalBodyView(        point: MapPoint(          name: '\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442',          latitude: point.latitude,          longitude: point.longitude,        ),      ),    ),  ); }   \/\/\/ \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0438\u0306 \u043e \u0442\u043e\u0447\u043a\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 class _ModalBodyView extends StatelessWidget {  const _ModalBodyView({required this.point});    final MapPoint point;    @override  Widget build(BuildContext context) {    return Padding(      padding: const EdgeInsets.symmetric(vertical: 40),      child: Column(        mainAxisSize: MainAxisSize.min,        children: [          Text(point.name, style: const TextStyle(fontSize: 20)),          const SizedBox(height: 20),          Text(            '${point.latitude}, ${point.longitude}',            style: const TextStyle(              fontSize: 16,              color: Colors.grey,            ),          ),        ],      ),    );  } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ba\/738\/bf5\/1ba738bf5db1550aa270ca406fe45666.gif\" width=\"1111\" height=\"623\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ba\/738\/bf5\/1ba738bf5db1550aa270ca406fe45666.gif\"\/><\/figure>\n<h2>\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u0410 \u0434\u043e \u0442\u043e\u0447\u043a\u0438 \u0411  <\/h2>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432 YandexMapkit \u2014 \u043f\u043e\u0438\u0441\u043a \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u2014 \u0442\u043e\u0447\u043a\u0443 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u0442\u043e\u0447\u043a\u0443 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430. \u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0439\u0442\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u0430\u0440\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u2014 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>onMapLongTap<\/code> \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0435 YandexMap.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <em>map_screen.dart<\/em> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u043f\u0438\u0441\u043a\u0430 <code>_drivingPointsList<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430, \u0435\u0441\u043b\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u0432\u0443\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u044d\u0442\u0443 \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 <code>onMapLongTap<\/code>:<\/p>\n<pre><code class=\"dart\">onMapLongTap: (argument) {          setState(() {            \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u0435\u0441\u043b\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438            if (_drivingPointsList.length &lt; 2) {              _drivingPointsList.add(argument);            } else {              _drivingPointsList = [];            }          });        },<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0431\u044b\u043b\u0438 \u0432\u0438\u0434\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 <code>_getDrivingPlacemarks()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 (<a href=\"https:\/\/habr.com\/ru\/companies\/friflex\/articles\/769662\/\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/a>):<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0447\u0435\u043a \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 List&lt;PlacemarkMapObject> _getDrivingPlacemarks(  BuildContext context, {  required List&lt;Point> drivingPoints, }) {  return drivingPoints      .map(        (point) => PlacemarkMapObject(          mapId: MapObjectId('MapObject $point'),          point: Point(latitude: point.latitude, longitude: point.longitude),          opacity: 1,          icon: PlacemarkIcon.single(            PlacemarkIconStyle(              image: BitmapDescriptor.fromAssetImage(                'assets\/icons\/car_point.png',              ),              scale: 2,            ),          ),        ),      )      .toList(); }<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u0430\u0440\u0442\u044b:<\/p>\n<pre><code class=\"dart\">mapObjects: [          _getClusterizedCollection(            placemarks: _getPlacemarkObjects(context),          ),          _getPolygonMapObject(context, points: _polygonPointsList ?? []),          ..._getDrivingPlacemarks(context, drivingPoints: _drivingPointsList),        ],<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c nullable \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>_drivingResultWithSession<\/code> \u0442\u0438\u043f\u0430 <code>DrivingResultWithSession<\/code>. \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0432\u0441\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 <code>_getDrivingResultWithSession()<\/code> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c:<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043f\u0440\u043e\u0435\u0437\u0434\u0430 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u043a \u0442\u043e\u0447\u043a\u0435 \u043a\u043e\u043d\u0446\u0430 DrivingResultWithSession _getDrivingResultWithSession({  required Point startPoint,  required Point endPoint, }) {  var drivingResultWithSession = YandexDriving.requestRoutes(    points: [      RequestPoint(        point: startPoint,        requestPointType: RequestPointType.wayPoint, \/\/ \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430      ),      RequestPoint(        point: endPoint,        requestPointType: RequestPointType.wayPoint, \/\/ \u0442\u043e\u0447\u043a\u0430 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430      ),    ],    drivingOptions: const DrivingOptions(      initialAzimuth: 0,      routesCount: 5,      avoidTolls: true,      avoidPoorConditions: true,    ),  );    return drivingResultWithSession; }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 YandexDriving \u0438 \u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>requestRoutes()<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u0445 \u043f\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0442\u043e\u0447\u043a\u0430\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u0435\u043a \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 (\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u0438\u0445 \u0442\u0438\u043f <code>RequestPointType.wayPoint<\/code>). \u041f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a (\u0442\u0438\u043f <code>RequestPointType.viaPoint<\/code>).\u00a0<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 DrivingOptions \u2014\u00a0\u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u0440\u043e\u0436\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f.<\/p>\n<p>\u0412\u044b\u0437\u043e\u0432\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>_getDrivingResultWithSession()<\/code> \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0432 <code>onMapLongTap<\/code>:<\/p>\n<pre><code class=\"dart\">onMapLongTap: (argument) {          setState(() {            \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u0435\u0441\u043b\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438            if (_drivingPointsList.length &lt; 2) {              _drivingPointsList.add(argument);            } else {              _drivingPointsList = [];              _drivingResultWithSession = null;            }              \/\/ \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430,            \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432            if (_drivingPointsList.length == 2) {              _drivingResultWithSession = _getDrivingResultWithSession(                startPoint: _drivingPointsList.first,                endPoint: _drivingPointsList.last,              );            }          });        },<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u044b <code>PolylineMapObject<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043b\u0438\u043d\u0438\u044e, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u043f\u043e \u043d\u0430\u0431\u043e\u0440\u0443 \u0442\u043e\u0447\u0435\u043a \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442.\u00a0<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043b\u0438\u043d\u0438\u0439 <code>_drivingMapLines<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0435\u0433\u043e \u0432 <code>mapObjects<\/code> \u0432\u0438\u0434\u0436\u0435\u0442\u0430 YandexMap:<\/p>\n<pre><code class=\"dart\">mapObjects: [          _getClusterizedCollection(            placemarks: _getPlacemarkObjects(context),          ),          _getPolygonMapObject(context, points: _polygonPointsList ?? []),          ..._getDrivingPlacemarks(context, drivingPoints: _drivingPointsList),          ..._drivingMapLines,        ],<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 <code>_buildRoutes()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043b\u0438\u043d\u0438\u0438 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a <code>_drivingMapLines<\/code>:<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0443  Future&lt;void> _buildRoutes() async {    final drivingResult = await _drivingResultWithSession?.result;      setState(() {      for (var element in drivingResult?.routes ?? []) {        _drivingMapLines.add(          PolylineMapObject(            mapId: MapObjectId('route $element'),            polyline: Polyline(points: element.geometry),            strokeColor:                \/\/ \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430                Colors.primaries[Random().nextInt(Colors.primaries.length)],            strokeWidth: 3,          ),        );      }    });  }<\/code><\/pre>\n<p>\u0412\u044b\u0437\u043e\u0432\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0446\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>onMapLongTap<\/code>:<\/p>\n<pre><code class=\"dart\">onMapLongTap: (argument) {          setState(() {            \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u0435\u0441\u043b\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438            if (_drivingPointsList.length &lt; 2) {              _drivingPointsList.add(argument);            } else {              _drivingPointsList = [];              _drivingMapLines = [];              _drivingResultWithSession = null;            }              \/\/ \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430,            \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432            if (_drivingPointsList.length == 2) {              _drivingResultWithSession = _getDrivingResultWithSession(                startPoint: _drivingPointsList.first,                endPoint: _drivingPointsList.last,              );            }          });            _buildRoutes();        },<\/code><\/pre>\n<p>\u00a0\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u0444\u0430\u0439\u043b\u0430 <em>map_screen.dart<\/em>:<\/p>\n<details class=\"spoiler\">\n<summary>map_screen.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">import 'dart:math';   import 'package:flutter\/material.dart'; import 'package:permission_handler\/permission_handler.dart'; import 'package:yandex_mapkit\/yandex_mapkit.dart'; import 'package:yandex_mapkit_demo\/data\/map_point.dart'; import 'package:yandex_mapkit_demo\/presentation\/clusterized_icon_painter.dart'; import 'package:yandex_mapkit_demo\/presentation\/settings_screen.dart';   class MapScreen extends StatefulWidget {  const MapScreen({super.key});    @override  State&lt;MapScreen> createState() => _MapScreenState(); }   class _MapScreenState extends State&lt;MapScreen> {  \/\/\/ \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0430\u043c\u0438  late final YandexMapController _mapController;    \/\/\/ \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u043a\u0430\u0440\u0442\u044b  var _mapZoom = 0.0;    \/\/\/ \u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f  CameraPosition? _userLocation;    \/\/\/ \u0421\u043f\u0438\u0441\u043e\u043a \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c  List&lt;Point>? _polygonPointsList;    \/\/\/ \u0421\u043f\u0438\u0441\u043e\u043a \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442  List&lt;Point> _drivingPointsList = [];    \/\/\/ \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  DrivingResultWithSession? _drivingResultWithSession;    \/\/\/ \u0421\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043b\u0438\u043d\u0438\u0439 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b  List&lt;PolylineMapObject> _drivingMapLines = [];    @override  void dispose() {    _mapController.dispose();    _drivingResultWithSession?.session.close();    super.dispose();  }    @override  Widget build(BuildContext context) {    return Scaffold(      appBar: AppBar(        title: const Text('Yandex Mapkit Demo'),        actions: [          IconButton(            onPressed: () async {              _polygonPointsList = await Navigator.push(                context,                MaterialPageRoute(                  builder: (context) => const SettingsScreen(),                ),              );              setState(() {});            },            icon: const Icon(              Icons.settings_outlined,              color: Colors.white,            ),          ),        ],      ),      body: YandexMap(        onMapCreated: (controller) async {          _mapController = controller;          await _initLocationLayer();        },        onCameraPositionChanged: (cameraPosition, _, __) {          setState(() {            _mapZoom = cameraPosition.zoom;          });        },        onMapLongTap: (argument) {          setState(() {            \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u0435\u0441\u043b\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0434\u0432\u0435 \u0442\u043e\u0447\u043a\u0438            if (_drivingPointsList.length &lt; 2) {              _drivingPointsList.add(argument);            } else {              _drivingPointsList = [];              _drivingMapLines = [];              _drivingResultWithSession = null;            }              \/\/ \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430,            \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432            if (_drivingPointsList.length == 2) {              _drivingResultWithSession = _getDrivingResultWithSession(                startPoint: _drivingPointsList.first,                endPoint: _drivingPointsList.last,              );            }          });            _buildRoutes();        },        mapObjects: [          _getClusterizedCollection(            placemarks: _getPlacemarkObjects(context),          ),          _getPolygonMapObject(context, points: _polygonPointsList ?? []),          ..._getDrivingPlacemarks(context, drivingPoints: _drivingPointsList),          ..._drivingMapLines,        ],        onUserLocationAdded: (view) async {          \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f          _userLocation = await _mapController.getUserCameraPosition();          \/\/ \u0435\u0441\u043b\u0438 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e, \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u0440\u0442\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438          if (_userLocation != null) {            await _mapController.moveCamera(              CameraUpdate.newCameraPosition(                _userLocation!.copyWith(zoom: 10),              ),              animation: const MapAnimation(                type: MapAnimationType.linear,                duration: 0.3,              ),            );          }          \/\/ \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u0434 \u043c\u0430\u0440\u043a\u0435\u0440\u0430 - \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u043c          return view.copyWith(            pin: view.pin.copyWith(              opacity: 1,            ),          );        },      ),    );  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432  ClusterizedPlacemarkCollection _getClusterizedCollection({    required List&lt;PlacemarkMapObject> placemarks,  }) {    return ClusterizedPlacemarkCollection(        mapId: const MapObjectId('clusterized-1'),        placemarks: placemarks,        radius: 50,        minZoom: 15,        onClusterAdded: (self, cluster) async {          return cluster.copyWith(            appearance: cluster.appearance.copyWith(              opacity: 1.0,              icon: PlacemarkIcon.single(                PlacemarkIconStyle(                  image: BitmapDescriptor.fromBytes(                    await ClusterIconPainter(cluster.size)                        .getClusterIconBytes(),                  ),                ),              ),            ),          );        },        onClusterTap: (self, cluster) async {          await _mapController.moveCamera(            animation: const MapAnimation(                type: MapAnimationType.linear, duration: 0.3),            CameraUpdate.newCameraPosition(              CameraPosition(                target: cluster.placemarks.first.point,                zoom: _mapZoom + 1,              ),            ),          );        });  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  \/\/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f  \/\/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f - \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435  Future&lt;void> _initLocationLayer() async {    final locationPermissionIsGranted =        await Permission.location.request().isGranted;      if (locationPermissionIsGranted) {      await _mapController.toggleUserLayer(visible: true);    } else {      WidgetsBinding.instance.addPostFrameCallback((_) {        ScaffoldMessenger.of(context).showSnackBar(          const SnackBar(            content: Text('\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f'),          ),        );      });    }  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0443  Future&lt;void> _buildRoutes() async {    final drivingResult = await _drivingResultWithSession?.result;      setState(() {      for (var element in drivingResult?.routes ?? []) {        _drivingMapLines.add(          PolylineMapObject(            mapId: MapObjectId('route $element'),            polyline: Polyline(points: element.geometry),            strokeColor:                \/\/ \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430                Colors.primaries[Random().nextInt(Colors.primaries.length)],            strokeWidth: 3,          ),        );      }    });  } }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;MapPoint> _getMapPoints() {  return const [    MapPoint(name: '\u041c\u043e\u0441\u043a\u0432\u0430', latitude: 55.755864, longitude: 37.617698),    MapPoint(name: '\u041b\u043e\u043d\u0434\u043e\u043d', latitude: 51.507351, longitude: -0.127696),    MapPoint(name: '\u0420\u0438\u043c', latitude: 41.887064, longitude: 12.504809),    MapPoint(name: '\u041f\u0430\u0440\u0438\u0436', latitude: 48.856663, longitude: 2.351556),    MapPoint(name: '\u0421\u0442\u043e\u043a\u0433\u043e\u043b\u044c\u043c', latitude: 59.347360, longitude: 18.341573),  ]; }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;PlacemarkMapObject> _getPlacemarkObjects(BuildContext context) {  return _getMapPoints()      .map(        (point) => PlacemarkMapObject(          mapId: MapObjectId('MapObject $point'),          point: Point(latitude: point.latitude, longitude: point.longitude),          opacity: 1,          icon: PlacemarkIcon.single(            PlacemarkIconStyle(              image: BitmapDescriptor.fromAssetImage(                'assets\/icons\/map_point.png',              ),              scale: 2,            ),          ),          onTap: (_, __) => showModalBottomSheet(            context: context,            builder: (context) => _ModalBodyView(              point: point,            ),          ),        ),      )      .toList(); }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0447\u0435\u043a \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 List&lt;PlacemarkMapObject> _getDrivingPlacemarks(  BuildContext context, {  required List&lt;Point> drivingPoints, }) {  return drivingPoints      .map(        (point) => PlacemarkMapObject(          mapId: MapObjectId('MapObject $point'),          point: Point(latitude: point.latitude, longitude: point.longitude),          opacity: 1,          icon: PlacemarkIcon.single(            PlacemarkIconStyle(              image: BitmapDescriptor.fromAssetImage(                'assets\/icons\/car_point.png',              ),              scale: 2,            ),          ),        ),      )      .toList(); }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u044b \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 PolygonMapObject _getPolygonMapObject(  BuildContext context, {  required List&lt;Point> points, }) {  return PolygonMapObject(    mapId: const MapObjectId('polygon map object'),    polygon: Polygon(      \/\/ \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u043b\u0438\u043d\u0438\u044f \u0437\u043e\u043d\u044b      outerRing: LinearRing(        points: points,      ),      \/\/ \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u043b\u0438\u043d\u0438\u044f \u0437\u043e\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0438 \u0432 \u043f\u043e\u043b\u0438\u0433\u043e\u043d\u0435      innerRings: const [],    ),    strokeColor: Colors.blue,    strokeWidth: 3.0,    fillColor: Colors.blue.withOpacity(0.2),    onTap: (_, point) => showModalBottomSheet(      context: context,      builder: (context) => _ModalBodyView(        point: MapPoint(          name: '\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442',          latitude: point.latitude,          longitude: point.longitude,        ),      ),    ),  ); }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043f\u0440\u043e\u0435\u0437\u0434\u0430 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u043a \u0442\u043e\u0447\u043a\u0435 \u043a\u043e\u043d\u0446\u0430 DrivingResultWithSession _getDrivingResultWithSession({  required Point startPoint,  required Point endPoint, }) {  var drivingResultWithSession = YandexDriving.requestRoutes(    points: [      RequestPoint(        point: startPoint,        requestPointType: RequestPointType.wayPoint, \/\/ \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430      ),      RequestPoint(        point: endPoint,        requestPointType: RequestPointType.wayPoint, \/\/ \u0442\u043e\u0447\u043a\u0430 \u043a\u043e\u043d\u0446\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430      ),    ],    drivingOptions: const DrivingOptions(      initialAzimuth: 0,      routesCount: 5,      avoidTolls: true,      avoidPoorConditions: true,    ),  );    return drivingResultWithSession; }   \/\/\/ \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0438\u0306 \u043e \u0442\u043e\u0447\u043a\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 class _ModalBodyView extends StatelessWidget {  const _ModalBodyView({required this.point});    final MapPoint point;    @override  Widget build(BuildContext context) {    return Padding(      padding: const EdgeInsets.symmetric(vertical: 40),      child: Column(        mainAxisSize: MainAxisSize.min,        children: [          Text(point.name, style: const TextStyle(fontSize: 20)),          const SizedBox(height: 20),          Text(            '${point.latitude}, ${point.longitude}',            style: const TextStyle(              fontSize: 16,              color: Colors.grey,            ),          ),        ],      ),    );  } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/828\/12e\/9d9\/82812e9d90c6266a8fc11e0fb52b8201.gif\" width=\"1312\" height=\"730\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/828\/12e\/9d9\/82812e9d90c6266a8fc11e0fb52b8201.gif\"\/><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u043e\u043d \u0438 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043d\u0430 \u043d\u0438\u0445 \u043e\u0442\u0432\u0435\u0447\u0443 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445: <a href=\"https:\/\/github.com\/akhlestova\/flutter_yandex_mapkit_example\"><u>\u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/a>.<\/p>\n<p>\u041f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0431 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u042f\u043d\u0434\u0435\u043a\u0441 \u041a\u0430\u0440\u0442 \u0432\u043e Flutter \u043c\u043e\u0436\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0443 \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u2014 <a href=\"https:\/\/habr.com\/ru\/companies\/friflex\/articles\/715940\/\">\u041a\u0430\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u042f\u043d\u0434\u0435\u043a\u0441 \u041a\u0430\u0440\u0442\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Flutter<\/a>.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0442\u0435\u043c\u0435 \u0432 <a href=\"https:\/\/t.me\/mapkit\"><u>Telegram-\u0447\u0430\u0442\u0435<\/u><\/a> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e yandex_mapkit.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/770200\/\"> https:\/\/habr.com\/ru\/articles\/770200\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 <\/em><a href=\"https:\/\/habr.com\/ru\/users\/aakhlestova\/\"><em>\u0410\u043d\u043d\u0430 \u0410\u0445\u043b\u0451\u0441\u0442\u043e\u0432\u0430<\/em><\/a><em>, \u044f Flutter-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 <\/em><a href=\"https:\/\/friflex.com\/\"><em><u>Friflex<\/u><\/em><\/a><em>. \u0412 <\/em><a href=\"https:\/\/habr.com\/ru\/companies\/friflex\/articles\/769662\/\"><em><u>\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438<\/u><\/em><\/a><em> \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b Yandex Mapkit \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 Flutter. \u041c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043d\u0438\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u043f\u0440\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u0430\u0440\u0442\u044b.<\/em><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0437\u043e\u043d\u044b \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u0438 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0440\u043e\u0436\u043d\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u0410 \u0434\u043e \u0442\u043e\u0447\u043a\u0438 \u0411 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Yandex MapKit.<\/p>\n<p>\u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 MapScreen:<\/p>\n<details class=\"spoiler\">\n<summary>\u0444\u0430\u0439\u043b map_screen.dart<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"dart\">import 'package:flutter\/material.dart'; import 'package:yandex_mapkit\/yandex_mapkit.dart'; import 'package:yandex_mapkit_demo\/data\/map_point.dart'; import 'package:yandex_mapkit_demo\/presentation\/clusterized_icon_painter.dart';   class MapScreen extends StatefulWidget {  const MapScreen({super.key});    @override  State&lt;MapScreen> createState() => _MapScreenState(); }   class _MapScreenState extends State&lt;MapScreen> {  late final YandexMapController _mapController;  var _mapZoom = 0.0;    @override  void dispose() {    _mapController.dispose();    super.dispose();  }    @override  Widget build(BuildContext context) {    return Scaffold(      appBar: AppBar(title: const Text('Yandex Mapkit Demo')),      body: YandexMap(        onMapCreated: (controller) async {          _mapController = controller;          \/\/ \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u043c \u0432\u0438\u0434 \u043a\u0430\u0440\u0442\u044b \u0431\u043b\u0438\u0436\u0435 \u043a \u0415\u0432\u0440\u043e\u043f\u0435          await _mapController.moveCamera(            CameraUpdate.newCameraPosition(              const CameraPosition(                target: Point(                  latitude: 50,                  longitude: 20,                ),                zoom: 3,              ),            ),          );        },        onCameraPositionChanged: (cameraPosition, _, __) {          setState(() {            _mapZoom = cameraPosition.zoom;          });        },        mapObjects: [          _getClusterizedCollection(            placemarks: _getPlacemarkObjects(context),          ),        ],      ),    );  }    \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432  ClusterizedPlacemarkCollection _getClusterizedCollection({    required List&lt;PlacemarkMapObject> placemarks,  }) {    return ClusterizedPlacemarkCollection(        mapId: const MapObjectId('clusterized-1'),        placemarks: placemarks,        radius: 50,        minZoom: 15,        onClusterAdded: (self, cluster) async {          return cluster.copyWith(            appearance: cluster.appearance.copyWith(              opacity: 1.0,              icon: PlacemarkIcon.single(                PlacemarkIconStyle(                  image: BitmapDescriptor.fromBytes(                    await ClusterIconPainter(cluster.size)                        .getClusterIconBytes(),                  ),                ),              ),            ),          );        },        onClusterTap: (self, cluster) async {          await _mapController.moveCamera(            animation: const MapAnimation(                type: MapAnimationType.linear, duration: 0.3),            CameraUpdate.newCameraPosition(              CameraPosition(                target: cluster.placemarks.first.point,                zoom: _mapZoom + 1,              ),            ),          );        });  } }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;MapPoint> _getMapPoints() {  return const [    MapPoint(name: '\u041c\u043e\u0441\u043a\u0432\u0430', latitude: 55.755864, longitude: 37.617698),    MapPoint(name: '\u041b\u043e\u043d\u0434\u043e\u043d', latitude: 51.507351, longitude: -0.127696),    MapPoint(name: '\u0420\u0438\u043c', latitude: 41.887064, longitude: 12.504809),    MapPoint(name: '\u041f\u0430\u0440\u0438\u0436', latitude: 48.856663, longitude: 2.351556),    MapPoint(name: '\u0421\u0442\u043e\u043a\u0433\u043e\u043b\u044c\u043c', latitude: 59.347360, longitude: 18.341573),  ]; }   \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 List&lt;PlacemarkMapObject> _getPlacemarkObjects(BuildContext context) {  return _getMapPoints()      .map(        (point) => PlacemarkMapObject(          mapId: MapObjectId('MapObject $point'),          point: Point(latitude: point.latitude, longitude: point.longitude),          opacity: 1,          icon: PlacemarkIcon.single(            PlacemarkIconStyle(              image: BitmapDescriptor.fromAssetImage(                'assets\/icons\/map_point.png',              ),              scale: 2,            ),          ),          onTap: (_, __) => showModalBottomSheet(            context: context,            builder: (context) => _ModalBodyView(              point: point,            ),          ),        ),      )      .toList(); }   \/\/\/ \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0438\u0306 \u043e \u0442\u043e\u0447\u043a\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 class _ModalBodyView extends StatelessWidget {  const _ModalBodyView({required this.point});    final MapPoint point;    @override  Widget build(BuildContext context) {    return Padding(      padding: const EdgeInsets.symmetric(vertical: 40),      child: Column(        mainAxisSize: MainAxisSize.min,        children: [          Text(point.name, style: const TextStyle(fontSize: 20)),          const SizedBox(height: 20),          Text(            '${point.latitude}, ${point.longitude}',            style: const TextStyle(              fontSize: 16,              color: Colors.grey,            ),          ),        ],      ),    );  } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u0430, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u0447\u043a\u043e\u0439.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u043d\u043e \u0438 \u0433\u0434\u0435-\u043b\u0438\u0431\u043e \u0435\u0449\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0433\u043e\u0440\u043e\u0434\u0430), \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438. \u041e\u0434\u043d\u0438 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u2014 <a href=\"https:\/\/pub.dev\/packages\/geolocator\"><u>geolocator<\/u><\/a> \u0438 <a href=\"https:\/\/pub.dev\/packages\/location\"><u>location<\/u><\/a>. \u042d\u0442\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 GPS \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0441\u0442\u0430\u0442\u0443\u0441\u044b.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u043a\u0430\u0440\u0442\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>YandexMap \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442 \u043d\u0430 \u0441\u043b\u043e\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u043b\u043e\u0439 \u2014 \u0442\u043e\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u0430\u0440\u0442\u044b (\u043c\u0430\u0440\u043a\u0435\u0440\u044b, \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b, \u0437\u043e\u043d\u044b \u0438 \u0442.\u0434.). \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u043e\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<p>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u044f \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043a\u0430\u0440\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430 \u200b\u200b<code>toggleUserLayer()<\/code>. \u0427\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043b\u043e\u0439, \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 visible \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>true<\/code>, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u2014\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, <code>false<\/code>.<\/p>\n<p>\u0422.\u043a. \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043b\u0430\u0433\u0438\u043d \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u2014 <a href=\"https:\/\/pub.dev\/packages\/permission_handler\"><u>permission_handler<\/u><\/a>.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430 Android \u0432 \u0444\u0430\u0439\u043b\u0435 <em>AndroidManifest.xml<\/em>:\u00a0<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"xml\">&lt;uses-permission android:name=\"android.permission.INTERNET\" \/> &lt;uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" \/><\/code><\/pre>\n<ul>\n<li>\n<p>\u043d\u0430 IOS \u0432 \u0444\u0430\u0439\u043b\u0435 <em>Info.plist<\/em>:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"xml\">&lt;key>NSLocationWhenInUseUsageDescription&lt;\/key> &lt;string>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0433\u0435\u043e\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u0438&lt;\/string><\/code><\/pre>\n<ul>\n<li>\n<p>\u0442\u0430\u043a\u0436\u0435 \u043d\u0430 IOS \u0432 \u0444\u0430\u0439\u043b\u0435 <em>Podfile<\/em>:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"ruby\">post_install do |installer|  installer.pods_project.targets.each do |target|    flutter_additional_ios_build_settings(target)    target.build_configurations.each do |config|      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [        '$(inherited)',        'PERMISSION_LOCATION=1',      ]    end  end end<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>permission_handler<\/code> \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u0432\u044b\u0437\u0432\u0430\u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>Permission.location.request()<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u0435\u0440\u043d\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0431\u0430 \u043a\u0435\u0439\u0441\u0430 \u2014 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0430\u043b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0434\u0430\u043d\u043e, \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043e \u2014 \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0444\u0430\u0439\u043b <em>map_screen.dart<\/em> \u043c\u0435\u0442\u043e\u0434 <code>_initLocationLayer()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443:<\/p>\n<pre><code class=\"dart\">\/\/\/ \u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435  \/\/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f  \/\/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f - \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435  Future&lt;void> _initLocationLayer() async {    final locationPermissionIsGranted =        await Permission.location.request().isGranted;      if (locationPermissionIsGranted) {      await _mapController.toggleUserLayer(visible: true);    } else {      WidgetsBinding.instance.addPostFrameCallback((_) {        ScaffoldMessenger.of(context).showSnackBar(          const SnackBar(            content: Text('\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f'),          ),        );      });    }  }<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0435\u043e\u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u043b\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0432\u044b\u0437\u043e\u0432\u0435\u043c \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>onMapCreated<\/code> \u0432\u0438\u0434\u0436\u0435\u0442\u0430 YandexMap \u0432 \u0444\u0430\u0439\u043b\u0435 <em>map_screen.dart<\/em>:<\/p>\n<pre><code class=\"dart\">onMapCreated: (controller) async {          _mapController = controller;          await _initLocationLayer();        },<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0441\u043b\u043e\u0439 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0443 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 YandexMap \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>onUserLocationAdded<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c nullable \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>_userLocation<\/code> \u0442\u0438\u043f\u0430 CameraPosition. \u0417\u0430\u0442\u0435\u043c \u0432 <code>onUserLocationAdded<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>getUserCameraPosition()<\/code> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>_userLocation<\/code> \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-358604","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/358604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=358604"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/358604\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=358604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=358604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=358604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}