-
Notifications
You must be signed in to change notification settings - Fork 75
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
Update examples. #743
Update examples. #743
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 |
---|---|---|
|
@@ -1416,16 +1416,23 @@ module.exports = (function () { | |
var map = this.map(), | ||
mapzoom = map.zoom(), | ||
roundzoom = this._options.tileRounding(mapzoom), | ||
unit = map.unitsPerPixel(zoom === undefined ? roundzoom : zoom); | ||
unit = map.unitsPerPixel(zoom === undefined ? roundzoom : zoom), | ||
gcsPt; | ||
if (pt === undefined) { | ||
var size = map.size(); | ||
pt = {x: size.width / 2, y: size.height / 2}; | ||
} | ||
/* displayToGcs can fail under certain projections. If this happens, | ||
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. how can we replicate this behavior in our current version? 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. just curious but agree on the statement 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. In the reprojection example, choose a projection that curves at the edges, (ESRI:53009 or any Mollweide will work). Zoom out. If you zoomed out far enough, this code path is triggered. 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. Got it, thanks. |
||
* just return the origin. */ | ||
try { | ||
gcsPt = map.displayToGcs(pt, this._options.gcs || null); | ||
} catch (err) { | ||
gcsPt = {x: 0, y: 0}; | ||
} | ||
/* Reverse the y coordinate, since we expect the gcs coordinate system | ||
* to be right-handed and the level coordinate system to be | ||
* left-handed. */ | ||
var gcsPt = map.displayToGcs(pt, this._options.gcs || null), | ||
lvlPt = {x: gcsPt.x / unit, y: this._topDown() * gcsPt.y / unit}; | ||
var lvlPt = {x: gcsPt.x / unit, y: this._topDown() * gcsPt.y / unit}; | ||
return lvlPt; | ||
}; | ||
|
||
|
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.
+1