[OpenLayers-Dev] Patrch for getting vector drawing working over
the 180 line going.
Phil Scadden
p.scadden at gns.cri.nz
Sun Aug 15 20:24:11 EDT 2010
> The place where dateline handling should be solved for vector features is in the vector renderers, probably in Renderer.drawFeature. There you should check if the currently visible extent crosses the date line, and process x coordinates of the geometries that are about to be drawn - just like you do now in the handlers.
>
Okay, I have looked further into this.
At some point, the geometry has to be adjusted so it draws properly. The
world coordinates arent converted to screen coordinate until down into
the SVG layer. It would seem that this is an inappropriate place to deal
with the 180 because it is renderer dependent.
Better would seem to be in drawGeometry in Elements.js because then can
fix once for a range of different geometries. A side effect would be
that adjusted geometry is being fed to the indexer, what that does.
Slightly further up would be in drawFeature of Renderer.js. One
possibility here would be that if geometry needs adjustment, then we can
clone features.geometry, adjust the clone and pass that to drawGeometry
leaving the original geometry untouched. I am not sure that is as
efficient as fixing the geometry just first time it is rendered.
For the moment, I am looking at fiddling the 180 in drawFeature and
hoping that doesnt impact the indexer.
--
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 Dev
mailing list