Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Javascript在Google地图上设置国家名称的样式_Javascript_Google Maps_Dictionary - Fatal编程技术网

使用Javascript在Google地图上设置国家名称的样式

使用Javascript在Google地图上设置国家名称的样式,javascript,google-maps,dictionary,Javascript,Google Maps,Dictionary,我想在谷歌地图上设置国家名称的样式。我使用以下代码: var styles = [ { featureType: "administrative.country", elementType: "labels", stylers: [ { color: '#f24547' } ] } ]; map = new google.maps.Map( document.getElementById('map'), { center:

我想在谷歌地图上设置国家名称的样式。我使用以下代码:

var styles = [
    {
        featureType: "administrative.country",
        elementType: "labels",
        stylers: [ { color: '#f24547' } ]
    }
];

map = new google.maps.Map( document.getElementById('map'), {
    center: navigationData.googlePosition,
    zoom: 15 
});
map.setOptions( { styles: styles } );
这是工作,但结果是:


我不是来消除国家名称周围的阴影的。你有主意吗?提前感谢。

使用
元素类型:'labels.text.fill',
样式

var styles = [
    {
    featureType: 'administrative.country',
    elementType: 'labels.text.fill',
    stylers: [{color: '#f24547'}]
    }
];

对于演示,从

可以正常运行。谢谢。