Skip to content

OpenLayers

Jonathan Beliën edited this page Feb 18, 2017 · 13 revisions

Styles

OpenStreetMap Belgium Default

var attribution = new ol.control.Attribution({
  collapsible: false
});
var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM({
        url: "//tile.openstreetmap.be/osmbe/{z}/{x}/{y}.png",
        attributions: [ ol.source.OSM.ATTRIBUTION, "Tiles courtesy of <a href=\"https://geo6.be/\">GEO-6</a>" ]
      })
    })
  ],
  controls: ol.control.defaults({attribution: false}).extend([attribution]),
  target: "map",
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});

OpenStreetMap Belgium French

var attribution = new ol.control.Attribution({
  collapsible: false
});
var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM({
        url: "//tile.openstreetmap.be/osmbe-fr/{z}/{x}/{y}.png",
        attributions: [ ol.source.OSM.ATTRIBUTION, "Tiles courtesy of <a href=\"https://geo6.be/\">GEO-6</a>" ]
      })
    })
  ],
  controls: ol.control.defaults({attribution: false}).extend([attribution]),
  target: "map",
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});

OpenStreetMap Belgium Dutch

var attribution = new ol.control.Attribution({
  collapsible: false
});
var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM({
        url: "//tile.openstreetmap.be/osmbe-nl/{z}/{x}/{y}.png",
        attributions: [ ol.source.OSM.ATTRIBUTION, "Tiles courtesy of <a href=\"https://geo6.be/\">GEO-6</a>" ]
      })
    })
  ],
  controls: ol.control.defaults({attribution: false}).extend([attribution]),
  target: "map",
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});

OpenStreetMap Belgium German

var attribution = new ol.control.Attribution({
  collapsible: false
});
var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM({
        url: "//tile.openstreetmap.be/osmbe-de/{z}/{x}/{y}.png",
        attributions: [ ol.source.OSM.ATTRIBUTION, "Tiles courtesy of <a href=\"https://geo6.be/\">GEO-6</a>" ]
      })
    })
  ],
  controls: ol.control.defaults({attribution: false}).extend([attribution]),
  target: "map",
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});