timeroute / mapvue

A well-packaged MapboxGL component library for Vue3. 🗺️
https://mapvue.netlify.app
MIT License
20 stars 1 forks source link

MapboxLanguage设置不起效,只有option.language起效 #15

Open nauYieM opened 2 months ago

nauYieM commented 2 months ago

map.addControl( new MapboxLanguage({ defaultLanguage:'zh-Hans', }) ); addControl(new MapboxDraw({}))是有效的,但是MapboxLanguage就无效,没明白原因,考虑到style有影响,找到没用mapvue的例子 style一样是有生效的。

timeroute commented 2 months ago

有个临时解决方法

const control = new MapboxLanguageControl({
  defaultLanguage: 'zh-Hans',
});
map.addControl(control);
const style = map.getStyle();
map.setStyle("");
map.setStyle(style);