mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-11-13 01:34:14 +01:00
Another attempt and maputnik inspect crashing issue.
This commit is contained in:
parent
578a920b6d
commit
1070209cb5
1 changed files with 9 additions and 5 deletions
|
@ -104,7 +104,7 @@ export default class MapboxGlMap extends React.Component {
|
||||||
|
|
||||||
this.updateMapFromProps(this.props);
|
this.updateMapFromProps(this.props);
|
||||||
|
|
||||||
if(this.props.inspectModeEnabled !== prevProps.inspectModeEnabled) {
|
if(this.state.inspect && this.props.inspectModeEnabled !== this.state.inspect._showInspectMap) {
|
||||||
// HACK: Fix for <https://github.com/maputnik/editor/issues/576>, while we wait for a proper fix.
|
// HACK: Fix for <https://github.com/maputnik/editor/issues/576>, while we wait for a proper fix.
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
this.state.inspect._popupBlocked = false;
|
this.state.inspect._popupBlocked = false;
|
||||||
|
@ -112,7 +112,14 @@ export default class MapboxGlMap extends React.Component {
|
||||||
}
|
}
|
||||||
if (map) {
|
if (map) {
|
||||||
if (this.props.inspectModeEnabled) {
|
if (this.props.inspectModeEnabled) {
|
||||||
this.state.inspect.render();
|
// HACK: We need to work out why we need to do this and what's causing
|
||||||
|
// this error. I'm assuming an issue with mapbox-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.showTileBoundaries = this.props.options.showTileBoundaries;
|
||||||
|
@ -182,9 +189,6 @@ export default class MapboxGlMap extends React.Component {
|
||||||
inspect,
|
inspect,
|
||||||
zoom: map.getZoom()
|
zoom: map.getZoom()
|
||||||
});
|
});
|
||||||
if(this.props.inspectModeEnabled) {
|
|
||||||
inspect.toggleInspector();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
map.on("data", e => {
|
map.on("data", e => {
|
||||||
|
|
Loading…
Reference in a new issue