Ticket #1035 (closed feature: fixed)

Opened 6 years ago

Last modified 5 years ago

OpenLayers.Projection class, methods for accessing via Map

Reported by: crschmidt Owned by:
Priority: major Milestone: 2.6 Release
Component: general Version: SVN
Keywords: Cc:
State:

Description

Create an OpenLayers.Projection class. Add a getProjection method to the map, and have the layer create a projection automatically if one is not passed. Have the units of the map be set by the projection, if available and not provided.

This projection class is a wrapper around proj4js, but the important thing is that it has no effect on anything if proj4js is not available.

Attachments

projections.patch Download (9.6 KB) - added by crschmidt 6 years ago.
projection patch that does nothing
projections.2.patch Download (11.0 KB) - added by tschaub 6 years ago.
support for Projections class
projections.3.patch Download (6.6 KB) - added by crschmidt 5 years ago.

Change History

Changed 6 years ago by crschmidt

projection patch that does nothing

Changed 6 years ago by crschmidt

  • keywords review added

This patch should have absolutely no effect on the library, as is confirmed by running all tests.

Please review.

Changed 6 years ago by tschaub

I think this looks great. The only changes in the second patch are to GeoJSON.js - others are just minor ndocs tweaks.

I'm running out now, will run tests and get to the others later.

Changed 6 years ago by tschaub

The getFullRequestString methods of WMS and WFS layers consider the case where projection == "none". I'm not familiar with this case, so I can't say what we need to do to maintain support for it. But, tests are failing (in WMS, WFS should have a test that fails as well).

Changed 6 years ago by tschaub

The change in functionality here is that you used to be able to do:

var layer = new Constructor(args);
map.addLayer(layer);
layer.projection = "foo";

Now, if you are setting the projection property of a layer to a string, you have to do so *before* it is added to a map.

Changed 6 years ago by tschaub

support for Projections class

Changed 6 years ago by tschaub

Ok, now all tests pass. Patch is updated for changes to GeoJSON.js and to make tests pass for WMS layer. As mentioned above, accepting this patch means that we no longer accept setting projection after adding layers to a map. This is fine by me - but I'm not the strictest of the API cops.

Changed 5 years ago by crschmidt

Changed 5 years ago by crschmidt

  • keywords review removed
  • status changed from new to closed
  • resolution set to fixed

(In [5401]) With a confirmation that Tim is happy considering this a review, I'm going to go ahead and commit this (relatively lighttweight) patch to the code so that the projection library base API is there, even though for the most part, it's not usable yet. This changes map.projection from being a string to being a class, with a projCode on it. (Closes #1035)

Changed 5 years ago by elemoine

  • status changed from closed to reopened
  • resolution fixed deleted

In [5401] list-tests.html was augmented with test_Projection.html while commit didn't include that file.

Changed 5 years ago by fredj

lib/OpenLayers/Projection.js is also missing.

Changed 5 years ago by fredj

  • status changed from reopened to closed
  • resolution set to fixed

(In [5405]) Include tests/test_Projection.html and lib/OpenLayers/Projection.js (taken from projections.2.patch). (Closes #1035)

Changed 5 years ago by tschaub

(In [5441]) single file build broke with r5401 as well - layer now requires OpenLayers.Projection (see #1035)

Note: See TracTickets for help on using tickets.