{"id":338646,"date":"2022-09-22T15:01:06","date_gmt":"2022-09-22T15:01:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=338646"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=338646","title":{"rendered":"<span>\u0412\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043e\u043a\u043d\u0430 \u043d\u0430 \u0444\u043b\u0430\u0442\u0442\u0435\u0440 \u043a\u0430\u0440\u0442\u0435 \u0438\u043b\u0438 flutter_map_marker_popup<\/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<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<\/p>\n<p>\u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c \u043c\u043d\u0435 \u043a\u0430\u043a-\u0442\u043e \u043a\u0430\u0440\u0442\u0430 \u0432\u043e \u0444\u043b\u0430\u0442\u0442\u0435\u0440-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0413\u0443\u0433\u043b \u0438 \u042f\u043d\u0434\u0435\u043a\u0441 \u043a\u0430\u0440\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f OSM. \u041a\u0430\u0440\u0442\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043c\u0430\u0440\u043a\u0435\u0440 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435. \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0448\u0435\u043b \u043f\u043b\u0430\u0433\u0438\u043d flutter_map_marker_popup.<\/p>\n<h2>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d<\/h2>\n<p> \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f:<\/p>\n<pre><code class=\"yaml\">dependencies:   flutter:     sdk: flutter   flutter_map: any   latlong2: any   flutter_map_marker_popup: any <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u0430\u0440\u0442\u0443 Flutter_map. \u0418\u0437 \u0432\u0430\u0436\u043d\u043e\u0433\u043e \u0442\u0443\u0442 &#8212; urlTemplate, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 OSM. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 MapOptions \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0438\u0437\u0432\u043d\u0435.<\/p>\n<pre><code class=\"dart\">class MapPage extends StatefulWidget {   MapPage({super.key, required this.center, double? zoom}){     this.zoom = zoom ?? 9.0;   }    final LatLng center;   late final double zoom;    @override   State&lt;MapPage> createState() => _MapPageState(); }  class _MapPageState extends State&lt;MapPage> {    final urlTemplate = 'https:\/\/tile.openstreetmap.org\/{z}\/{x}\/{y}.png';    @override   Widget build(BuildContext context) {     return Scaffold(       appBar: AppBar(         title: Text(\"Map page\"),       ),       body: FlutterMap(         mapController: MapController(),         options: MapOptions(           center: widget.center,           zoom: widget.zoom,         ),         children: [           TileLayer(             urlTemplate: urlTemplate,           ),         ],       ),     );   } } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e \u0434\u043e\u043b\u0433\u043e\u043c\u0443 \u043d\u0430\u0436\u0430\u0442\u0438\u044e, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u0440\u043a\u0435\u0440 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0440\u043a\u0435\u0440 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0435\u0435 \u0432 MapOptions <code>onLongPress: addMarker.<\/code><\/p>\n<pre><code class=\"dart\"> final List&lt;Marker> _markers = [];    addMarker(tapPosition, point){     _markers.add(Marker(       point: point,       builder: (c) => const Icon(Icons.location_on, size: 40),       width: 40,       height: 40,));   } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u0438 \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u043e\u044f <code>MarkerLayer(markers: _markers)<\/code>, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043f\u043e \u043d\u0438\u043c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0447\u0442\u043e-\u043b\u0438\u0431\u043e. \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 flutter_map_marker_popup \u0435\u0441\u0442\u044c <code>PopupMarkerLayerWidget<\/code>. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439:<\/p>\n<pre><code class=\"dart\">PopupMarkerLayerWidget(   options: PopupMarkerLayerOptions(     popupController: _popupLayerController,     markers: _markers,     markerRotateAlignment:     PopupMarkerLayerOptions.rotationAlignmentFor(AnchorAlign.top),     popupBuilder: (BuildContext context, Marker marker) =>         ExamplePopup(marker),   ), ), <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043c\u0430\u0440\u043a\u0435\u0440\u044b, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043f\u0430\u043f\u0430. <code>ExamplePopup<\/code> &#8212; \u044d\u0442\u043e \u0432\u0438\u0434\u0436\u0435\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043c\u0430\u0440\u043a\u0435\u0440. \u0412 \u043d\u0435\u043c \u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043e\u043a\u043d\u0430.<\/p>\n<pre><code class=\"dart\">class ExamplePopup extends StatefulWidget {   final Marker marker;    const ExamplePopup(this.marker, {Key? key}) : super(key: key);    @override   State&lt;StatefulWidget> createState() => _ExamplePopupState(); }  class _ExamplePopupState extends State&lt;ExamplePopup> {   int _currentIcon = 0;    @override   Widget build(BuildContext context) {     return Card(       child: InkWell(         onTap: () => setState(() {           _currentIcon = (_currentIcon + 1) % 4;         }),         child: Row(           mainAxisSize: MainAxisSize.min,           children: &lt;Widget>[             Padding(               padding: const EdgeInsets.only(left: 20, right: 10),               child: Image.asset('assets\/${_currentIcon+1}.png', width: 40, height: 40,),             ),             _cardDescription(context),           ],         ),       ),     );   }    Widget _cardDescription(BuildContext context) {     return Padding(       padding: const EdgeInsets.all(10),       child: Container(         constraints: const BoxConstraints(minWidth: 100, maxWidth: 200),         child: Column(           crossAxisAlignment: CrossAxisAlignment.start,           mainAxisAlignment: MainAxisAlignment.start,           mainAxisSize: MainAxisSize.min,           children: &lt;Widget>[             const Text(               'Popup for a marker!',               overflow: TextOverflow.fade,               softWrap: false,               style: TextStyle(                 fontWeight: FontWeight.w500,                 fontSize: 14.0,               ),             ),             const Padding(padding: EdgeInsets.symmetric(vertical: 4.0)),             Text(               'Position: ${widget.marker.point.latitude}, ${widget.marker.point.longitude}',               style: const TextStyle(fontSize: 12.0),             ),             Text(               'Marker size: ${widget.marker.width}, ${widget.marker.height}',               style: const TextStyle(fontSize: 12.0),             ),           ],         ),       ),     );   } } <\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 assets \u043d\u0430\u0434\u043e \u0432 pubspec.yml \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443:<\/p>\n<\/blockquote>\n<pre><code class=\"yaml\">flutter:   assets:     - assets\/<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u0443 \u043d\u0430\u0441 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043c\u0430\u0440\u043a\u0435\u0440 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u0435\u0442 \u043e\u043a\u043d\u043e \u0441 \u043a\u043e\u0442\u0438\u043a\u0430\u043c\u0438.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/459\/a30\/ff1\/459a30ff11eae9647f0388c75299ab1f.gif\" width=\"222\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/459\/a30\/ff1\/459a30ff11eae9647f0388c75299ab1f.gif\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e! \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0435\u0441\u0442\u044c <a href=\"https:\/\/t.me\/avtarasov210\" rel=\"noopener noreferrer nofollow\">\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c<\/a>, \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u043f\u0440\u0438\u0441\u0430\u0436\u0438\u0432\u0430\u0439\u0442\u0435\u0441\u044c).<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/689578\/\"> https:\/\/habr.com\/ru\/post\/689578\/<\/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<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<\/p>\n<p>\u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c \u043c\u043d\u0435 \u043a\u0430\u043a-\u0442\u043e \u043a\u0430\u0440\u0442\u0430 \u0432\u043e \u0444\u043b\u0430\u0442\u0442\u0435\u0440-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0413\u0443\u0433\u043b \u0438 \u042f\u043d\u0434\u0435\u043a\u0441 \u043a\u0430\u0440\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f OSM. \u041a\u0430\u0440\u0442\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043c\u0430\u0440\u043a\u0435\u0440 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u0440\u0442\u0435. \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0448\u0435\u043b \u043f\u043b\u0430\u0433\u0438\u043d flutter_map_marker_popup.<\/p>\n<h2>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d<\/h2>\n<p> \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f:<\/p>\n<pre><code class=\"yaml\">dependencies:   flutter:     sdk: flutter   flutter_map: any   latlong2: any   flutter_map_marker_popup: any <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u0430\u0440\u0442\u0443 Flutter_map. \u0418\u0437 \u0432\u0430\u0436\u043d\u043e\u0433\u043e \u0442\u0443\u0442 &#8212; urlTemplate, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 OSM. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 MapOptions \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0438\u0437\u0432\u043d\u0435.<\/p>\n<pre><code class=\"dart\">class MapPage extends StatefulWidget {   MapPage({super.key, required this.center, double? zoom}){     this.zoom = zoom ?? 9.0;   }    final LatLng center;   late final double zoom;    @override   State&lt;MapPage> createState() => _MapPageState(); }  class _MapPageState extends State&lt;MapPage> {    final urlTemplate = 'https:\/\/tile.openstreetmap.org\/{z}\/{x}\/{y}.png';    @override   Widget build(BuildContext context) {     return Scaffold(       appBar: AppBar(         title: Text(\"Map page\"),       ),       body: FlutterMap(         mapController: MapController(),         options: MapOptions(           center: widget.center,           zoom: widget.zoom,         ),         children: [           TileLayer(             urlTemplate: urlTemplate,           ),         ],       ),     );   } } <\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e \u0434\u043e\u043b\u0433\u043e\u043c\u0443 \u043d\u0430\u0436\u0430\u0442\u0438\u044e, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u0440\u043a\u0435\u0440 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0440\u043a\u0435\u0440 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0435\u0435 \u0432 MapOptions <code>onLongPress: addMarker.<\/code><\/p>\n<pre><code class=\"dart\"> final List&lt;Marker> _markers = [];    addMarker(tapPosition, point){     _markers.add(Marker(       point: point,       builder: (c) => const Icon(Icons.location_on, size: 40),       width: 40,       height: 40,));   } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u0438 \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u043e\u044f <code>MarkerLayer(markers: _markers)<\/code>, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043f\u043e \u043d\u0438\u043c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0447\u0442\u043e-\u043b\u0438\u0431\u043e. \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 flutter_map_marker_popup \u0435\u0441\u0442\u044c <code>PopupMarkerLayerWidget<\/code>. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439:<\/p>\n<pre><code class=\"dart\">PopupMarkerLayerWidget(   options: PopupMarkerLayerOptions(     popupController: _popupLayerController,     markers: _markers,     markerRotateAlignment:     PopupMarkerLayerOptions.rotationAlignmentFor(AnchorAlign.top),     popupBuilder: (BuildContext context, Marker marker) =>         ExamplePopup(marker),   ), ), <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043c\u0430\u0440\u043a\u0435\u0440\u044b, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043f\u0430\u043f\u0430. <code>ExamplePopup<\/code> &#8212; \u044d\u0442\u043e \u0432\u0438\u0434\u0436\u0435\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043c\u0430\u0440\u043a\u0435\u0440. \u0412 \u043d\u0435\u043c \u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043e\u043a\u043d\u0430.<\/p>\n<pre><code class=\"dart\">class ExamplePopup extends StatefulWidget {   final Marker marker;    const ExamplePopup(this.marker, {Key? key}) : super(key: key);    @override   State&lt;StatefulWidget> createState() => _ExamplePopupState(); }  class _ExamplePopupState extends State&lt;ExamplePopup> {   int _currentIcon = 0;    @override   Widget build(BuildContext context) {     return Card(       child: InkWell(         onTap: () => setState(() {           _currentIcon = (_currentIcon + 1) % 4;         }),         child: Row(           mainAxisSize: MainAxisSize.min,           children: &lt;Widget>[             Padding(               padding: const EdgeInsets.only(left: 20, right: 10),               child: Image.asset('assets\/${_currentIcon+1}.png', width: 40, height: 40,),             ),             _cardDescription(context),           ],         ),       ),     );   }    Widget _cardDescription(BuildContext context) {     return Padding(       padding: const EdgeInsets.all(10),       child: Container(         constraints: const BoxConstraints(minWidth: 100, maxWidth: 200),         child: Column(           crossAxisAlignment: CrossAxisAlignment.start,           mainAxisAlignment: MainAxisAlignment.start,           mainAxisSize: MainAxisSize.min,           children: &lt;Widget>[             const Text(               'Popup for a marker!',               overflow: TextOverflow.fade,               softWrap: false,               style: TextStyle(                 fontWeight: FontWeight.w500,                 fontSize: 14.0,               ),             ),             const Padding(padding: EdgeInsets.symmetric(vertical: 4.0)),             Text(               'Position: ${widget.marker.point.latitude}, ${widget.marker.point.longitude}',               style: const TextStyle(fontSize: 12.0),             ),             Text(               'Marker size: ${widget.marker.width}, ${widget.marker.height}',               style: const TextStyle(fontSize: 12.0),             ),           ],         ),       ),     );   } } <\/code><\/pre>\n<blockquote>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 assets \u043d\u0430\u0434\u043e \u0432 pubspec.yml \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443:<\/p>\n<\/blockquote>\n<pre><code class=\"yaml\">flutter:   assets:     - assets\/<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442 \u0443 \u043d\u0430\u0441 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043c\u0430\u0440\u043a\u0435\u0440 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u0435\u0442 \u043e\u043a\u043d\u043e \u0441 \u043a\u043e\u0442\u0438\u043a\u0430\u043c\u0438.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e! \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0435\u0441\u0442\u044c <a href=\"https:\/\/t.me\/avtarasov210\" rel=\"noopener noreferrer nofollow\">\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c<\/a>, \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u043f\u0440\u0438\u0441\u0430\u0436\u0438\u0432\u0430\u0439\u0442\u0435\u0441\u044c).<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/689578\/\"> https:\/\/habr.com\/ru\/post\/689578\/<\/a><br \/><\/br><\/br><\/p>\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-338646","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338646","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=338646"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338646\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=338646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=338646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=338646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}