try different vector overdraw amounts for different setups

- canvas - overheads directly related to the number of drawn items, so limited overdraw
- svg desktop - can handle large amounts of overdraw ok, so allow 100%, so known items don't vanish during most map panning
- svg mobile - mobile struggles more, so limit svg overdraw
This commit is contained in:
Jon Atkins 2014-07-07 17:42:29 +01:00
parent 8434639be7
commit 69f3fb211b

View File

@ -155,6 +155,19 @@ window.setupMap = function() {
bounceAtZoomLimits: false bounceAtZoomLimits: false
}); });
if (L.Path.CANVAS) {
// for canvas, 2% overdraw only - to help performance
L.Path.CLIP_PADDING = 0.02;
} else if (L.Path.SVG) {
if (L.Browser.mobile) {
// mobile SVG - 10% ovredraw. might help performance?
L.Path.CLIP_PADDING = 0.1;
} else {
// for svg, 100% overdraw - so we have a full screen worth in all directions
L.Path.CLIP_PADDING = 1.0;
}
}
// add empty div to leaflet control areas - to force other leaflet controls to move around IITC UI elements // add empty div to leaflet control areas - to force other leaflet controls to move around IITC UI elements
// TODO? move the actual IITC DOM into the leaflet control areas, so dummy <div>s aren't needed // TODO? move the actual IITC DOM into the leaflet control areas, so dummy <div>s aren't needed
if(!isSmartphone()) { if(!isSmartphone()) {