Skip to content

Commit

Permalink
Merge pull request #484 from jgravois/dyn-align
Browse files Browse the repository at this point in the history
trim height of export requests when necessary
  • Loading branch information
patrickarlt committed Mar 18, 2015
2 parents 18f5a7f + 8f25e91 commit ce2d20f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Layers/DynamicMapLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ EsriLeaflet.Layers.DynamicMapLayer = EsriLeaflet.Layers.RasterLayer.extend({
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 params = {
bbox: [sw.x, sw.y, ne.x, ne.y].join(','),
size: size.x + ',' + size.y,
Expand Down

0 comments on commit ce2d20f

Please sign in to comment.