{"id":459981,"date":"2025-05-16T15:02:16","date_gmt":"2025-05-16T15:02:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=459981"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=459981","title":{"rendered":"<span>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u044f \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u043d\u043e\u0432\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438\u0432\u0435\u043d\u0442\u043e\u0432 \u0438 \u043c\u043d\u0435 \u043e\u043d\u0430 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f<\/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<p>\u0414\u0430\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c, \u044d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438 \u043f\u0438\u0448\u0443 \u044f \u0435\u0435 \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0435 \u0441 \u043a\u0435\u043c \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435. \u0414\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044e, \u0447\u0442\u043e \u044f \u0441\u0430\u043c\u043e\u0443\u0447\u043a\u0430 \u0431\u0435\u0437 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<h2>Stateful Event Multiplexing Bus <\/h2>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043d\u0435 \u0434\u0430\u043b \u0447\u0430\u0442 \u0433\u043f\u0442, \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u043f\u0440\u043e\u0441\u0438\u043b \u0435\u0433\u043e \u043e\u00a0\u043c\u043e\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435, \u0438 \u043a\u0430\u043a\u00a0\u043e\u043d \u043c\u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0438\u043b, \u0442\u043e \u0447\u0442\u043e\u00a0\u044f \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u044d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0438 (\u0446\u0438\u0442\u0438\u0440\u0443\u044e) \u00ab\u0413\u043e\u0434\u043d\u043e\u0442\u0430!\u00bb. \u041d\u043e\u00a0\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0443\u00a0\u0432\u0441\u0435\u0439 \u044d\u0442\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043d\u0435\u0442\u0443, \u0438\u0431\u043e \u044f \u043d\u0435\u00a0\u0441\u0438\u043b\u0435\u043d \u0432\u00a0\u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0435, \u043d\u043e\u00a0\u0432\u00a0\u043a\u043e\u0434\u0435 \u043e\u043d\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00abMEctx\u00bb. \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043c\u0431 \u043f\u0440\u0438\u0436\u0438\u0432\u0435\u0442\u0441\u044f&#8230;<\/p>\n<h2>\u0422\u0430\u043a \u043a\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0439 \u044d\u0442\u043e\u0442 &#171;MEctx&#187;<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0438\u043c\u0438 \u043c\u044b\u0441\u043b\u044f\u043c\u0438 (\u0430 \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u0442\u0435\u043e\u0440\u0438\u044e js), \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u041e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u00a0\u2014 \u0432\u0441\u0435 \u0438\u0432\u0435\u043d\u0442\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u00a0\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0432\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u044f \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u00a0\u041e\u0414\u041d\u041e\u041c\u0423 \u0440\u0430\u0437\u0443 \u043d\u0430\u00a0\u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f \u0438\u0432\u0435\u043d\u0442\u0430, \u0438 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0432\u0435\u0434\u0443\u0442 \u0432\u00a0\u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0440\u043e\u0433\u043e\u0435<strong> \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/strong> \u0438\u0432\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u0432\u00a0\u043e\u0431\u0449\u0435\u043c \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u00a0\u043a\u043b\u044e\u0447\u043e\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u0432\u0435\u043d\u0442\u0430, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043b\u0435\u0436\u0430\u0442 \u0438\u0432\u0435\u043d\u0442\u044b \u043f\u043e\u0434\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0436\u0438\u043c\u044b\u00a0\u2014 \u0432\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0445\u0440\u0430\u043d\u044f\u0449\u0430\u044f \u043a\u043b\u044e\u0447 \u043f\u043e\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0432\u0435\u043d\u0442\u044b \u0432\u00a0\u0438\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u0445<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043b\u044e\u0441\u044b \u0434\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u0415\u0434\u0438\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0438\u0432\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c + \u043b\u0435\u0433\u043a\u0438\u0439 \u0434\u0435\u0431\u0430\u0433<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0436\u0438\u043c\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0432\u00a0\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0432\u0435\u043d\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u044b\u00a0\u2014 \u0432\u00a0\u043c\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432\u00a0\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043a\u043e\u043f\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (window), \u043d\u043e\u00a0\u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u0432 \u00abuseContext\u00bb \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u00a0\u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u043e\u0432\u00a0\u2014 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0432\u0435\u043d\u0442 \u0438\u043b\u0438\u00a0\u0443\u0431\u0440\u0430\u0442\u044c \u0438\u043b\u0438\u00a0\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0432\u00a0\u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u00a0\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043f\u043e\u00a0\u043a\u043b\u044e\u0447\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u0432\u0435\u043d\u0442\u0430, \u044d\u0442\u043e \u043d\u0435\u00a0\u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u00a0DOM \u0434\u0435\u0440\u0435\u0432\u043e\u043c\u00a0\u2014 \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0432\u00a0\u0434\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043c\u044b 1\u00a0\u0440\u0430\u0437 \u0432\u0435\u0448\u0430\u0435\u043c \u0438\u0432\u0435\u043d\u0442 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u043e\u043c \u0432\u00a0\u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440, \u0442\u043e \u043d\u0430\u00a0\u043f\u0435\u0440\u0432\u043e\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0435 \u0432\u0441\u0435 \u043c\u0430\u0445\u0438\u043d\u0430\u0446\u0438\u0438 \u0441\u00a0\u0434\u0435\u0440\u0435\u0432\u043e\u043c \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u044f\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0438\u0434\u043b\u0432\u0430\u0440 \u0434\u043b\u044f\u00a0\u0438\u0432\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u043e\u0434<\/h2>\n<p>\u0412\u043d\u0435\u0441\u0443 \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0434 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043b 11 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u0430\u0440\u0442\u043e\u0439 \u043d\u0430 \u0431\u0430\u0437\u0435 &#171;react-map-gl&#187;, \u043d\u043e \u0432\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0434 \u043b\u044e\u0431\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u042f \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d \u0434\u0430\u0442\u044c \u0432\u0430\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434, \u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434.<\/p>\n<pre><code class=\"typescript\">import { Map, MapLibreEvent, MapMouseEvent } from \"maplibre-gl\"; import { MapCollection } from \"react-map-gl\/dist\/esm\/components\/use-map\";  \/\/ \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u0441\u043b\u043e\u0435\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 import {   IMAGE_PREFIX_GHOST,   PIN_PREFIX,   POLYGON_PREFIX,   ROUTE_PREFIX, } from \"~\/components\/_store\/geometry\"; \/\/ \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u0430\u0440\u0442\u044b import { MAP_TOOL } from \"~\/components\/_store\/project\"; \/\/ \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0435\u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432 import { DATASET_PREFIX } from \"..\/..\/..\/_store\/datasets\";  \/\/   ____         ___     ____________ \/\/  \/\\   '.      \/   \\   \/\\   ________\\ \/\/  \\ \\    '.   \/     \\  \\ \\  \\_______\/ \/\/   \\ \\  \\. '.\/   \/\\  \\  \\ \\  \\_________      ________  ___   __    __ \/\/    \\ \\  \\'.    \/\\ \\  \\  \\ \\   ________\\     | _____| _| |_  \\ \\  \/ \/ \/\/     \\ \\  \\.'._\/  \\ \\  \\  \\ \\  \\_______\/     | |      |_ _|   \\ \\\/ \/ \/\/      \\ \\  \\'.\/    \\ \\  \\  \\ \\  \\_________   | |       | |     }  { \/\/       \\ \\__\\       \\ \\__\\  \\ \\___________\\  | |____   | |_   \/ \/\\ \\ \/\/        \\\/__\/        \\\/__\/   \\\/___________\/  |______|  |___| \/_\/  \\_\\ \/\/ \/\/ \/\/  MECtx \/\/ \/\/  created:                4.05.24 \/\/  successfully applied:   10.05.24 \/\/ \/\/  example: \/\/ \/\/  useEffect(() =&gt; { \/\/    let handleClick = (str) =&gt; { \/\/      console.log(str) \/\/      if (ME.tool) { \/\/        ME.tool = null \/\/      } else { \/\/        ME.tool = \"pin\" \/\/      } \/\/    } \/\/ \/\/    ME.click.stock = (e) =&gt; handleClick(\"stock event\")  \/\/ call callback only when ME.tool == null \/\/    ME.click.pin = (e) =&gt; handleClick(\"pin event\")      \/\/ call callback only when ME.tool == \"pin\" \/\/ \/\/    return () =&gt; { \/\/      ME.click.stock = () =&gt; {} \/\/      ME.click.pin = () =&gt; {} \/\/    } \/\/  }, []) \/\/ \/\/  ME can store a lot of callbacks, but always call only one  \/\/ MAP_TOOL \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 type eventsList = MAP_TOOL | \"stock\" | \"cs\";  type handlersList =   | \"contextmenu\"   | \"click\"   | \"mousedown\"   | \"mouseup\"   | \"mousemove\"   | \"mouseenter\"   | \"mouseleave\"   | \"mouseout\"   | \"mouseover\"   | \"drag\"   | \"dragend\"   | \"dragstart\"   | \"move\"   | \"moveend\"   | \"movestart\"   | \"zoom\"   | \"zoomend\"   | \"zoomstart\";  export enum METoolModes {   None = 0,   Point = 1,   Fill = 2,   Line = 3,   Between = 4, }  export type MapEvents = {   \/**    * *DO NOT REDECLARE AFTER `inited` PROPERTY: `true`*    *    * shortcut for `click` and `contextmenu` events in `clickChecker` function    * @param e map event    * @param type event from `eventsList`    * @param rc `false` - LeftClick, `true` - RightClick    *\/   handleClick: (e: MapMouseEvent, type: eventsList, rc: boolean) =&gt; void;    \/**    * handles `MapMouseEvent&lt;&gt;`    * @param e map event    * @param handler event from `eventsList`    *\/   handleEvent: (e: MapMouseEvent, handler: handlersList) =&gt; void;   \/**    * handles `MapMouseEvent&lt;MouseEvent | TouchEvent | undefined&gt;`    * @param e map event    * @param handler event from `eventsList`    *\/   handleMTEvent: (     e: MapLibreEvent&lt;MouseEvent | TouchEvent | undefined&gt;,     handler: handlersList,   ) =&gt; void;   \/**    * handles `MapMouseEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;`    * @param e map event    * @param handler event from `eventsList`    *\/   handleMTWEvent: (     e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     handler: handlersList,   ) =&gt; void;    contextmenu: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };    click: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };    mousedown: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseup: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mousemove: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseenter: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseleave: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseout: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseover: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };    drag: {     [key in eventsList]?: (e: MapLibreEvent&lt;MouseEvent | TouchEvent | undefined&gt;) =&gt; void;   };   dragend: {     [key in eventsList]?: (e: MapLibreEvent&lt;MouseEvent | TouchEvent | undefined&gt;) =&gt; void;   };   dragstart: {     [key in eventsList]?: (e: MapLibreEvent&lt;MouseEvent | TouchEvent | undefined&gt;) =&gt; void;   };    move: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };   moveend: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };   movestart: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };    zoom: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };   zoomend: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };   zoomstart: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };    \/**    * property for selecting events    *    * if tool equals `null` =&gt; call `Stock` callbacks    *    * if tool equals `some_tool` =&gt; call `some_tool` callbacks    *\/   tool: MAP_TOOL | null;    \/**    * RightClick - `true` value allows instrument to show Bbox    *\/   rc: boolean;    \/**    *    *\/   toolMode: METoolModes;    map: {     current: Map &amp; {       \/**        * get real map object        *\/       getMap: () =&gt; Map;     };   };   init: (Map: MapCollection&lt;Map&gt;) =&gt; void;   inited: boolean; };  let runEvent = (e: any, handler: handlersList, ctx: MapEvents) =&gt; {   if (ctx.tool) {     if (ctx[handler][ctx.tool]) {       ctx[handler][ctx.tool]!(e);     }   } else {     if (!ctx.toolMode &amp;&amp; ctx[handler][\"stock\"]) {       ctx[handler][\"stock\"]!(e);     }   } };  \/\/ \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0430 \/\/ \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u0442\u043e\u043a\u043e\u0432\u044b\u0445 \u0438\u0432\u0435\u043d\u0442\u043e\u0432 click \u0438 contextmenu let clickChecker = function (e: MapMouseEvent, rc: boolean, ctx: MapEvents) {   \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u043e\u0438 \u043f\u043e\u0434 \u043a\u043b\u0438\u043a\u043e\u043c   let featuresUnderClick = ctx.map.current.queryRenderedFeatures(e.point);    if (featuresUnderClick.length) {     let layer = featuresUnderClick[0]?.layer;      let id = layer?.id.split(\":\")[0];      switch (id) {       case DATASET_PREFIX:         ctx.handleClick(e, \"dataset_info\", rc);         break;       case POLYGON_PREFIX:         ctx.handleClick(e, \"polygon\", rc);         break;       case ROUTE_PREFIX:         ctx.handleClick(e, \"route\", rc);         break;       case PIN_PREFIX:         ctx.handleClick(e, \"pin\", rc);         break;       case IMAGE_PREFIX_GHOST:         ctx.handleClick(e, \"image\", rc);         break;       default: {         \/\/ ctx.setTool(null);       }     }   } };  export const MEInitialGlobalObject: MapEvents = {   handleClick: function (e, type, rc) {     if (rc) {       if (this.contextmenu[type]) {         this.tool = type;         this.contextmenu[type](e);       }     } else {       if (this.click[type]) {         this.tool = type;         this.click[type](e);       }     }   },    handleEvent: function (e, handler) {     runEvent(e, handler, this);   },   handleMTEvent: function (e, handler) {     runEvent(e, handler, this);   },   handleMTWEvent: function (e, handler) {     runEvent(e, handler, this);   },    contextmenu: {},   click: {},    mousedown: {},   mouseup: {},   mousemove: {},   mouseenter: {},   mouseleave: {},   mouseout: {},   mouseover: {},    drag: {},   dragend: {},   dragstart: {},    move: {},   moveend: {},   movestart: {},    zoom: {},   zoomend: {},   zoomstart: {},    tool: null,   map: {     \/\/ @ts-ignore     current: null,   },   init: function (Map) {     this.map.current = Map.current;      if (!this.inited) {       this.inited = true;        this.click.stock = (e: MapMouseEvent) =&gt; {         clickChecker(e, false, this);       };       this.contextmenu.stock = (e: MapMouseEvent) =&gt; {         clickChecker(e, true, this);       };     }   },   inited: false, }; <\/code><\/pre>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438\u0432\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"typescript\">onClick={(e) =&gt; ME.handleEvent(e, \"click\")} onContextMenu={(e) =&gt; ME.handleEvent(e, \"contextmenu\")} onMouseDown={(e) =&gt; ME.handleEvent(e, \"mousedown\")} onMouseUp={(e) =&gt; ME.handleEvent(e, \"mouseup\")} onMouseMove={(e) =&gt; {   ME.handleEvent(e, \"mousemove\");   if (ME.inited &amp;&amp; !ME.toolMode &amp;&amp; ME.mousemove.cs) {     ME.mousemove.cs(e);   } }} onMouseEnter={(e) =&gt; ME.handleEvent(e, \"mouseenter\")} onMouseLeave={(e) =&gt; ME.handleEvent(e, \"mouseleave\")} onMouseOut={(e) =&gt; ME.handleEvent(e, \"mouseout\")} onMouseOver={(e) =&gt; ME.handleEvent(e, \"mouseover\")} onDrag={(e) =&gt; ME.handleMTEvent(e, \"drag\")} onDragEnd={(e) =&gt; ME.handleMTEvent(e, \"dragend\")} onDragStart={(e) =&gt; ME.handleMTEvent(e, \"dragstart\")} onMove={(e) =&gt; ME.handleMTWEvent(e, \"move\")} onMoveEnd={(e) =&gt; ME.handleMTWEvent(e, \"moveend\")} onMoveStart={(e) =&gt; ME.handleMTWEvent(e, \"movestart\")} onZoom={(e) =&gt; {   ME.handleMTWEvent(e, \"zoom\");   setPopupMaxWidth(getMaxWidthFromZoom()); }} onZoomEnd={(e) =&gt; ME.handleMTWEvent(e, \"zoomend\")} onZoomStart={(e) =&gt; ME.handleMTWEvent(e, \"zoomstart\")}<\/code><\/pre>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 1 \u0440\u0430\u0437 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u044b \u043d\u0435 \u043c\u0443\u0447\u0430\u0435\u043c \u0431\u0435\u0434\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0443.<\/p>\n<p>\u0411\u0430\u0437\u043e\u0432\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"typescript\">useEffect(() =&gt; {   \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043b\u043b\u0431\u0435\u043a   if (tool == \"pin\" &amp;&amp; drawmode) {          \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0430\u043a \u0438 \u0432\u0441\u0435\u0433\u0434\u0430     let handleClick = (e: MapMouseEvent) =&gt; {       \/\/       \/\/ \u043b\u043e\u0433\u0438\u043a\u0430       \/\/     };      \/\/ \u0432\u0435\u0448\u0430\u0435\u043c \u0438\u0432\u0435\u043d\u0442     ME.click.pin = (e) =&gt; handleClick(e);      return () =&gt; {       \/\/ \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438       ME.click.pin = (e) =&gt; () =&gt; {};     };   } }, [...]);<\/code><\/pre>\n<p>\u0422\u043e \u0434\u043b\u0438\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0442\u043d\u043e \u043a\u043e\u0434\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u043d\u043e \u044f \u043f\u0440\u0438\u0432\u0435\u0440\u0436\u0435\u043d\u0435\u0446 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043f\u0438-\u043f\u0430\u0441\u0442.<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0438\u0432\u0435\u043d\u0442\u0430 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0435 &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c &#171;ME.init(Map)&#187;, \u0438 \u0432\u0435\u0448\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0432\u0435\u043d\u0442\u044b \u0442\u0430\u043c \u0433\u0434\u0435 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0432\u00a0\u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u00a0\u043a\u0430\u0440\u0442\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0437\u043e\u0432 \u0438\u0432\u0435\u043d\u0442\u0430\u00a0\u2014 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0432\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437 \u0438\u0432\u0435\u043d\u0442\u0430\u00a0\u2014 \u043e\u0431\u0449\u0438\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b, \u0435\u0441\u043b\u0438 \u0438\u0432\u0435\u043d\u0442 \u043d\u0435\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0438\u0432\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c, \u043d\u043e\u00a0\u0432\u00a0\u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u043d\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00abstock\u00bb \u043a\u043e\u043b\u043b\u0431\u0435\u043a (\u044d\u0442\u043e \u043d\u0435\u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e)<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0437\u043e\u0432 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0430 \u043f\u043e\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0437\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0438\u0432\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043a\u0430\u043a\u0438\u0445 \u0443\u0433\u043e\u0434\u043d\u043e \u0438\u0432\u0435\u043d\u0442\u043e\u0432, \u0438 \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a \u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0432\u0435\u0448\u0430\u043d\u0438\u0435 \u0438\u0432\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u044f\u0434 \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0432\u0435\u043d\u0442\u044b \u0432 \u044d\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435.<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u00ab\u0440\u0435\u0436\u0438\u043c\u00bb \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0441\u0442\u0440\u043e\u043a, \u0447\u0442\u043e\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0432\u0435\u043d\u0442\u043e\u0432, \u0445\u043e\u0442\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432\u044b\u0437\u0432\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d.<\/p>\n<p>\u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u044f \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434&#8230;<\/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\/910100\/\"> https:\/\/habr.com\/ru\/articles\/910100\/<\/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<p>\u0414\u0430\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e \u0441 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c, \u044d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438 \u043f\u0438\u0448\u0443 \u044f \u0435\u0435 \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0435 \u0441 \u043a\u0435\u043c \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435. \u0414\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044e, \u0447\u0442\u043e \u044f \u0441\u0430\u043c\u043e\u0443\u0447\u043a\u0430 \u0431\u0435\u0437 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<h2>Stateful Event Multiplexing Bus <\/h2>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043d\u0435 \u0434\u0430\u043b \u0447\u0430\u0442 \u0433\u043f\u0442, \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u043f\u0440\u043e\u0441\u0438\u043b \u0435\u0433\u043e \u043e\u00a0\u043c\u043e\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435, \u0438 \u043a\u0430\u043a\u00a0\u043e\u043d \u043c\u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0438\u043b, \u0442\u043e \u0447\u0442\u043e\u00a0\u044f \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u044d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0438 (\u0446\u0438\u0442\u0438\u0440\u0443\u044e) \u00ab\u0413\u043e\u0434\u043d\u043e\u0442\u0430!\u00bb. \u041d\u043e\u00a0\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0443\u00a0\u0432\u0441\u0435\u0439 \u044d\u0442\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043d\u0435\u0442\u0443, \u0438\u0431\u043e \u044f \u043d\u0435\u00a0\u0441\u0438\u043b\u0435\u043d \u0432\u00a0\u043d\u0435\u0439\u043c\u0438\u043d\u0433\u0435, \u043d\u043e\u00a0\u0432\u00a0\u043a\u043e\u0434\u0435 \u043e\u043d\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00abMEctx\u00bb. \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043c\u0431 \u043f\u0440\u0438\u0436\u0438\u0432\u0435\u0442\u0441\u044f&#8230;<\/p>\n<h2>\u0422\u0430\u043a \u043a\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0439 \u044d\u0442\u043e\u0442 &#171;MEctx&#187;<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0438\u043c\u0438 \u043c\u044b\u0441\u043b\u044f\u043c\u0438 (\u0430 \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u0442\u0435\u043e\u0440\u0438\u044e js), \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>\u041e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u00a0\u2014 \u0432\u0441\u0435 \u0438\u0432\u0435\u043d\u0442\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u00a0\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0432\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u044f \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u00a0\u041e\u0414\u041d\u041e\u041c\u0423 \u0440\u0430\u0437\u0443 \u043d\u0430\u00a0\u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043f \u0438\u0432\u0435\u043d\u0442\u0430, \u0438 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0432\u0435\u0434\u0443\u0442 \u0432\u00a0\u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0440\u043e\u0433\u043e\u0435<strong> \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/strong> \u0438\u0432\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u0432\u00a0\u043e\u0431\u0449\u0435\u043c \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u00a0\u043a\u043b\u044e\u0447\u043e\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u0432\u0435\u043d\u0442\u0430, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043b\u0435\u0436\u0430\u0442 \u0438\u0432\u0435\u043d\u0442\u044b \u043f\u043e\u0434\u00a0\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0436\u0438\u043c\u044b\u00a0\u2014 \u0432\u00a0\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0445\u0440\u0430\u043d\u044f\u0449\u0430\u044f \u043a\u043b\u044e\u0447 \u043f\u043e\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0432\u0435\u043d\u0442\u044b \u0432\u00a0\u0438\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u0445<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043b\u044e\u0441\u044b \u0434\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>\u0415\u0434\u0438\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0438\u0432\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c + \u043b\u0435\u0433\u043a\u0438\u0439 \u0434\u0435\u0431\u0430\u0433<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0436\u0438\u043c\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0432\u00a0\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0432\u0435\u043d\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u044b\u00a0\u2014 \u0432\u00a0\u043c\u043e\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432\u00a0\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043a\u043e\u043f\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (window), \u043d\u043e\u00a0\u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u0432 \u00abuseContext\u00bb \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u00a0\u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u043e\u0432\u00a0\u2014 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0432\u0435\u043d\u0442 \u0438\u043b\u0438\u00a0\u0443\u0431\u0440\u0430\u0442\u044c \u0438\u043b\u0438\u00a0\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0432\u00a0\u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u00a0\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043f\u043e\u00a0\u043a\u043b\u044e\u0447\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u0432\u0435\u043d\u0442\u0430, \u044d\u0442\u043e \u043d\u0435\u00a0\u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u00a0DOM \u0434\u0435\u0440\u0435\u0432\u043e\u043c\u00a0\u2014 \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u0432\u00a0\u0434\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u043c\u044b 1\u00a0\u0440\u0430\u0437 \u0432\u0435\u0448\u0430\u0435\u043c \u0438\u0432\u0435\u043d\u0442 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0431\u0435\u043a\u043e\u043c \u0432\u00a0\u043e\u0431\u0449\u0438\u0439 \u0445\u0435\u043d\u0434\u043b\u0435\u0440, \u0442\u043e \u043d\u0430\u00a0\u043f\u0435\u0440\u0432\u043e\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0435 \u0432\u0441\u0435 \u043c\u0430\u0445\u0438\u043d\u0430\u0446\u0438\u0438 \u0441\u00a0\u0434\u0435\u0440\u0435\u0432\u043e\u043c \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u044f\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0438\u0434\u043b\u0432\u0430\u0440 \u0434\u043b\u044f\u00a0\u0438\u0432\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u043e\u0434<\/h2>\n<p>\u0412\u043d\u0435\u0441\u0443 \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0434 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043b 11 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d \u0437\u0430\u0442\u043e\u0447\u0435\u043d \u043f\u043e\u0434 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u0430\u0440\u0442\u043e\u0439 \u043d\u0430 \u0431\u0430\u0437\u0435 &#171;react-map-gl&#187;, \u043d\u043e \u0432\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0434 \u043b\u044e\u0431\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u042f \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d \u0434\u0430\u0442\u044c \u0432\u0430\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434, \u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434.<\/p>\n<pre><code class=\"typescript\">import { Map, MapLibreEvent, MapMouseEvent } from \"maplibre-gl\"; import { MapCollection } from \"react-map-gl\/dist\/esm\/components\/use-map\";  \/\/ \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u044b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u0441\u043b\u043e\u0435\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 import {   IMAGE_PREFIX_GHOST,   PIN_PREFIX,   POLYGON_PREFIX,   ROUTE_PREFIX, } from \"~\/components\/_store\/geometry\"; \/\/ \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u0430\u0440\u0442\u044b import { MAP_TOOL } from \"~\/components\/_store\/project\"; \/\/ \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0435\u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432 import { DATASET_PREFIX } from \"..\/..\/..\/_store\/datasets\";  \/\/   ____         ___     ____________ \/\/  \/\\   '.      \/   \\   \/\\   ________\\ \/\/  \\ \\    '.   \/     \\  \\ \\  \\_______\/ \/\/   \\ \\  \\. '.\/   \/\\  \\  \\ \\  \\_________      ________  ___   __    __ \/\/    \\ \\  \\'.    \/\\ \\  \\  \\ \\   ________\\     | _____| _| |_  \\ \\  \/ \/ \/\/     \\ \\  \\.'._\/  \\ \\  \\  \\ \\  \\_______\/     | |      |_ _|   \\ \\\/ \/ \/\/      \\ \\  \\'.\/    \\ \\  \\  \\ \\  \\_________   | |       | |     }  { \/\/       \\ \\__\\       \\ \\__\\  \\ \\___________\\  | |____   | |_   \/ \/\\ \\ \/\/        \\\/__\/        \\\/__\/   \\\/___________\/  |______|  |___| \/_\/  \\_\\ \/\/ \/\/ \/\/  MECtx \/\/ \/\/  created:                4.05.24 \/\/  successfully applied:   10.05.24 \/\/ \/\/  example: \/\/ \/\/  useEffect(() =&gt; { \/\/    let handleClick = (str) =&gt; { \/\/      console.log(str) \/\/      if (ME.tool) { \/\/        ME.tool = null \/\/      } else { \/\/        ME.tool = \"pin\" \/\/      } \/\/    } \/\/ \/\/    ME.click.stock = (e) =&gt; handleClick(\"stock event\")  \/\/ call callback only when ME.tool == null \/\/    ME.click.pin = (e) =&gt; handleClick(\"pin event\")      \/\/ call callback only when ME.tool == \"pin\" \/\/ \/\/    return () =&gt; { \/\/      ME.click.stock = () =&gt; {} \/\/      ME.click.pin = () =&gt; {} \/\/    } \/\/  }, []) \/\/ \/\/  ME can store a lot of callbacks, but always call only one  \/\/ MAP_TOOL \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 type eventsList = MAP_TOOL | \"stock\" | \"cs\";  type handlersList =   | \"contextmenu\"   | \"click\"   | \"mousedown\"   | \"mouseup\"   | \"mousemove\"   | \"mouseenter\"   | \"mouseleave\"   | \"mouseout\"   | \"mouseover\"   | \"drag\"   | \"dragend\"   | \"dragstart\"   | \"move\"   | \"moveend\"   | \"movestart\"   | \"zoom\"   | \"zoomend\"   | \"zoomstart\";  export enum METoolModes {   None = 0,   Point = 1,   Fill = 2,   Line = 3,   Between = 4, }  export type MapEvents = {   \/**    * *DO NOT REDECLARE AFTER `inited` PROPERTY: `true`*    *    * shortcut for `click` and `contextmenu` events in `clickChecker` function    * @param e map event    * @param type event from `eventsList`    * @param rc `false` - LeftClick, `true` - RightClick    *\/   handleClick: (e: MapMouseEvent, type: eventsList, rc: boolean) =&gt; void;    \/**    * handles `MapMouseEvent&lt;&gt;`    * @param e map event    * @param handler event from `eventsList`    *\/   handleEvent: (e: MapMouseEvent, handler: handlersList) =&gt; void;   \/**    * handles `MapMouseEvent&lt;MouseEvent | TouchEvent | undefined&gt;`    * @param e map event    * @param handler event from `eventsList`    *\/   handleMTEvent: (     e: MapLibreEvent&lt;MouseEvent | TouchEvent | undefined&gt;,     handler: handlersList,   ) =&gt; void;   \/**    * handles `MapMouseEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;`    * @param e map event    * @param handler event from `eventsList`    *\/   handleMTWEvent: (     e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     handler: handlersList,   ) =&gt; void;    contextmenu: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };    click: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };    mousedown: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseup: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mousemove: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseenter: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseleave: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseout: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };   mouseover: {     [key in eventsList]?: (e: MapMouseEvent) =&gt; void;   };    drag: {     [key in eventsList]?: (e: MapLibreEvent&lt;MouseEvent | TouchEvent | undefined&gt;) =&gt; void;   };   dragend: {     [key in eventsList]?: (e: MapLibreEvent&lt;MouseEvent | TouchEvent | undefined&gt;) =&gt; void;   };   dragstart: {     [key in eventsList]?: (e: MapLibreEvent&lt;MouseEvent | TouchEvent | undefined&gt;) =&gt; void;   };    move: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };   moveend: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };   movestart: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };    zoom: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };   zoomend: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };   zoomstart: {     [key in eventsList]?: (       e: MapLibreEvent&lt;MouseEvent | TouchEvent | WheelEvent | undefined&gt;,     ) =&gt; void;   };    \/**    * property for selecting events    *    * if tool equals `null` =&gt; call `Stock` callbacks    *    * if tool equals `some_tool` =&gt; call `some_tool` callbacks    *\/   tool: MAP_TOOL | null;    \/**    * RightClick - `true` value allows instrument to show Bbox    *\/   rc: boolean;    \/**    *    *\/   toolMode: METoolModes;    map: {     current: Map &amp; {       \/**        * get real map object        *\/       getMap: () =&gt; Map;     };   };   init: (Map: MapCollection&lt;Map&gt;) =&gt; void;   inited: boolean; };  let runEvent = (e: any, handler: handlersList, ctx: MapEvents) =&gt; {   if (ctx.tool) {     if (ctx[handler][ctx.tool]) {       ctx[handler][ctx.tool]!(e);     }   } else {     if (!ctx.toolMode &amp;&amp; ctx[handler][\"stock\"]) {       ctx[handler][\"stock\"]!(e);     }   } };  \/\/ \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0430 \/\/ \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u0442\u043e\u043a\u043e\u0432\u044b\u0445 \u0438\u0432\u0435\u043d\u0442\u043e\u0432 click \u0438 contextmenu let clickChecker = function (e: MapMouseEvent, rc: boolean, ctx: MapEvents) {   \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u043e\u0438 \u043f\u043e\u0434 \u043a\u043b\u0438\u043a\u043e\u043c   let featuresUnderClick = ctx.map.current.queryRenderedFeatures(e.point);    if (featuresUnderClick.length) {     let layer = featuresUnderClick[0]?.layer;      let id = layer?.id.split(\":\")[0];      switch (id) {       case DATASET_PREFIX:         ctx.handleClick(e, \"dataset_info\", rc);         break;       case POLYGON_PREFIX:         ctx.handleClick(e, \"polygon\", rc);         break;       case ROUTE_PREFIX:         ctx.handleClick(e, \"route\", rc);         break;       case PIN_PREFIX:         ctx.handleClick(e, \"pin\", rc);         break;       case IMAGE_PREFIX_GHOST:         ctx.handleClick(e, \"image\", rc);         break;       default: {         \/\/ ctx.setTool(null);       }     }   } };  export const MEInitialGlobalObject: MapEvents = {   handleClick: function (e, type, rc) {     if (rc) {       if (this.contextmenu[type]) {         this.tool = type;         this.contextmenu[type](e);       }     } else {       if (this.click[type]) {         this.tool = type;         this.click[type](e);       }     }   },    handleEvent: function (e, handler) {     runEvent(e, handler, this);   },   handleMTEvent: function (e, handler) {     runEvent(e, handler, this);   },   handleMTWEvent: function (e, handler) {     runEvent(e, handler, this);   },    contextmenu: {},   click: {},    mousedown: {},   mouseup: {},   mousemove: {},   mouseenter: {},   mouseleave: {},   mouseout: {},   mouseover: {},    drag: {},   dragend: {},   dragstart: {},    move: {},   moveend: {},   movestart: {},    zoom: {},   zoomend: {},   zoomstart: {},    tool: null,   map: {     \/\/ @ts-ignore     current: null,   },   init: function (Map) {     this.map.current = Map.current;      if (!this.inited) {       this.inited = true;        this.click.stock = (e: MapMouseEvent) =&gt; {         clickChecker(e,<\/code><\/pre>\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-459981","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/459981","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=459981"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/459981\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=459981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=459981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=459981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}