Comments (1)
I resolved this by myself!
But Mapbox GL Language Plugin doesn't correspond the style 'mapbox://styles/mapbox/streets-v11' on master branch at now, so I had to run command that yarn add https://github.com/mapbox/mapbox-gl-language/#streets-11-style
.
And it is better to use a way introduced on Mapbox official document that uses setLayerProperty
either way because the branch named 'streets-11-style' on Mapbox GL Language Plugin doesn't fully correspond to mapbox://styles/mapbox/streets-11
.
The code used Mapbox GL Language Plugin is like below.
<template>
<MglMap
:center="center"
:accessToken="accessToken"
:mapStyle="mapStyle"
class="mapPane"
@load="onMapLoaded"
>
</MglMap>
</template>
<script>
import Mapbox from 'mapbox-gl'
import {
MglMap
} from 'vue-mapbox'
export default {
...
methods: {
onMapLoaded (event) {
const map = event.map
var MapboxLanguage = require('@mapbox/mapbox-gl-language')
map.addControl(
new MapboxLanguage(
defaultLanguage: 'ja'
)
)
}
}
}
</script>
<style> // It is required for working around for a bug that map is not appeared on web page.
.mapboxgl-canvas {
outline: transparent;
left: 0;
}
#map-wrap {
position: absolute;
height: 100%;
top: 0;
left: 0;
width: 100%;
overflow: hidden;
}
#map-wrap .mgl-map-wrapper {
position: absolute;
height: 100%;
top: 0;
left: 0;
width: 100%;
}
#map-wrap .mgl-map-wrapper .mapboxgl-map {
height: 100%;
left: 0;
overflow: visible;
position: absolute;
top: 0;
width: 100%;
}
#mapboxgl-ctrl-geolocate {
display: none;
}
</style>
from vue-mapbox.
Related Issues (20)
- Provide a minimum and complete sample of MglGeojsonLayer HOT 1
- Listening on maps events HOT 2
- Bounds prop does not work HOT 1
- MglCanvasLayer not working?
- Map layers do not render again past initial load HOT 2
- Way to fire marker click OR map click HOT 1
- Legend not working when full screen HOT 2
- Expose raw MapboxGl object HOT 1
- gridsome build issue
- Setting a layout on addLayer is ignored
- Compatibilitywith Vue3? HOT 1
- Marker placement issue with multiple custom icons
- Is there a possibility to use this without a map? HOT 5
- API -> popup -> events
- New release needed HOT 1
- Zoom issue HOT 3
- Optimize bundle size
- TypeError: Cannot use 'in' operator to search for 'ref' in point HOT 2
- this.$listeners removed in Vue 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-mapbox.