This works for me with OL2.13.1:

var mapoptions = {
      maxExtent: new OpenLayers.Bounds(773500, 4555450, 2602100, 6384050),
      scales: [16000000, 8000000, 4000000, 2000000, 1000000, 750000, 500000, 
250000, 100000, 50000, 25000, 20000, 15000, 10000, 8000, 4000, 2000, 1000, 500, 
250],
      units: 'm',
      projection: "EPSG:2193",
      fractionalZoom: false,
      allOverlays: false
    };

 map = new OpenLayers.Map(mapoptions);
    map.addControl(new OpenLayers.Control.ScaleLine());
    map.addControl(new OpenLayers.Control.Scale());

Regards,

Robert

>>> ANC <[email protected]> 5/03/2014 7:20 a.m. >>>
Hello,

I need to display the scaleline in kilometers only using Openlayers 2.13.1.
I have searched the API and this forum but cannot find how to. In this forum
some controls as the scalebar or properties for the scaleline are mentioned
but seem to be depreciated or removed from the current version, as they do
not show in the API.

Thanks in advance for your help.





--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Scaleline-in-Km-only-OL-2-13-1-tp5107501.html
 
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected] 
http://lists.osgeo.org/mailman/listinfo/openlayers-users



This email and any attachments are confidential and intended solely for the 
addressee(s). If you are not the intended recipient, please notify us 
immediately and then delete this email from your system.

This message has been scanned for Malware and Viruses by Websense Hosted 
Security.
www.websense.com
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to