1

I am using PopupFeature popup http://viglino.github.io/ol-ext/dist/ol-ext.js as per the example in http://viglino.github.io/ol-ext/examples/popup/ map.popup.feature.html.

Does anyone know if it's possible to include a scrollbar according to the amount of attributes?

var popup = new ol.Overlay.PopupFeature({
popupClass: 'default anim',
select: select,
canFix: true,
template: function(f) {
  return {
    title: function(f) { return f.get('nom')+' ('+f.get('id')+')' },
    attributes: { 
      region: { title: 'Région' }, 
      arrond: 'arrond', 
      cantons: 'cantons', 
      communes: 'communes', 
      pop: 'pop' 
    }
  }
},

});

1 Answer 1

1

You have to set overflow and max-height and/or max-width CSS properties for ol-popup-content CSS class.

For example, if you set:

.ol-popup {
  max-width: 300px;
  min-width: 100px;
  min-height: 1em;
}
.ol-popup-content {
  overflow: auto !important;
  max-height: 300px;
}

you will get:

enter image description here

1
  • Very good, thank you. That's right I need. Feb 14, 2023 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.