6

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?

1 Answer 1

7

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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