mirror of
https://github.com/maputnik/editor.git
synced 2025-12-28 00:50:00 +00:00
Fix build process for mapbox gl
This commit is contained in:
@@ -9,7 +9,6 @@ import { StyleStore } from './stylestore.js'
|
||||
import { WorkspaceDrawer } from './workspace.jsx'
|
||||
|
||||
import theme from './theme.js'
|
||||
import layout from './layout.scss'
|
||||
|
||||
export default class App extends React.Component {
|
||||
static childContextTypes = {
|
||||
@@ -78,9 +77,7 @@ export default class App extends React.Component {
|
||||
workContext={this.state.workContext}
|
||||
mapStyle={this.state.currentStyle}
|
||||
/>
|
||||
<div className={layout.map}>
|
||||
<Map mapStyle={this.state.currentStyle} />
|
||||
</div>
|
||||
<Map mapStyle={this.state.currentStyle} />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
@mixin full-height {
|
||||
.map {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.map {
|
||||
@include full-height;
|
||||
width: 100%;
|
||||
|
||||
& > div {
|
||||
|
||||
11
src/map.jsx
11
src/map.jsx
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import MapboxGl from 'mapbox-gl';
|
||||
import diffStyles from 'mapbox-gl-style-spec/lib/diff'
|
||||
import theme from './theme.js'
|
||||
//import diffStyles from 'mapbox-gl-style-spec/lib/diff'
|
||||
import { fullHeight } from './theme.js'
|
||||
import Immutable from 'immutable'
|
||||
|
||||
export class Map extends React.Component {
|
||||
@@ -50,6 +50,11 @@ export class Map extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div ref={x => this.container = x}></div>
|
||||
return <div style={{
|
||||
...fullHeight,
|
||||
width: "100%",
|
||||
}}>
|
||||
<div ref={x => this.container = x}></div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,13 @@ const caps = {
|
||||
letterSpacing: '.2em'
|
||||
}
|
||||
|
||||
export const fullHeight = {
|
||||
position: "fixed",
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
height: "100%",
|
||||
}
|
||||
|
||||
const baseColors = {
|
||||
black: '#242424',
|
||||
gray: '#313131',
|
||||
|
||||
Reference in New Issue
Block a user