I am familiarizing myself with Openlayers, and am having trouble with understanding the projection and displayprojection properties for a Map.
When the map is initialized with the following code:
map = new OpenLayers.Map('map', {
numZoomLevels: 20,
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG: 4326")
});
What exactly is happening?
The documentation of the OpenLayers.Map says that
projection -Set in the map options to override the default projection string [in] this map – also set maxExtent, maxResolution, and units if appropriate. Default is “EPSG:4326”.
while displayProjection is the Projection used by several controls to display data to user. If this property is set, it will be set on any control which has a null displayProjection property at the time the control is added to the map.
This does not make it clear.
Could someone explain what exactly do these two option do?
Best Answer
From the OpenLayers Beginner's guide:
The bold parts should give you an idea. I hope it helps.