Compare commits

...

11 Commits

Author SHA1 Message Date
orangemug
ed85b838ec v1.1.0 2018-01-30 20:57:24 +00:00
Orange Mug
f82b138a3d Merge pull request #228 from orangemug/fix/source-layer-guard
Added guard to <LayerSourceLayerBlock/> sourceLayerIds
2018-01-30 17:49:41 +00:00
orangemug
89c38991b9 Added guard to <LayerSourceLayerBlock/> sourceLayerIds 2018-01-29 17:18:30 +00:00
orangemug
0e4c06cc3e Merge remote-tracking branch 'origin/master' 2018-01-26 15:33:01 +00:00
orangemug
7e510a2582 v1.1.0-beta4 2018-01-26 15:31:33 +00:00
Orange Mug
f3cb9c4fdd Merge pull request #227 from orangemug/fix/mapbox-urls
Added support for mapbox:// urls to fetchSources
2018-01-26 12:37:56 +00:00
orangemug
f0f6130272 Fixed typo. 2018-01-25 19:58:01 +00:00
orangemug
0ebb299fd0 Added try/catch around mapboxUtil.normalizeSourceURL 2018-01-25 19:40:54 +00:00
orangemug
9d96525f12 Added support for mapbox:// urls. 2018-01-25 19:16:06 +00:00
Orange Mug
fc6f9251f7 Merge pull request #226 from orangemug/fix/modal-safari
Fix for safari modal appearing below the overlay
2018-01-25 18:17:18 +00:00
orangemug
53cb317155 Fix for safari modal appearing below the overlay. Fixes #225 2018-01-25 08:30:23 +00:00
6 changed files with 32 additions and 4 deletions

View File

@@ -4,6 +4,17 @@ module.exports = [
exclude: /(node_modules|bower_components|public)/,
loaders: ['react-hot-loader/webpack']
},
// HACK: This is a massive hack and reaches into the mapbox-gl private API.
// We have to include this for access to `normalizeSourceURL`. We should
// remove this ASAP, see <https://github.com/mapbox/mapbox-gl-js/issues/2416>
{
test: /.*node_modules[\/\\]mapbox-gl[\/\\]src[\/\\]util[\/\\].*\.js/,
loader: 'babel-loader',
query: {
presets: ['env', 'react', 'flow'],
plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties'],
}
},
{
test: /\.jsx?$/,
exclude: /(.*node_modules(?![\/\\]@mapbox[\/\\]mapbox-gl-style-spec)|bower_components|public)/,

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "maputnik",
"version": "1.1.0-beta3",
"version": "1.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "maputnik",
"version": "1.1.0-beta3",
"version": "1.1.0",
"description": "A MapboxGL visual style editor",
"main": "''",
"scripts": {
@@ -96,6 +96,7 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.1",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.24.1",
"babel-runtime": "^6.26.0",
"base64-loader": "^1.0.0",

View File

@@ -21,6 +21,10 @@ import LayerWatcher from '../libs/layerwatcher'
import tokens from '../config/tokens.json'
import isEqual from 'lodash.isequal'
import MapboxGl from 'mapbox-gl'
import mapboxUtil from 'mapbox-gl/src/util/mapbox'
function updateRootSpec(spec, fieldName, newValues) {
return {
...spec,
@@ -199,7 +203,13 @@ export default class App extends React.Component {
};
if(!this.state.sources.hasOwnProperty(key) && val.type === "vector") {
const url = val.url;
let url = val.url;
try {
url = mapboxUtil.normalizeSourceURL(url, MapboxGl.accessToken);
} catch(err) {
console.warn("Failed to normalizeSourceURL: ", err);
}
fetch(url)
.then((response) => {
return response.json();

View File

@@ -117,6 +117,11 @@ export default class LayerEditor extends React.Component {
comment = this.props.layer.metadata['maputnik:comment']
}
let sourceLayerIds;
if(this.props.sources.hasOwnProperty(this.props.layer.source)) {
sourceLayerIds = this.props.sources[this.props.layer.source].layers;
}
switch(type) {
case 'layer': return <div>
<LayerIdBlock
@@ -134,7 +139,7 @@ export default class LayerEditor extends React.Component {
/>
}
{this.props.layer.type !== 'raster' && this.props.layer.type !== 'background' && <LayerSourceLayerBlock
sourceLayerIds={this.props.sources[this.props.layer.source].layers}
sourceLayerIds={sourceLayerIds}
value={this.props.layer['source-layer']}
onChange={v => this.changeProperty(null, 'source-layer', v)}
/>

View File

@@ -6,6 +6,7 @@
background-color: $color-black;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
z-index: 3;
position: relative;
}
.maputnik-modal-section {