commit 9b0c9e87751e16ec3b1f33e52424e9bc464ebcb0
parent f6c91155f8941bf709e49b1492fb2ad9a472fdc5
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Fri, 31 Mar 2017 00:12:52 +0300
[print/canvas-markers] removed option to select markers for render without paddings -- it doesnot work this way
Diffstat:
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/lib/leaflet.layer.canvasMarkers/index.js b/src/lib/leaflet.layer.canvasMarkers/index.js
@@ -159,16 +159,16 @@ L.Layer.CanvasMarkers = L.GridLayer.extend({
return canvas;
},
- selectMarkersForDraw: function({tileN, tileS, tileE, tileW}, zoom, withPaddings) {
+ selectMarkersForDraw: function({tileN, tileS, tileE, tileW}, zoom) {
// FIXME: padding should depend on options.iconScale and fontSize
if (!this._map) {
return {};
}
const
- iconsHorPad = withPaddings ? 520 : 0,
- iconsVertPad = withPaddings ? 50 : 0,
- labelsHorPad = withPaddings ? 256 : 0,
- labelsVertPad = withPaddings ? 20 : 0;
+ iconsHorPad = 520,
+ iconsVertPad = 50,
+ labelsHorPad = 256,
+ labelsVertPad = 20;
const
iconsBounds = L.latLngBounds(
this._map.unproject(L.point(tileW - iconsHorPad, tileS + iconsHorPad), zoom),
@@ -314,7 +314,7 @@ L.Layer.CanvasMarkers = L.GridLayer.extend({
tileS = tileN + tileSize,
tileE = tileW + tileSize;
const pixelExtents = {tileN, tileS, tileE, tileW};
- const {iconUrls, markerJobs, pointsForLabels} = this.selectMarkersForDraw(pixelExtents, zoom, true);
+ const {iconUrls, markerJobs, pointsForLabels} = this.selectMarkersForDraw(pixelExtents, zoom);
if (!markerJobs) {
return;
}
diff --git a/src/lib/leaflet.layer.rasterize/CanvasMarkers.js b/src/lib/leaflet.layer.rasterize/CanvasMarkers.js
@@ -46,7 +46,7 @@ L.Layer.CanvasMarkers.include({
this._map = dummyMap;
}
const zoom = crs.zoom((1 / scale) * crs.scale(printOptions.zoom));
- const {iconUrls, markerJobs, pointsForLabels} = this.selectMarkersForDraw(pixelExtents, zoom, false);
+ const {iconUrls, markerJobs, pointsForLabels} = this.selectMarkersForDraw(pixelExtents, zoom);
await this.preloadIcons(iconUrls);
return {
iterateTilePromises: (function*() {