Search code examples
dictionaryopenlayers

openlayers do not show blank areas around map


I have a simple map. When I zoom out to the map min zoom level (whole map overview) then I see a lot blank area around the map? Is it possible not to show it? Do I need to somehow apply pan locker or set bounds or what I need to do?


Solution

  • You can use the restrictedExtent attribute to restrict panning after a certain extent. Here is an example: Openlyers restricedExtent Example

    You can also restrict zoom levels with these attributes:

    minZoomLevel
    maxZoomLevel
    numZoomLevels