颤振风格的地图 [英] Flutter styled map
本文介绍了颤振风格的地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用从 Google样式向导生成的json 风格化Flutter原生地图?
Is it possible to use json generated from Google Styling Wizard to stylize the Flutter native map?
推荐答案
是.将JSON复制并粘贴到initMap
函数中的styles变量中,如下所示:
Yes. Copy and paste the JSON into the styles variable in your initMap
function, like this:
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 40.674, lng: -73.945},
zoom: 12,
styles: [
{elementType: 'geometry', stylers: [{color: '#242f3e'}]},
{elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},
{elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},
{
featureType: 'administrative.locality',
elementType: 'labels.text.fill',
stylers: [{color: '#d59563'}]
}
]
});
}
阅读以获取有关Google样式设置的更多信息地图.
Read this for more info about styling the Google maps.
这篇关于颤振风格的地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文