mapcomponents / react-map-components-maplibre

A react component framework for declarative GIS application development.
MIT License
116 stars 18 forks source link

Bug: maplibregl-ctrl-bottom-right styles are broken since v1.0.0 #163

Closed dmestudent closed 7 months ago

dmestudent commented 7 months ago

@mapcomponents/react-maplibre version: >=1.0.0

Steps To Reproduce

  1. Follow the getting started with your template guide
  2. Start the example after installing dependencies and visit the page

The current behavior

Styles are missing for maplibregl-ctrl-bottom-right causing an unstyled container rendered below the map

image

The expected behavior

maplibregl-ctrl-bottom-right is styled properly and sits as an overlay on the map

image

I manually checked the last released versions and this error started appearing since version 1.0.0

Best regards

dBitech commented 7 months ago

There were some changes to the default handling of attribution in Maplibre 4.0 perhaps this is why

cioddi commented 7 months ago

Thank you for the issue, I also noticed this when setting up a new project yesterday. We will take a look at it and fix this.

cioddi commented 7 months ago

I already found the cause. In the versions before 1.0.0 we imported maplibre-gl.css in the MapLibreMap component. That was commented out to rule it out as a cause for the failing bundler command after the major rollup release upgrade.

We will put this back in in the next release. Until then a quick fix would be to add this line to your application import 'maplibre-gl/dist/maplibre-gl.css';

cioddi commented 7 months ago

Fixed in version 1.0.3

The changes to the attribution API in MapLibre 4.0 involve that it is enabled by default and the removal of customAttribution prop from AttributionControl. https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md#400