mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 01:35:25 +01:00
Merge pull request #637 from orangemug/fix/console-errors-2020-04-06
Fix a bunch of errors/warnings from the console
This commit is contained in:
commit
3be6cb5926
8 changed files with 23 additions and 14 deletions
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -2490,6 +2490,11 @@
|
||||||
"is-string": "^1.0.5"
|
"is-string": "^1.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"array-move": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/array-move/-/array-move-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-qQpEHBnVT6HAFgEVUwRdHVd8TYJThrZIT5wSXpEUTPwBaYhPLclw12mEpyUvRWVdl1VwPOqnIy6LqTFN3cSeUQ=="
|
||||||
|
},
|
||||||
"array-union": {
|
"array-union": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
|
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
|
||||||
"@mapbox/mapbox-gl-style-spec": "^13.12.0",
|
"@mapbox/mapbox-gl-style-spec": "^13.12.0",
|
||||||
"@mdi/react": "^1.3.0",
|
"@mdi/react": "^1.3.0",
|
||||||
|
"array-move": "^2.2.1",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"codemirror": "^5.52.0",
|
"codemirror": "^5.52.0",
|
||||||
"color": "^3.1.2",
|
"color": "^3.1.2",
|
||||||
|
|
|
@ -4,7 +4,7 @@ import cloneDeep from 'lodash.clonedeep'
|
||||||
import clamp from 'lodash.clamp'
|
import clamp from 'lodash.clamp'
|
||||||
import get from 'lodash.get'
|
import get from 'lodash.get'
|
||||||
import {unset} from 'lodash'
|
import {unset} from 'lodash'
|
||||||
import {arrayMove} from 'react-sortable-hoc'
|
import arrayMove from 'array-move'
|
||||||
import url from 'url'
|
import url from 'url'
|
||||||
|
|
||||||
import MapboxGlMap from './map/MapboxGlMap'
|
import MapboxGlMap from './map/MapboxGlMap'
|
||||||
|
@ -353,7 +353,7 @@ export default class App extends React.Component {
|
||||||
parsed: {
|
parsed: {
|
||||||
type: "layer",
|
type: "layer",
|
||||||
data: {
|
data: {
|
||||||
index,
|
index: parseInt(index, 10),
|
||||||
key: "id",
|
key: "id",
|
||||||
message,
|
message,
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,7 @@ export default class App extends React.Component {
|
||||||
parsed: {
|
parsed: {
|
||||||
type: "layer",
|
type: "layer",
|
||||||
data: {
|
data: {
|
||||||
index,
|
index: parseInt(index, 10),
|
||||||
key,
|
key,
|
||||||
message
|
message
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@ export default class DocLabel extends React.Component {
|
||||||
PropTypes.object,
|
PropTypes.object,
|
||||||
PropTypes.string
|
PropTypes.string
|
||||||
]).isRequired,
|
]).isRequired,
|
||||||
fieldSpec: PropTypes.object.isRequired,
|
fieldSpec: PropTypes.object,
|
||||||
onToggleDoc: PropTypes.func.isRequired,
|
onToggleDoc: PropTypes.func,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
|
|
|
@ -223,7 +223,7 @@ export default class CombiningFilterEditor extends React.Component {
|
||||||
const error = errors[`filter[${idx+1}]`];
|
const error = errors[`filter[${idx+1}]`];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div key={`block-${idx}`}>
|
||||||
<FilterEditorBlock key={idx} onDelete={this.deleteFilterItem.bind(this, idx)}>
|
<FilterEditorBlock key={idx} onDelete={this.deleteFilterItem.bind(this, idx)}>
|
||||||
<SingleFilterEditor
|
<SingleFilterEditor
|
||||||
properties={this.props.properties}
|
properties={this.props.properties}
|
||||||
|
@ -232,9 +232,9 @@ export default class CombiningFilterEditor extends React.Component {
|
||||||
/>
|
/>
|
||||||
</FilterEditorBlock>
|
</FilterEditorBlock>
|
||||||
{error &&
|
{error &&
|
||||||
<div className="maputnik-inline-error">{error.message}</div>
|
<div key="error" className="maputnik-inline-error">{error.message}</div>
|
||||||
}
|
}
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ class StringInput extends React.Component {
|
||||||
value: props.value
|
value: props.value
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -10,7 +10,7 @@ class LayerIdBlock extends React.Component {
|
||||||
value: PropTypes.string.isRequired,
|
value: PropTypes.string.isRequired,
|
||||||
wdKey: PropTypes.string.isRequired,
|
wdKey: PropTypes.string.isRequired,
|
||||||
onChange: PropTypes.func.isRequired,
|
onChange: PropTypes.func.isRequired,
|
||||||
error: PropTypes.object.isRequired,
|
error: PropTypes.object,
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -165,10 +165,12 @@ class LayerListContainer extends React.Component {
|
||||||
return propsChanged;
|
return propsChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate () {
|
componentDidUpdate (prevProps) {
|
||||||
const selectedItemNode = this.selectedItemRef.current;
|
if (prevProps.selectedLayerIndex !== this.props.selectedLayerIndex) {
|
||||||
if (selectedItemNode && selectedItemNode.node) {
|
const selectedItemNode = this.selectedItemRef.current;
|
||||||
selectedItemNode.node.scrollIntoView();
|
if (selectedItemNode && selectedItemNode.node) {
|
||||||
|
selectedItemNode.node.scrollIntoView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +186,7 @@ class LayerListContainer extends React.Component {
|
||||||
if(layers.length > 1) {
|
if(layers.length > 1) {
|
||||||
const grp = <LayerListGroup
|
const grp = <LayerListGroup
|
||||||
data-wd-key={[groupPrefix, idx].join('-')}
|
data-wd-key={[groupPrefix, idx].join('-')}
|
||||||
key={`group-${groupPrefix}`}
|
key={`group-${groupPrefix}-${idx}`}
|
||||||
title={groupPrefix}
|
title={groupPrefix}
|
||||||
isActive={!this.isCollapsed(groupPrefix, idx) || idx === this.props.selectedLayerIndex}
|
isActive={!this.isCollapsed(groupPrefix, idx) || idx === this.props.selectedLayerIndex}
|
||||||
onActiveToggle={this.toggleLayerGroup.bind(this, groupPrefix, idx)}
|
onActiveToggle={this.toggleLayerGroup.bind(this, groupPrefix, idx)}
|
||||||
|
|
Loading…
Reference in a new issue