[OpenLayers-Users] Dateline WMS & vector drawing issue

Phil Scadden p.scadden at gns.cri.nz
Thu May 19 17:43:48 EDT 2011


Welcome to the world of endless frustration. Who would have thought that 
in the 21st century, programmers were still living on a flat earth. Back 
engineering to fix this flat earth philosophy is a mega hassle and you 
must be careful not to break use of mapping on non-earth applications, 
ha ha. However...
> first problem:
> The measuring (and drawing) over the dateline does not work. There was
> an issue about exactly the same problem last august on the dev-List with
> an attached kind of "patch", but that one does not work properly
> (http://lists.osgeo.org/pipermail/openlayers-dev/2010-August/006360.html)
> and causes funny behavings.
I think I have more code patched in similar ways than are in that 
patches, however there are other tricks that you need too.
Assuming you have put in ALL the patches associated with that ticket 
2782, http://trac.osgeo.org/openlayers/ticket/2787, then your 
measureControl should also look like:
      measureDistanceControl = new OpenLayers.Control.Measure(
                                     OpenLayers.Handler.Path, {
                                                 persist: true,
                                                 geodesic: true,
                                                 handlerOptions: {
                                                         layerOptions: 
{styleMap: drawStyleMap},
                                                     citeCompliant :false
                                                 }
                                     }
          );
      measureDistanceControl.events.on({
                                         "measure": processMeasurements,
                                         "measurepartial": 
processMeasurements
      });
      measureAreaControl = new OpenLayers.Control.Measure(
                                         OpenLayers.Handler.Polygon, {
                                                 persist: true,
                                                 geodesic:true,
                                                 handlerOptions: {
                                                         layerOptions: 
{styleMap: drawStyleMap},
                                                     citeCompliant :false
                                                 }
                                         }
                                        );
     measureAreaControl.events.on({
                                     "measure": processMeasurements,
                                      "measurepartial": processMeasurements
                                  });

ie note geodesic= true, citeCompliant=false. In fact, make sure you have 
these set for any of your path handlers (eg whatever you use in 
DrawFeature).

If this still isnt working, then contact me, as I may have more patches. 
Note also that these patches havent made it to 2.11, - I simply havent 
had the time to learn the test environment and make tests.
> Also the WMS-layers are not drawn over the dateline. We worked with the
> "wrap dateline" parameter, but using this requires tiling and tiling
> causes much more requests and images to be loaded by the client. We have
> about 30-40 WMS in the application. A tiling will slow down the
> application (especially the client) and at least lets crash slow
> browsers like IE8 (indeed - IE9 is a lot faster).
I havent really figured out what wrapdateline is supposed to do but 
mostly it turns maps into wierdness with vector layers repeated out of 
place. The biggest problem however seems to be having a wms server that 
understands the dateline. Geoserver 2.1 and a patched version of 
geoserver 2.02 are supposed to. I havent got 2.1 up yet but the patch 
only sort of worked with a great deal of odd behaviour around polygons 
that cross the dateline (depending on native projection) and tiles that 
cut in and out depending on whether dateline is to east or west of your 
screen midpoint. I'm not convinced yet that this isnt an openlayers bug. 
I even requested quote from geosolutions for fixing bug in geoserver but 
they have been very slow coming back.

We had decided to defer this issue till geoserver 2.1 came out and then 
work out precisely where blame lies and try and fix it ourselves. We are 
in process of getting geoserver 2.1 up (glacial IT processes not 
helping). Other WMS servers dont seem better. We've been screaming at 
ESRI about 180 line since oh about ArcInfo version 4 (when we became 
customers). Some things work but google projection isnt one of them at 
least in 9.2. The last comment we had from them implied that since web 
mercator didnt have envelopes, it would never work on 180 line. At the 
point we dropped it and moved to geoserver which offered some hope and 
we could get the source.

The very best of luck and I am ready to help in any way I can. Feel free 
to email direct.
-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.



More information about the Users mailing list