I have a div centered on screen (using width:75%;height:50%;margin: 0 auto;) When I init the map div with OL , it auto aligned to the left. How can I keep having the div in the center of the window?
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
|
Your div containing map must be positioned absolutely. If you know the required height and width of your map, it could be as follows:
Note the !important rule. It will override the default css properties set by OpenLayers. In case you are not sure about absolute height and width of your map div, you can use .width() and .height(). Calculate scrren width and height, and set css properties of map div from javascript. |
|||
|
|
