On Fri, Apr 20, 2012 at 8:40 PM, Michael Bedward
<[email protected]>wrote:
> Hello Ian,
>
> The seemingly odd behaviour you are seeing is because MapViewport does
> not centre the map bounds inside the screen bounds by default when
> calculating its AffineTransforms. In your case you have map and screen
> bounds with different aspect ratios so you are getting non-intuitive
> output.
>
> Add the following line to your code:
>
> mc.getViewport().setMatchingAspectRatio(true);
>
> You should then get the result that you are expecting (let me know if
> you don't).
>
> MapViewport was written to have this default behaviour to honour
> GeoServer / WFS conventions (sorry - can't quite remember the details
> now but Andrea Aaime can provide more info if needed).
>
>
It's not a GeoServer specific convention, the OGC WMS specification says
that the server should always respond with the aspect ratio specified by
the user manually by setting the bbox, width and height of the request,
if the user specified ratio is skewed the server should still honor it.
A server that tries to fix the bbox or width/height to get a 1:1 aspect
ratio
is not compliant according to the OGC spec.
Cheers
Andrea
--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
-------------------------------------------------------
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users