1

I'm using the PopupFeature from the ol-ext library with Openlayers. Where can I change the color of the popup close button?

  var popup = new ol.Overlay.PopupFeature({
    popupClass: 'default anim',
    closeBox: true,
    select: select,
    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 just have to change the popup close button background color in CSS.

To set close button color to red:

.ol-popup .closeBox {
  background-color: red
}

This is the result:

enter image description here

1
  • Thsnk you, I didn't know where I should chance in the css. Oct 21, 2023 at 0:37

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.