From 14b59d3e809cdeb1c3e955ab55ffe12951439ea8 Mon Sep 17 00:00:00 2001 From: john gravois Date: Tue, 26 Apr 2016 08:48:39 -0700 Subject: [PATCH] port fix from #484 to L.esri.imageMapLayer (#774) --- src/Layers/ImageMapLayer.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Layers/ImageMapLayer.js b/src/Layers/ImageMapLayer.js index 58ef2c11d..63adcabb6 100644 --- a/src/Layers/ImageMapLayer.js +++ b/src/Layers/ImageMapLayer.js @@ -125,6 +125,15 @@ export var ImageMapLayer = RasterLayer.extend({ var size = this._map.getSize(); var ne = this._map.options.crs.project(bounds._northEast); var sw = this._map.options.crs.project(bounds._southWest); + + // ensure that we don't ask ArcGIS Server for a taller image than we have actual map displaying + var top = this._map.latLngToLayerPoint(bounds._northEast); + var bottom = this._map.latLngToLayerPoint(bounds._southWest); + + if (top.y > 0 || bottom.y < size.y) { + size.y = bottom.y - top.y; + } + var sr = parseInt(this._map.options.crs.code.split(':')[1], 10); var params = {