mirror of
https://github.com/maputnik/editor.git
synced 2026-08-24 22:17:25 +00:00
Get map rendering with maplibre
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "maputnik",
|
"name": "maputnik",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0-pre.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "maputnik",
|
"name": "maputnik",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0-pre.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.9",
|
"@babel/runtime": "^7.17.9",
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ export default class MapMapboxGl extends React.Component {
|
|||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
MapboxGl.accessToken = tokens.mapbox
|
|
||||||
this.state = {
|
this.state = {
|
||||||
map: null,
|
map: null,
|
||||||
inspect: null,
|
inspect: null,
|
||||||
@@ -86,8 +85,6 @@ export default class MapMapboxGl extends React.Component {
|
|||||||
if(!IS_SUPPORTED) return;
|
if(!IS_SUPPORTED) return;
|
||||||
|
|
||||||
if(!this.state.map) return
|
if(!this.state.map) return
|
||||||
const metadata = props.mapStyle.metadata || {}
|
|
||||||
MapboxGl.accessToken = metadata['maputnik:mapbox_access_token'] || tokens.mapbox
|
|
||||||
|
|
||||||
//Mapbox GL now does diffing natively so we don't need to calculate
|
//Mapbox GL now does diffing natively so we don't need to calculate
|
||||||
//the necessary operations ourselves!
|
//the necessary operations ourselves!
|
||||||
@@ -149,7 +146,7 @@ export default class MapMapboxGl extends React.Component {
|
|||||||
maxZoom: 24
|
maxZoom: 24
|
||||||
}
|
}
|
||||||
|
|
||||||
const map = new MapboxGl.Map(mapOpts);
|
const map = new MapLibreGl.Map(mapOpts);
|
||||||
|
|
||||||
const mapViewChange = () => {
|
const mapViewChange = () => {
|
||||||
const center = map.getCenter();
|
const center = map.getCenter();
|
||||||
@@ -165,13 +162,13 @@ export default class MapMapboxGl extends React.Component {
|
|||||||
const zoomControl = new ZoomControl;
|
const zoomControl = new ZoomControl;
|
||||||
map.addControl(zoomControl, 'top-right');
|
map.addControl(zoomControl, 'top-right');
|
||||||
|
|
||||||
const nav = new MapboxGl.NavigationControl({visualizePitch:true});
|
const nav = new MapLibreGl.NavigationControl({visualizePitch:true});
|
||||||
map.addControl(nav, 'top-right');
|
map.addControl(nav, 'top-right');
|
||||||
|
|
||||||
const tmpNode = document.createElement('div');
|
const tmpNode = document.createElement('div');
|
||||||
|
|
||||||
const inspect = new MapboxInspect({
|
const inspect = new MapboxInspect({
|
||||||
popup: new MapboxGl.Popup({
|
popup: new MapLibreGl.Popup({
|
||||||
closeOnClick: false
|
closeOnClick: false
|
||||||
}),
|
}),
|
||||||
showMapPopup: true,
|
showMapPopup: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user