Skip to content
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

Merged
merged 12 commits into from
Oct 17, 2014
Merged

Conversation

ahocevar
Copy link
Member

@ahocevar ahocevar commented Aug 8, 2014

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.

@bartvde
Copy link
Member

bartvde commented Aug 22, 2014

hey @ahocevar I am testing this out but seeing some strange behaviour, missing graticule lines. See attached 2 screenshots (before and after):

screen shot 2014-08-22 at 10 32 11
screen shot 2014-08-22 at 10 32 07

@ahocevar
Copy link
Member Author

ahocevar commented Sep 3, 2014

@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.
@ahocevar
Copy link
Member Author

I revisited this pull request and ended up more or less rewriting OpenLayers.Control.Graticule. See the release notes for a description of the user facing changes resulting from the rewrite.


OpenLayers.Projection.defaults["EPSG:42304"] = {
maxExtent: [-2200000,-712631,3072800,3840000],
worldExtent: [-180, 30, 180, 90],
Copy link
Member

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?

Copy link
Member Author

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.

@bartvde
Copy link
Member

bartvde commented Oct 16, 2014

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validity

@ahocevar
Copy link
Member Author

not sure if it needs to be addressed in this PR, but the dmsolutions WMS is not working anymore

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);
Copy link
Member

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)

Copy link
Member Author

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.

* minLat - {number} Minimum latitude.
* maxLat - {number} Maximum latitude.
* squaredTolerance - {number} Squared tolerance.
* extent - {OpenLayers.Geometry.Polygon} Extent.
Copy link
Member

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

@bartvde
Copy link
Member

bartvde commented Oct 16, 2014

very impressive work @ahocevar I've put a few minor comments
👍

@ahocevar
Copy link
Member Author

Credit also goes to @elemoine, because the new static functions in OpenLayers.Geometry.LineString are a backport from ol3 of his great geodesic geometry creation functions with adaptive quantization.

ahocevar added a commit that referenced this pull request Oct 17, 2014
@ahocevar ahocevar merged commit c492588 into openlayers:master Oct 17, 2014
@ahocevar ahocevar deleted the graticule-fixes branch October 17, 2014 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants