Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
    
Is the scaleline generated by OpenLayers or is it a GeoServer map decoration? –  Andrea Aime Aug 31 '12 at 6:23
    
It's generated by openlayers via API OpenLayers.Control.ScaleLine –  Vineet Menon Aug 31 '12 at 7:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.