OpenLayers OpenLayers

Ticket #1035 (closed feature: fixed)

Opened 1 year ago

Last modified 1 year ago

OpenLayers.Projection class, methods for accessing via Map

Reported by: crschmidt Assigned to:
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 (9.6 kB) - added by crschmidt on 09/30/07 12:59:17.
projection patch that does nothing
projections.2.patch (11.0 kB) - added by tschaub on 10/22/07 12:07:18.
support for Projections class
projections.3.patch (6.6 kB) - added by crschmidt on 12/13/07 18:16:59.

Change History

09/30/07 12:59:17 changed by crschmidt

  • attachment projections.patch added.

projection patch that does nothing

09/30/07 13:01:11 changed by crschmidt

  • keywords set to review.

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

Please review.

10/19/07 13:55:11 changed 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.

10/22/07 11:35:12 changed 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).

10/22/07 11:37:37 changed 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.

10/22/07 12:07:18 changed by tschaub

  • attachment projections.2.patch added.

support for Projections class

10/22/07 12:13:58 changed 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.

12/13/07 18:16:59 changed by crschmidt

  • attachment projections.3.patch added.

12/13/07 18:29:18 changed by crschmidt

  • keywords deleted.
  • 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)

12/14/07 00:29:20 changed by elemoine

  • status changed from closed to reopened.
  • resolution deleted.

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

12/14/07 03:18:39 changed by fredj

lib/OpenLayers/Projection.js is also missing.

12/14/07 03:36:36 changed 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)

12/16/07 17:45:29 changed by tschaub

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