@@ -144,6 +147,13 @@ export class LayerEditor extends React.Component {
+ {this.props.layer.get('type') !== 'background' &&
}
{this.layerFromType(this.props.layer.get('type'))}
diff --git a/src/layers/source.jsx b/src/layers/source.jsx
new file mode 100644
index 0000000..3a2f5e8
--- /dev/null
+++ b/src/layers/source.jsx
@@ -0,0 +1,54 @@
+import React from 'react'
+import Immutable from 'immutable'
+import { PropertyGroup } from '../fields/spec'
+import PureRenderMixin from 'react-addons-pure-render-mixin';
+import inputStyle from '../fields/input.js'
+
+/** Choose tileset (source) and the source layer */
+export default class SourceEditor extends React.Component {
+ static propTypes = {
+ source: React.PropTypes.string.isRequired,
+ sourceLayer: React.PropTypes.string.isRequired,
+
+ onSourceChange: React.PropTypes.func.isRequired,
+ onSourceLayerChange: React.PropTypes.func.isRequired,
+
+ /** List of available sources in the style
+ * https://www.mapbox.com/mapbox-gl-style-spec/#root-sources */
+ sources: React.PropTypes.instanceOf(Immutable.Map).isRequired,
+ }
+
+ constructor(props) {
+ super(props);
+ this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
+ }
+
+ render() {
+ const options = this.props.sources.map((source, sourceId)=> {
+ return
+ }).toIndexedSeq()
+ console.log(this.props.sources)
+ return
+
+
+
+
+
+
+ this.onSourceLayerChange(e.target.value)}
+ />
+
+
+
+ }
+}