Hi Jan, please use OpenLayers 2.9 where the ScaleLine control has a geodesic option which you will need to set to true, see:
http://trac.openlayers.org/ticket/1890 http://trac.openlayers.org/changeset/10110 Best regards, Bart On Apr 28, 2010, at 1:33 PM, Jan wrote: > Hi all, > It seems that in lon/lat projections (e.g. EPSG 4326) the scale line is right > only for the Equator (0 lat). > If you look at the map, e.g.: > http://dev.openlayers.org/addins/scalebar/trunk/examples/scalebar.html the > scaleline stays constant even if you pan map from N to S. It seems that > Poland for example has a width of 1000 km (W-E), while in fact it has approx. > 600 km. This is just wrong and for "spatially-unaware" users it will give > wrong information. > > AFAIK scale bar's width can be adjusted using: > > OpenLayers.INCHES_PER_UNIT["degrees"] = x; > > where x can be calculated using the length of a given parallel (in inches) > divided by 360 degrees. The default inch per unit value is 4374754. > 4374754 * 360 degrees = 1574911440 inches = 40000 km (the length of the > Equator). > > It would be nice to implement a default functionality in OL for automatic > adjustments of INCHES_PER_UNIT value based e.g. on the latitude of a map > center (for example using moveend or zoomend map events). In this way, the > scale bar would be always correct at least in the center of the map. If you > create a map for higher latitudes it is crucial. The wrong scale line I would > call even a bug (imagine using this scaleline in northern Canada or Norway). > > By the way, it seems that Google Maps uses this method to correct the scale > line (check http://maps.google.com, pan the map in N/S direction and see how > the scale line adjusts without changing the scale of the map). > > Best regards to all OL users, > Jan > _______________________________________________ > Users mailing list > [email protected] > http://openlayers.org/mailman/listinfo/users
_______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
