[OpenLayers-Users] scaleline in lon/lat projection
Jan
jab at umk.pl
Wed Apr 28 10:46:08 EDT 2010
Strange. Now it works, but only with OSM layer (which is in Spherical
Mercator) and it does not work when I use WGS-based layer (e.g. "
http://labs.metacarta.com/wms/vmap0") - in this case scaleline changes
between 1000 and 10000 km when I drag a map towards poles.
Regards,
Jan Burdziej
2010/4/28 Bart van den Eijnden <bartvde at osgis.nl>
> Add your control after the call to zoomToMaxExtent.
>
> Best regards,
> Bart
>
> On Apr 28, 2010, at 2:34 PM, Jan wrote:
>
> var map, scalebar;
>
> function init(){
>
> map = new OpenLayers.Map('map');
> var layer = new OpenLayers.Layer.WMS(
>
> "OpenLayers WMS",
> "http://labs.metacarta.com/wms/vmap0",
> {layers: 'basic'}
> );
>
> map.addLayer(layer);
>
> var scalebar = new OpenLayers.Control.ScaleLine({
> geodesic: true
> });
>
> map.addControl(scalebar);
>
> map.zoomToMaxExtent();
>
> }
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100428/a1e07c4f/attachment.html
More information about the Users
mailing list