设置Google Maps的样式-Javascript API v3-海岸线轮廓? [英] Styling Google Maps - Javascript API v3 - Outline on coastlines?
本文介绍了设置Google Maps的样式-Javascript API v3-海岸线轮廓?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试对Google地图进行样式设置,使其与我提供的设计相匹配,并且在设计上,所有国家/地区的外部周围都有一个笔画在划分边界上描边.
I'm trying to style up a Google Map to match a design I've been given, and on the design there is a stroke around the outside of all the countries, as well as a stroke on dividing borders.
我要达到的效果如下:
The effect I'm going for is as below:
我目前的样式代码如下:
My code for the styling is currently as follows:
var styles = [
{
featureType: "water",
stylers: [
{ visibility: "on" },
{ color: "#ffffff" }
]
},{
featureType: "landscape",
stylers: [
{ color: "#f7f7f5" }
]
},{
featureType: "road",
stylers: [
{ visibility: "off" }
]
},{
featureType: "poi",
stylers: [
{ visibility: "off" }
]
},{
featureType: "administrative.country",
stylers: [
{ color: "#d2cdcd" },
{ weight: 1 }
]
},{
featureType: "administrative.country",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
},{
featureType: "administrative.province",
elementType: "geometry",
stylers: [
{ visibility: "off" }
]
},{
featureType: "administrative.locality",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
},{
featureType: "administrative.province",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
},{
featureType: "water",
elementType: "geometry.stroke",
stylers: [
{ color: "#4cfff5" }
]
}
];
知道我追求的目标是否可能?
Any idea if what I am after is possible?
谢谢!
以上样式为我提供了以下
推荐答案
您目前只能定义水的填充,而不能定义轮廓.
You currently can only define the fill for water but not the outline.
这篇关于设置Google Maps的样式-Javascript API v3-海岸线轮廓?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文