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.

Could anyone explain the strategy OpenLayers take to determine the layer's projection?

For example, if I didn't explicitly specify any projection for a marker layer, what projection would the layer take?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

If you don't specify a projection the projection will be null (undefined) - when the layer is added to the map it will inherit the map's projection.

This is easily verified with the following code:

aLayer = new OpenLayers.Layer.Markers();
alert("Projection : " + aLayer.projection);     // Projection: null
map.addLayer(aLayer);
alert("Projection after adding to map: " + aLayer.projection);  // Projection: EPSG: 900913
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.