mirror of
https://github.com/maputnik/editor.git
synced 2026-07-19 12:27:26 +00:00
Directly wrap Mapbox GL
This commit is contained in:
+11
-9
@@ -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>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user