I have used openlayers along with geoserver. My Map is having LCC projection by default, but SRS is EPSG:4042.
The problem is that the scaleline shows NaN in meter as well as feet. How can I correct it?
var bounds = new OpenLayers.Bounds(
66.76242541918388, 6.756367055683252,
98.64805108111362, 37.558217731396034
);
var map = new OpenLayers.Map('map',
{
maxExtent: bounds,
maxResolution: 0.10,
projection: "EPSG:4042",
center: new OpenLayers.LonLat(79, 21)
}
);
EDIT 1 :
This happens only when I give a projection for OpenLayers.Map. Otherwise, the scale is correct.
EDIT 2: This worked for me:
var bounds = new OpenLayers.Bounds(
66.76242541918388, 6.756367055683252,
98.64805108111362, 37.558217731396034
);
var map = new OpenLayers.Map('map',
{
maxExtent: bounds,
maxResolution: 0.10,
//projection: "EPSG:4042",
center: new OpenLayers.LonLat(79, 21)
}
);
i.e. commenting out projection.
OpenLayers.Control.ScaleLine– Vineet Menon Aug 31 '12 at 7:36