Skip to content

Commit

Permalink
migrate splitter lines to canvas overlay section
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Francis <[email protected]>
Change-Id: I983eedbb946d640498e63660e948d09dd838f2b1
  • Loading branch information
dennisfrancis committed Mar 4, 2021
1 parent a08b708 commit 675963f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 189 deletions.
1 change: 0 additions & 1 deletion loleaflet/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ LOLEAFLET_JS =\
src/geometry/PolyUtil.js \
src/layer/vector/Polygon.js \
src/layer/vector/Rectangle.js \
src/layer/vector/SplitterLine.js \
src/layer/vector/CircleMarker.js \
src/layer/vector/Circle.js \
src/layer/vector/SVG.js \
Expand Down
33 changes: 21 additions & 12 deletions loleaflet/src/layer/tile/CanvasTileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* L.CanvasTileLayer is a L.TileLayer with canvas based rendering.
*/

/* global L CanvasSectionContainer CanvasOverlay */
/* global L CanvasSectionContainer CanvasOverlay CSplitterLine */

L.TileCoordData = L.Class.extend({

Expand Down Expand Up @@ -656,14 +656,13 @@ L.CanvasTileLayer = L.TileLayer.extend({
},

_removeSplitters: function () {
var map = this._map;
if (this._xSplitter) {
map.removeLayer(this._xSplitter);
this._canvasOverlay.removePath(this._xSplitter);
this._xSplitter = undefined;
}

if (this._ySplitter) {
map.removeLayer(this._ySplitter);
this._canvasOverlay.removePath(this._ySplitter);
this._ySplitter = undefined;
}
},
Expand Down Expand Up @@ -1541,13 +1540,18 @@ L.CanvasTileLayer = L.TileLayer.extend({
var map = this._map;

if (!this._xSplitter) {
this._xSplitter = new L.SplitterLine(
map, { isHoriz: true });
this._xSplitter = new CSplitterLine(
map, {
color: '#e0e0e0',
opacity: 1,
weight: Math.round(3 * this._painter._dpiScale),
isHoriz: true
});

map.addLayer(this._xSplitter);
this._canvasOverlay.initPath(this._xSplitter);
}
else {
this._xSplitter.update();
this._xSplitter.onPositionChange();
}
},

Expand All @@ -1556,13 +1560,18 @@ L.CanvasTileLayer = L.TileLayer.extend({
var map = this._map;

if (!this._ySplitter) {
this._ySplitter = new L.SplitterLine(
map, { isHoriz: false });
this._ySplitter = new CSplitterLine(
map, {
color: '#e0e0e0',
opacity: 1,
weight: Math.round(3 * this._painter._dpiScale),
isHoriz: false
});

map.addLayer(this._ySplitter);
this._canvasOverlay.initPath(this._ySplitter);
}
else {
this._ySplitter.update();
this._ySplitter.onPositionChange();
}
},

Expand Down
176 changes: 0 additions & 176 deletions loleaflet/src/layer/vector/SplitterLine.js

This file was deleted.

0 comments on commit 675963f

Please sign in to comment.