Directly wrap Mapbox GL

This commit is contained in:
lukasmartinelli
2016-09-08 21:42:18 +02:00
parent d0776032b6
commit 392a7aa832
5 changed files with 62 additions and 14 deletions
+11 -9
View File
@@ -1,19 +1,21 @@
import React from 'react';
import ReactMapboxGl from 'react-mapbox-gl';
import {ZoomControl} from 'react-mapbox-gl';
import MapboxGl from 'mapbox-gl';
export class Map extends React.Component {
constructor(props) {
super(props);
super(props);
}
componentDidMount() {
MapboxGl.accessToken = "pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w";
const map = new MapboxGl.Map({
container: this.container,
style: "mapbox://styles/morgenkaffee/cirqasdb8003dh1ntbo6dkvs6"
});
}
render() {
return <ReactMapboxGl
style="mapbox://styles/morgenkaffee/ciqo4gtwo0037c0m7tpcosu63"
accessToken="pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w"
>
<ZoomControl />
</ReactMapboxGl>;
return <div ref={x => this.container = x} style={{zIndex: 15}}></div>
}
}