mirror of
https://github.com/maputnik/editor.git
synced 2025-12-06 06:10:00 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc51774259 | ||
|
|
5a19245ee0 | ||
|
|
45f45b7547 | ||
|
|
530bfaf3b3 | ||
|
|
6ea70ab9cf | ||
|
|
a0e2d68dae | ||
|
|
1447e8bfb5 | ||
|
|
c0480a50ea | ||
|
|
09ba2be416 | ||
|
|
115ce3305d | ||
|
|
960b2022ed | ||
|
|
252b442ca9 | ||
|
|
03b9ddda9c | ||
|
|
968d7d7fda |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "maputnik",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "maputnik",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"description": "A MapboxGL visual style editor",
|
||||
"main": "''",
|
||||
"scripts": {
|
||||
|
||||
@@ -430,9 +430,10 @@ export default class App extends React.Component {
|
||||
onLayerSelect={this.onLayerSelect.bind(this)} />
|
||||
}
|
||||
|
||||
const elementStyle = {
|
||||
"filter": `url('#${this.state.mapFilter}')`
|
||||
};
|
||||
const elementStyle = {};
|
||||
if(this.state.mapFilter) {
|
||||
elementStyle.filter = `url('#${this.state.mapFilter}')`;
|
||||
}
|
||||
|
||||
return <div style={elementStyle}>
|
||||
{mapElement}
|
||||
|
||||
@@ -66,6 +66,7 @@ export default class MapboxGlMap extends React.Component {
|
||||
onDataChange: () => {},
|
||||
onLayerSelect: () => {},
|
||||
mapboxAccessToken: tokens.mapbox,
|
||||
options: {},
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
|
||||
@@ -235,10 +235,24 @@ class ExportModal extends React.Component {
|
||||
}
|
||||
|
||||
downloadStyle() {
|
||||
const blob = new Blob([styleSpec.format(stripAccessTokens(this.props.mapStyle))], {type: "application/json;charset=utf-8"});
|
||||
const tokenStyle = styleSpec.format(stripAccessTokens(style.replaceAccessToken(this.props.mapStyle)));
|
||||
|
||||
const blob = new Blob([tokenStyle], {type: "application/json;charset=utf-8"});
|
||||
saveAs(blob, this.props.mapStyle.id + ".json");
|
||||
}
|
||||
|
||||
changeMetadataProperty(property, value) {
|
||||
const changedStyle = {
|
||||
...this.props.mapStyle,
|
||||
metadata: {
|
||||
...this.props.mapStyle.metadata,
|
||||
[property]: value
|
||||
}
|
||||
}
|
||||
this.props.onStyleChanged(changedStyle)
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
return <Modal
|
||||
data-wd-key="export-modal"
|
||||
@@ -252,6 +266,22 @@ class ExportModal extends React.Component {
|
||||
<p>
|
||||
Download a JSON style to your computer.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<InputBlock label={"OpenMapTiles Access Token: "}>
|
||||
<StringInput
|
||||
value={(this.props.mapStyle.metadata || {})['maputnik:openmaptiles_access_token']}
|
||||
onChange={this.changeMetadataProperty.bind(this, "maputnik:openmaptiles_access_token")}
|
||||
/>
|
||||
</InputBlock>
|
||||
<InputBlock label={"Mapbox Access Token: "}>
|
||||
<StringInput
|
||||
value={(this.props.mapStyle.metadata || {})['maputnik:mapbox_access_token']}
|
||||
onChange={this.changeMetadataProperty.bind(this, "maputnik:mapbox_access_token")}
|
||||
/>
|
||||
</InputBlock>
|
||||
</p>
|
||||
|
||||
<Button onClick={this.downloadStyle.bind(this)}>
|
||||
<MdFileDownload />
|
||||
Download
|
||||
|
||||
@@ -18,6 +18,11 @@ html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
// The UI is 100% height so prevent bounce scroll on OSX
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: calc(100% - #{$toolbar-height + $toolbar-offset});
|
||||
width: 75%;
|
||||
width: calc(
|
||||
100%
|
||||
- 200px /* layer list */
|
||||
- 350px /* layer editor */
|
||||
);
|
||||
}
|
||||
|
||||
// DOC LABEL
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//SCROLLING
|
||||
.maputnik-scroll-container {
|
||||
overflow-x: visible;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
3
src/styles/_react-codemirror.scss
Normal file
3
src/styles/_react-codemirror.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
.react-codemirror2 {
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// See <https://github.com/nkbt/react-collapse/commit/4f4fbce7c6c07b082dc62062338c9294c656f9df>
|
||||
.react-collapse-container {
|
||||
display: flex;
|
||||
max-width: 100%;
|
||||
|
||||
> * {
|
||||
flex: 1;
|
||||
|
||||
@@ -38,6 +38,7 @@ $toolbar-offset: 0;
|
||||
@import 'popup';
|
||||
@import 'map';
|
||||
@import 'react-collapse';
|
||||
@import 'react-codemirror';
|
||||
|
||||
/**
|
||||
* Hacks for webdriverio isVisibleWithinViewport
|
||||
|
||||
Reference in New Issue
Block a user