Skip to content

Conversation

@Nortren
Copy link
Contributor

@Nortren Nortren commented Jun 6, 2025

No description provided.

@Nortren
Copy link
Contributor Author

Nortren commented Jun 6, 2025

Для тестировании новой механики нужно посмотреть билд с новой реализацией fixIphone (нужно проверить на IPhone и посмотреть как сейчас себя ведёт Android телефоны)
Сборка с 4.0.5 в которой эта проблема видна в рарити

@@ -368,7 +388,8 @@ L.MobileTileLayer = L.TileLayer.extend({
var needPreview = this._needPreviewTile(wrapCoords);

var url = needPreview ? this._previewUrl : this._url;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы как-то вот так выразил.

var url = needPreview && !this._isAppleDevice() ? this._previewUrl : this._url;

Потому как когда читаешь строчку ниже - var tile = this.createTile(wrapCoords, L.bind(showPreviewForIphone ? this._previewReady : this._tileReady, this, coords), url); можно впасть в заблуждение, подумав, что показ превью определяется исплючительно тем, айфон у тебя или нет. А это не так.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут от showPreviewForIphone выбирается какой бинд выпооняется, я пока так оставил , если ты не против

return true;
},

_isAppleDevice: function() {
Copy link
Contributor

@itanka9 itanka9 Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У тебя эта проверка сейчас выполняется при добавлении каждого тайла (в методе addTile()), что избыточно. Сделай ее один раз, результат запиши во флажок и пользуйся в методе addTile() флажком.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Nortren Nortren merged commit 4fb359e into master Jun 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants