mirror of
https://github.com/maputnik/editor.git
synced 2026-04-27 20:00:08 +00:00
Compare commits
4 Commits
v1.7.0-bet
...
v1.7.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
184bfeeaf8 | ||
|
|
e45f8d960d | ||
|
|
1fede3af3a | ||
|
|
5ad74048bd |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "maputnik",
|
"name": "maputnik",
|
||||||
"version": "1.7.0-beta3",
|
"version": "1.7.0-beta4",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "maputnik",
|
"name": "maputnik",
|
||||||
"version": "1.7.0-beta3",
|
"version": "1.7.0-beta4",
|
||||||
"description": "A MapboxGL visual style editor",
|
"description": "A MapboxGL visual style editor",
|
||||||
"main": "''",
|
"main": "''",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -214,6 +214,11 @@ class GeoJSONSourceJSONEditor extends React.Component {
|
|||||||
<JSONEditor
|
<JSONEditor
|
||||||
layer={this.props.source.data}
|
layer={this.props.source.data}
|
||||||
maxHeight={200}
|
maxHeight={200}
|
||||||
|
mode={{
|
||||||
|
name: "javascript",
|
||||||
|
json: true
|
||||||
|
}}
|
||||||
|
lint={true}
|
||||||
onChange={data => {
|
onChange={data => {
|
||||||
this.props.onChange({
|
this.props.onChange({
|
||||||
...this.props.source,
|
...this.props.source,
|
||||||
|
|||||||
@@ -12,6 +12,30 @@ CodeMirror.defineMode("mgl", function(config, parserConfig) {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("lint", "json", function(text) {
|
||||||
|
const found = [];
|
||||||
|
|
||||||
|
// NOTE: This was modified from the original to remove the global, also the
|
||||||
|
// old jsonlint API was 'jsonlint.parseError' its now
|
||||||
|
// 'jsonlint.parser.parseError'
|
||||||
|
jsonlint.parser.parseError = function(str, hash) {
|
||||||
|
const loc = hash.loc;
|
||||||
|
found.push({
|
||||||
|
from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
|
||||||
|
to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
|
||||||
|
message: str
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
jsonlint.parse(text);
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
// Do nothing we catch the error above
|
||||||
|
}
|
||||||
|
return found;
|
||||||
|
});
|
||||||
|
|
||||||
CodeMirror.registerHelper("lint", "mgl", function(text, opts, doc) {
|
CodeMirror.registerHelper("lint", "mgl", function(text, opts, doc) {
|
||||||
const found = [];
|
const found = [];
|
||||||
const {parser} = jsonlint;
|
const {parser} = jsonlint;
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
.maputnik-toolbar-logo {
|
.maputnik-toolbar-logo {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: block;
|
display: block;
|
||||||
flex: 0 0 180px;
|
flex: 0 0 190px;
|
||||||
width: 180px;
|
width: 190px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
background-color: $color-black;
|
background-color: $color-black;
|
||||||
padding: $margin-2;
|
padding: $margin-2;
|
||||||
|
|||||||
Reference in New Issue
Block a user