[OpenLayers-Dev] Patrch for getting vector drawing working over the 180 line going.

Phil Scadden p.scadden at gns.cri.nz
Fri Aug 13 01:03:38 EDT 2010


Following on from Piero's regularpolygon code for drawing across the 180 
line, I have modified path.js and
polygon.js to manage this feat as well. (ATTACHED FILES) My code is 
somewhat simpler. The basic idea is that if the right margin of the map 
have coordinates that are less the left margin of the map, then you have 
a 180 degree line hassle somewhere in there, and the lat/lon returns 
need to be modified. So far so good. This let me use say distance and 
area tools on google maps which include the 180. I still havent mastered 
the box drawing so you can zoom in on an area that includes the 180 
lines somewhere in it.

However, the code is not general. The properties (repeated unnessarily 
in both classes) are for google projection only. Calculating these for 
using the map projection is straightforward so can improve that but 
where should these properties reside? It seems to me from structure of 
openlayers, that they should be map properties but I am somewhat 
reluctant to add to this. Advice from developers please. I would like to 
get this working (including for box) and submitted as a patch.


-- 
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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Polygon.js
Type: application/x-javascript
Size: 5231 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20100813/85fde024/Polygon.js
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Path.js
Type: application/x-javascript
Size: 10310 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20100813/85fde024/Path.js


More information about the Dev mailing list