mirror of
https://github.com/maputnik/editor.git
synced 2025-12-29 01:20:01 +00:00
Add inspection map
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import React from 'react'
|
||||
import Map from './Map'
|
||||
import style from '../../libs/style.js'
|
||||
|
||||
class OpenLayers3Map extends Map {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
class OpenLayers3Map extends React.Component {
|
||||
static propTypes = {
|
||||
onDataChange: React.PropTypes.func,
|
||||
mapStyle: React.PropTypes.object.isRequired,
|
||||
accessToken: React.PropTypes.string,
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
onMapLoaded: () => {},
|
||||
onDataChange: () => {},
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@@ -63,6 +69,18 @@ class OpenLayers3Map extends Map {
|
||||
this.setState({ map });
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div
|
||||
ref={x => this.container = x}
|
||||
style={{
|
||||
position: "fixed",
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
}}></div>
|
||||
}
|
||||
}
|
||||
|
||||
export default OpenLayers3Map
|
||||
|
||||
Reference in New Issue
Block a user