diff --git a/core/code/map.js b/core/code/map.js index a18443d76..c79baef8a 100644 --- a/core/code/map.js +++ b/core/code/map.js @@ -316,6 +316,32 @@ window.setupMap = function () { map.attributionControl.setPrefix(''); + /** + * Override default Google Maps attribution to use Leaflet's native attribution control + * instead of creating separate DOM elements. Extracts text content from Google's + * attribution container and adds it to Leaflet's control. + */ + L.GridLayer.GoogleMutant.prototype._setupAttribution = function (ev) { + if (!this._map?.attributionControl) { + return; + } + // eslint-disable-next-line + const pos = google.maps.ControlPosition; + const container = ev.positions.get(pos.BOTTOM_RIGHT); + const attribution = container?.querySelector('span')?.textContent; + if (attribution) { + this._attributionText = attribution; // Сохраняем текст атрибуции + this._map.attributionControl.addAttribution(attribution); + } + }; + const originalGoogleMutantOnRemove = L.GridLayer.GoogleMutant.prototype.onRemove; + L.GridLayer.GoogleMutant.prototype.onRemove = function (map) { + originalGoogleMutantOnRemove.call(this, map); + if (this._attributionText && map.attributionControl) { + map.attributionControl.removeAttribution(this._attributionText); + } + }; + window.map = map; map.on('moveend', function () { diff --git a/core/code/portal_detail_display.js b/core/code/portal_detail_display.js index 9c2489b7e..422befd44 100644 --- a/core/code/portal_detail_display.js +++ b/core/code/portal_detail_display.js @@ -161,9 +161,6 @@ window.renderPortalDetails = function (guid, forceSelect) { .text('X') .click(function () { window.renderPortalDetails(null); - if (window.isSmartphone()) { - window.show('map'); - } }), // help cursor via ".imgpreview img" diff --git a/core/code/portal_highlighter.js b/core/code/portal_highlighter.js index c40f6c8bb..0156d2454 100644 --- a/core/code/portal_highlighter.js +++ b/core/code/portal_highlighter.js @@ -61,12 +61,10 @@ window.updatePortalHighlighterControl = function () { if (window._highlighters !== null) { if ($('#portal_highlight_select').length === 0) { - $('body').append(""); + $('.leaflet-top.leaflet-left').first().append(""); $('#portal_highlight_select').change(function () { window.changePortalHighlights($(this).val()); }); - $('.leaflet-top.leaflet-left').css('padding-top', '20px'); - $('.leaflet-control-scale-line').css('margin-top', '25px'); } $('#portal_highlight_select').html(''); $('#portal_highlight_select').append($('