diff --git a/package-lock.json b/package-lock.json index e728faf8..d6968569 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@mapbox/mapbox-gl-rtl-text": "^0.2.3", "@maplibre/maplibre-gl-geocoder": "^1.5.0", - "@maplibre/maplibre-gl-inspect": "^1.5.2", + "@maplibre/maplibre-gl-inspect": "^1.6.0", "@maplibre/maplibre-gl-style-spec": "^20.1.0", "@mdi/js": "^6.6.96", "@mdi/react": "^1.5.0", @@ -2592,9 +2592,9 @@ } }, "node_modules/@maplibre/maplibre-gl-inspect": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-inspect/-/maplibre-gl-inspect-1.5.2.tgz", - "integrity": "sha512-rdWNXGMoMt4ttQm3BwmtAp6Djmr7T+fUgUVr28ccZP6u8X6HowI6TUv3FKlh8JoTKCcomglEoNK7pfJWVu2w3A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-inspect/-/maplibre-gl-inspect-1.6.0.tgz", + "integrity": "sha512-RKxj/GIHQP7qz4ptuyqsAq7SI57wuougE75Sk1DO7drBKSKuayzjPwZSWzqYFceIEQOGR2kUCECnAjUqTkQtoA==", "dependencies": { "lodash.isequal": "^4.5.0", "randomcolor": "^0.6.2" diff --git a/package.json b/package.json index 8ecb7acf..d5390978 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@mapbox/mapbox-gl-rtl-text": "^0.2.3", "@maplibre/maplibre-gl-geocoder": "^1.5.0", - "@maplibre/maplibre-gl-inspect": "^1.5.2", + "@maplibre/maplibre-gl-inspect": "^1.6.0", "@maplibre/maplibre-gl-style-spec": "^20.1.0", "@mdi/js": "^6.6.96", "@mdi/react": "^1.5.0", diff --git a/src/components/MapMaplibreGl.tsx b/src/components/MapMaplibreGl.tsx index 76ca57bb..62527e37 100644 --- a/src/components/MapMaplibreGl.tsx +++ b/src/components/MapMaplibreGl.tsx @@ -99,9 +99,7 @@ export default class MapMaplibreGl extends React.Component, while we wait for a proper fix. - // eslint-disable-next-line - this.state.inspect._popupBlocked = false; this.state.inspect.toggleInspector() } + if (this.state.inspect && this.props.inspectModeEnabled) { + this.state.inspect!.setOriginalStyle(this.props.replaceAccessTokens(this.props.mapStyle)); + this.state.inspect!.render(); + } if (map) { - if (this.props.inspectModeEnabled) { - // HACK: We need to work out why we need to do this and what's causing - // this error. I'm assuming an issue with maplibre-gl update and - // mapbox-gl-inspect. - try { - //this.state.inspect.render(); - } catch(err) { - console.error("FIXME: Caught error", err); - } - } - map.showTileBoundaries = this.props.options?.showTileBoundaries!; map.showCollisionBoxes = this.props.options?.showCollisionBoxes!; map.showOverdrawInspector = this.props.options?.showOverdrawInspector!;