[OpenLayers-Dev] Map Rotation

Andrea Aime aaime at opengeo.org
Fri Dec 18 05:38:55 EST 2009

Stephen Woodbridge ha scritto:
> Christopher Schmidt wrote:
>> On Thu, Dec 17, 2009 at 02:39:41PM -0800, Alexei Peters wrote:
>>> Hi Everyone,
>>> I currently work for a small GIS consulting firm and one of the projects we're currently working on has a potential requirement for rotating the map (so north doesn't point up, but rather to the right for example).
>>> Has anyone any idea of how to do this, or has done this?  My company would be even willing to fund this effort if need be.
>>> I'd love to hear anyone's thoughts on this.
>>  1. In Javascript/Images/DOM (ignoring Canvas for the moment), there is 
>>     no way to make an image exist on an angle.
>>  2. Canvas has some support for this, I believe, but is limited in where
>>     you can use it.
>> Generally speaking, what you would do to solve this problem would be to
>> pre-rotate your map (in a tool like photoshop, or something equally non
>> OpenLayers related), and then work with at that point. Some people on
>> the list have had some experience with that way of using OpenLayers; a 
>> key aspect of this would be to write a translation from your map coordinates
>> (which will likely be in pixels after the rotation) to geogrpahic coordinates,
>> but that's not too hard, in general.
>> Best Regards,
> If you are using mapserver I believe there has been some work that would 
> allow the image to draw with north rotated say to the east. Look for the 
> ANGLE parameter in the MAP object.

In GeoServer land we're about to add the same parameter.
However, once you rotate the map OL has to know and handle the rotation
otherwise panning and zooming go bye bye...


Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

More information about the Dev mailing list