-
Notifications
You must be signed in to change notification settings - Fork 34
TILES-6268 preview tiles for ios #594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -368,7 +388,8 @@ L.MobileTileLayer = L.TileLayer.extend({ | |||
| var needPreview = this._needPreviewTile(wrapCoords); | |||
|
|
|||
| var url = needPreview ? this._previewUrl : this._url; | |||
There was a problem hiding this comment.
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); можно впасть в заблуждение, подумав, что показ превью определяется исплючительно тем, айфон у тебя или нет. А это не так.
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У тебя эта проверка сейчас выполняется при добавлении каждого тайла (в методе addTile()), что избыточно. Сделай ее один раз, результат запиши во флажок и пользуйся в методе addTile() флажком.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
No description provided.