-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trim height of export requests when necessary #484
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,15 @@ 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 total = this._map.getSize(); | ||
var top = this._map.latLngToLayerPoint(bounds._northEast); | ||
var bottom = this._map.latLngToLayerPoint(bounds._southWest); | ||
|
||
if (top.y > 0 || bottom.y < total.y){ | ||
size.y = total.y - top.y - (total.y - bottom.y); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe reduce this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm still using |
||
} | ||
|
||
var params = { | ||
bbox: [sw.x, sw.y, ne.x, ne.y].join(','), | ||
size: size.x + ',' + size.y, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate of
size
declared earlier.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did that on purpose thinking it made the comparison easier to read, but i'm fine with it the other way too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is I think it reads better without total, but I'm no Leaflet developer.