OpenLayers OpenLayers

Ticket #1843 (closed task: fixed)

Opened 1 year ago

Last modified 1 year ago

Format.SLD cleanup

Reported by: ahocevar Assigned to: tschaub
Priority: minor Milestone: 2.8 Release
Component: Format.SLD Version: 2.7
Keywords: Cc: adube@mapgears.com
State: Complete

Description

The ND for Format.SLD contains no documentation of the structure of the SLD object that OpenLayers uses. This got lost with r6645.

Also, Format/SLD/v1.js still contains the methods readChildNodes, writeNode, createElementNSPlus and setAttributes. Those are now part of Format/XML.js and should be no longer needed here.

Finally, there is a getNamespacePrefix method in there which would also be a candidate for moving into Format/XML.js.

Attachments

sld.patch (23.5 kB) - added by tschaub on 01/29/09 17:08:34.
updates to sld format
1843-r8816-A0.patch (23.9 kB) - added by ahocevar on 02/03/09 18:33:17.
updated patch that can be applied to current trunk

Change History

01/29/09 17:08:34 changed by tschaub

  • attachment sld.patch added.

updates to sld format

01/29/09 17:17:33 changed by tschaub

  • status changed from new to assigned.
  • state set to Review.

What this patch does:

  1. In tests/SLD/v1_0_0.html correct argument order now that writeNode is inherited from the XML format.
  2. In Format/SLD/v1.js simplify dependencies and more formally inherit from the filter format (v1.0.0). This simplifies the constructor and makes the correct readers and writers available on the prototype (lest anyone else want to create a format using them).
  3. In Format/SLD/v1.js correct argument order for writeNode (now from XML format).
  4. In Format/SLD/v1.js get rid of getNamespacePrefix. This was inefficient and not well thought out.
  5. In Format/SLD/v1.js get rid of methods now on XML format.
  6. In OpenLayers.js reorder loading to reflect inheritance.

This depends on #1790 (tests will not pass without those changes).

PS - My thoughts on the documentation bit is that that can come at any time (and should not block this ticket). Also, we may want to review the structure of the returned object before committing to it in docs.

01/30/09 11:34:24 changed by tschaub

  • summary changed from Format.SLD documentation and cleanup to Format.SLD cleanup.

02/03/09 09:17:01 changed by adube

tests with latests patches of #1918 #1843 and #1790 all together results only in one error in IE7 :

Control/OverviewMap.html: fail 1 ok 2 (detailed: fail 1 ok 17) test_control_events fail 1 ok 9 fail Dragging on the Overview Map has the correct effect on map lat. eq: values differ: got 42.09375, but expected 42.09765625

Did not get this error with current trunk.

02/03/09 09:17:28 changed by adube

  • cc set to adube@mapgears.com.

02/03/09 10:02:35 changed by adube

tests with latests patches of #1918 #1843 and #1790 all together results only in one error in IE6 :

  • Same error as IE7. This error is not related to theses patches.
  • Error from Control/ScaleLine. I also got this from my clean trunk and crschmidt said he got a clean IE6 test on his side so we can ignore this.

Result : IE6 = OK

02/03/09 18:33:17 changed by ahocevar

  • attachment 1843-r8816-A0.patch added.

updated patch that can be applied to current trunk

02/03/09 18:35:29 changed by ahocevar

  • state changed from Review to Commit.

Thanks Tim for your efforts on this one. The code looks good, I had to make minor mods to apply it to current trunk (1843-r8816-A0.patch). Tests of the new patch pass in FF3 and IE7. Please commit.

02/03/09 19:53:59 changed by tschaub

  • status changed from assigned to closed.
  • state changed from Commit to Complete.
  • resolution set to fixed.

(In [8817]) Refactor SLD format a bit to use methods from XML format. The SLD format (v1.0) now inherits from the filter format (v1.0.0). r=ahocevar (closes #1843)