summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--loleaflet/src/layer/tile/CalcTileLayer.js5
-rw-r--r--loleaflet/src/layer/tile/CanvasTileLayer.js10
2 files changed, 13 insertions, 2 deletions
diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js
index a178a59da..417cf0e16 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -4,7 +4,8 @@
*/
/* global */
-L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer).extend({
+var BaseTileLayer = L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer;
+L.CalcTileLayer = BaseTileLayer.extend({
options: {
// TODO: sync these automatically from SAL_LOK_OPTIONS
sheetGeometryDataEnabled: true,
@@ -81,7 +82,7 @@ L.CalcTileLayer = (L.Browser.mobile ? L.TileLayer : L.CanvasTileLayer).extend({
map.addControl(L.control.tabs());
map.addControl(L.control.columnHeader());
map.addControl(L.control.rowHeader());
- L.TileLayer.prototype.onAdd.call(this, map);
+ BaseTileLayer.prototype.onAdd.call(this, map);
map.on('resize', function () {
if (this.isCursorVisible()) {
diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js b/loleaflet/src/layer/tile/CanvasTileLayer.js
index 70f6c8a36..ba74b2c4c 100644
--- a/loleaflet/src/layer/tile/CanvasTileLayer.js
+++ b/loleaflet/src/layer/tile/CanvasTileLayer.js
@@ -373,6 +373,16 @@ L.CanvasTileLayer = L.TileLayer.extend({
return false;
},
+ onAdd: function (map) {
+
+ // Override L.TileLayer._tilePixelScale to 1 (independent of the device).
+ this._tileWidthPx = this.options.tileSize;
+ this._tileHeightPx = this.options.tileSize;
+ this._tilePixelScale = 1;
+
+ L.TileLayer.prototype.onAdd.call(this, map);
+ },
+
onRemove: function (map) {
this._painter.dispose();
L.TileLayer.prototype.onRemove.call(this, map);