All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.js.vendor.openlayers3.examples.attributions.js Maven / Gradle / Ivy

The newest version!
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.Attribution');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');

var attribution = new ol.control.Attribution({
  collapsible: false
});
var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM()
    })
  ],
  controls: ol.control.defaults({ attribution: false }).extend([attribution]),
  renderer: exampleNS.getRendererFromQueryString(),
  target: 'map',
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});

function checkSize() {
  var small = map.getSize()[0] < 600;
  attribution.setCollapsible(small);
  attribution.setCollapsed(small);
}

$(window).on('resize', checkSize);
checkSize();




© 2015 - 2025 Weber Informatics LLC | Privacy Policy