-
Notifications
You must be signed in to change notification settings - Fork 769
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
Graticule control improvements #1375
Conversation
hey @ahocevar I am testing this out but seeing some strange behaviour, missing graticule lines. See attached 2 screenshots (before and after): |
@bartvde These missing lines are expected, because they have points outside the map's maxExtent. |
This also introduces a new worldExtent option to the projection defaults.
This also adds a graticule control to the polar-projections example.
ba0c3d2
to
08d8c5a
Compare
I revisited this pull request and ended up more or less rewriting |
a313825
to
b6901ac
Compare
b6901ac
to
41ae609
Compare
|
||
OpenLayers.Projection.defaults["EPSG:42304"] = { | ||
maxExtent: [-2200000,-712631,3072800,3840000], | ||
worldExtent: [-180, 30, 180, 90], |
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 don't know much about EPSG:42304 but can you explain how you get to the value of 30 here?
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.
A leftover from playing around. I changed it to 0, which is kind of obvious for polar projections.
not sure if it needs to be addressed in this PR, but the dmsolutions WMS is not working anymore |
|
||
/** | ||
* Property: projectionCenterLonLat | ||
* {OpenLayers.LonLat} The center of the projection's validty extent. |
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.
validity
It is still up, but not very responsive. |
this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(labelPos,labelAttrs)); | ||
|
||
lat = Math.max(centerLat, this.minLat); | ||
lat = Math.min(centerLat, this.maxLat); |
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.
something seems amiss here in these two lines (same local variable assigned twice)
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.
Good call. Thanks for spotting this.
f194ab6
to
ea879e7
Compare
* minLat - {number} Minimum latitude. | ||
* maxLat - {number} Maximum latitude. | ||
* squaredTolerance - {number} Squared tolerance. | ||
* extent - {OpenLayers.Geometry.Polygon} Extent. |
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.
name does not match function param name
very impressive work @ahocevar I've put a few minor comments |
Credit also goes to @elemoine, because the new static functions in |
Graticule control improvements
Assuming that the map's maxExtent does not exceed the validity extent of the map projection, we can avoid invalid graticule grid points by limiting the graticule to the map's maxExtent. Currently we use the viewport extent, which may exceed the maxExtent, and thus can cause invalid point transforms beyond the validity extent of the projection.