loleaflet: Don't create the message if not necessary.
This commit is contained in:
parent
d8741d5ec3
commit
538c1f571d
1 changed files with 9 additions and 9 deletions
|
@ -817,16 +817,16 @@ L.GridLayer = L.Layer.extend({
|
|||
}
|
||||
|
||||
if (!this._tileCache[key]) {
|
||||
var twips = this._coordsToTwips(coords);
|
||||
var msg = 'tile ' +
|
||||
'part=' + coords.part + ' ' +
|
||||
'width=' + this._tileSize + ' ' +
|
||||
'height=' + this._tileSize + ' ' +
|
||||
'tileposx=' + twips.x + ' ' +
|
||||
'tileposy=' + twips.y + ' ' +
|
||||
'tilewidth=' + this._tileWidthTwips + ' ' +
|
||||
'tileheight=' + this._tileHeightTwips;
|
||||
if (coords.part === this._selectedPart) {
|
||||
var twips = this._coordsToTwips(coords);
|
||||
var msg = 'tile ' +
|
||||
'part=' + coords.part + ' ' +
|
||||
'width=' + this._tileSize + ' ' +
|
||||
'height=' + this._tileSize + ' ' +
|
||||
'tileposx=' + twips.x + ' ' +
|
||||
'tileposy=' + twips.y + ' ' +
|
||||
'tilewidth=' + this._tileWidthTwips + ' ' +
|
||||
'tileheight=' + this._tileHeightTwips;
|
||||
this._map._socket.sendMessage(msg, key);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue