[OpenLayers-Users] scaleline in lon/lat projection

Andreas Hocevar ahocevar at opengeo.org
Fri Apr 30 11:33:29 EDT 2010


Hi,

On Fri, Apr 30, 2010 at 2:02 PM, Jan Burdziej <jab at umk.pl> wrote:
>> See the discussion in #2600. My new patch adds a getGeodesicPixelSize
>> method to the map. Width and height of the geodesic measurement of this
>> pixel will be different. OpenLayers.INCHES_PER_UNIT is a global constant
>> which should not be changed, because it is just there to convert between
>> different units.
>
> Ok, now I get the point. Although if you think of converting degrees to
> inches or meters I would still argue it is not a constant...

Well, the metric length measurement system is defined based on the
earth's perimeter. And the earth's perimeter is divided up into 360
degrees. So it is a perfect constant as long as you don't measure in
projeted maps.

>> > 3. Do you have any idea whether MapFish will also adopt geodesic scale
>> > bar functionality?
>>
>> MapFish uses OpenLayers, so it is just a matter of using the geodesic
>> option.
>
> Hmm, so I must be doing something wrong. Having applied your patch and
> having set both scaleline and scale controls to geodesic: true these work
> fine now. But the scaleline attached to a PDF generated with GeoServer PDF
> printing module still shows a wrong scale line. Or is it because I use
> GeoServer PDF instead of the source MapFish...?

The print module calculates the scale from the map resoultion, it is
not taken from OpenLayers. This is in the print module code, so it
makes no difference whether you run it as GeoServer extension or
directly within Mapfish.

Regards,
Andreas.

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list