<HTML dir=ltr><HEAD><TITLE>Re: [OpenLayers-Dev] Map Rotation</TITLE>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18852"></HEAD>
<BODY>
<DIV dir=ltr id=idOWAReplyText26140>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial>Thanks to everyone for all the great feedback on this topic.</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=Arial>I have one thing to add/ask.</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial>In our case we only need to support a map with north pointing east (we don't need to support a user defined rotation for example).</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=Arial>Could one possibly solve this problem by using a custom map projection?&nbsp; </FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial>If we needed to have north point&nbsp;east couldn't we use something like a transversal rotation of 90 degrees.&nbsp; </FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial>Would all we&nbsp;have to do then is build the appropriate Proj.4/Proj.4js files to support something like that?</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=Arial>What do you think?</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=Arial>-Alexei</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT>&nbsp;</DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Gregers Gram Rygg [mailto:gregersrygg@gmail.com]<BR><B>Sent:</B> Mon 12/21/2009 6:02 AM<BR><B>To:</B> Christopher Schmidt<BR><B>Cc:</B> Alexei Peters; dev@openlayers.org<BR><B>Subject:</B> Re: [OpenLayers-Dev] Map Rotation<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>On Thu, Dec 17, 2009 at 11:41 PM, Christopher Schmidt<BR>&lt;crschmidt@metacarta.com&gt; wrote:<BR>&gt; &nbsp;1. In Javascript/Images/DOM (ignoring Canvas for the moment), there is<BR>&gt; &nbsp; &nbsp;no way to make an image exist on an angle.<BR><BR>That depends on what browsers you want to support ;) Most major<BR>browsers now have support for CSS3 transformations that allow us to<BR>rotate to any angle on the client side. Safari, Firefox, Chrome, and a<BR>fall-back option for IE. Hopefully we could find a way to detect the<BR>transform-capability by checking currentStyle or similar, and only<BR>show the control for supported browsers.<BR><BR>I guess we still have to re-write some parts of OpenLayers. Like how<BR>to calculate the map extent, modify getLonLatFromViewPortPx, rewrite<BR>the layers to resize/load tiles when rotated, etc... but we'll get the<BR>caching-benefits of tiling. And we don't have to do anything server<BR>side. Except for labels :/ Which I guess might be a show stopper for<BR>some. Theoretically I guess it would be possible to have several<BR>rotated label-layers, and let the controller decide which is closest<BR>to the current rotation. I.e. label-layer rotated (on map-server) to<BR>North, East, South and West. Then the labels would never be more than<BR>45 degrees off. Another option could be to add labels client-side. But<BR>I don't know much about map-servers, so I'll leave that for others to<BR>discuss.<BR><BR>WebKit (-webkit-transform) has supported rotations for a while:<BR><A href="http://developer.apple.com/safari/library/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Transforms/Transforms.html">http://developer.apple.com/safari/library/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Transforms/Transforms.html</A><BR><BR>Firefox got -moz-transform in 3.5:<BR><A href="http://developer.mozilla.org/En/CSS/Using_CSS_transforms">http://developer.mozilla.org/En/CSS/Using_CSS_transforms</A><BR><BR>Fall-back for IE (filters *ugh*), but it should work. MIT/GPL, so<BR>could easily be ported to fit OpenLayers:<BR><A href="http://paulbakaus.com/2008/08/16/bringing-css-transform-to-internet-explorer/">http://paulbakaus.com/2008/08/16/bringing-css-transform-to-internet-explorer/</A><BR><BR>Couldn't find any info about Opera, but they're working on CSS3, and<BR>transformations is in the CSS3 draft<BR>(<A href="http://www.w3.org/TR/css3-2d-transforms/">http://www.w3.org/TR/css3-2d-transforms/</A>). So I guess it's only a<BR>matter of time.<BR><BR>Just a wild thought...<BR>Merry Christmas to everyone!<BR><BR>Gregers<BR></FONT></P></DIV></BODY></HTML>