January 2016
Intermediate to advanced
308 pages
6h 35m
English
Customizing the view is not a hard task; it manly consists of considerations regarding the nature of the project and expected outcome. For our application, wrapping the map around the x axis is completely needless. Also, we can restrict the extent to the projection's extent. In the first example, called ch06_customize, we make such modifications in our application. First, we disable the layer wrapping in our base layers:
var map = new ol.Map({
[…]
new ol.layer.Tile({
source: new ol.source.TileWMS({
[…]
wrapX: false
[…]
new ol.layer.Vector({
source: new ol.source.Vector({
[…]
wrapX: false
}),Unlike in OpenLayers 2, you cannot make a high level decision to disable layer wrapping for the entire map. You have to disable it layer-wise ...
Read now
Unlock full access