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.
Polygon.js
Description: JavaScript source
Path.js
Description: JavaScript source
_______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev
