Skip to content

Commit 368c6bd

Browse files
committed
Fix attribution and maplibre css
1 parent e43e2a1 commit 368c6bd

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

frontend/src/screens/App/screens/MapPane/components/MainMap/MapLibreMap.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ class MapLibreMap
4343
[-73.70027209999999, 40.9175771], // NE
4444
],
4545
hash: true,
46+
attributionControl: {
47+
compact: false,
48+
},
4649
});
4750
this.map = map;
4851

49-
map.addControl(new maplibregl.AttributionControl());
50-
5152
map.on('click', PHOTO_LAYER, (e) => {
5253
const { panOnClick } = this.props;
5354
if (panOnClick) map.panTo(e.lngLat);

frontend/src/screens/App/screens/ToteBag/components/Back.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ export default function ToteBag(): JSX.Element {
1313
if (!container) return;
1414

1515
const attributionEl = container.querySelector(
16-
'.mapboxgl-ctrl-attrib-inner'
16+
'.mapboxgl-ctrl-attrib-inner,.maplibregl-ctrl-attrib-inner'
1717
);
1818
if (!attributionEl) return;
1919

2020
const observer = new MutationObserver(() => {
2121
const text = (attributionEl as HTMLElement).innerText;
2222
const improveText =
23-
attributionEl.querySelector('.mapbox-improve-map')?.textContent || '';
23+
attributionEl.querySelector(
24+
'.mapbox-improve-map,.maplibregl-improve-map'
25+
)?.textContent || '';
2426

2527
if (text) {
2628
setAttributionText(text.replace(improveText, ''));

frontend/webpack.common.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module.exports = {
4545
},
4646
{
4747
test: /\.(css|less)$/,
48+
exclude: /node_modules/,
4849
use: [
4950
MiniCssExtractPlugin.loader,
5051
{
@@ -60,6 +61,21 @@ module.exports = {
6061
'less-loader',
6162
],
6263
},
64+
{
65+
test: /\.css$/,
66+
include: /node_modules/,
67+
use: [
68+
MiniCssExtractPlugin.loader,
69+
{
70+
loader: 'css-loader',
71+
options: {
72+
modules: false,
73+
importLoaders: 1,
74+
},
75+
},
76+
'postcss-loader',
77+
],
78+
},
6379
{
6480
test: /\.(png|jpg|gif|svg|style\.json)$/,
6581
type: 'asset/resource',

0 commit comments

Comments
 (0)