<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
标签 html css google-maps
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 7 年前。
如何在 HTML5 上的谷歌地图上创建边界或边距,这里是我试图实现的示例。 http://transpad.in/bwssb/ 彩色标记是我想要创建的,可以使用 css 完成还是有谷歌 api。 谢谢你
最佳答案
你所说的边距是多边形的周长,你可以这样设置多边形边框的颜色
// Define the LatLng coordinates for the polygon's path.
var triangleCoords = [
{lat: 25.774, lng: -80.190},
{lat: 18.466, lng: -66.118},
{lat: 32.321, lng: -64.757},
{lat: 25.774, lng: -80.190}
];
// Construct the polygon.
var triangle = new google.maps.Polygon({
paths: triangleCoords,
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: '#FF0000',
fillOpacity: 0.35
});
strokeColor、strokeWeight 和 strokeOpacity 是定义多边形边界的属性,fillColor 和 fillOpacity 是内容方面的属性
关于html - 如何在 Google map 上创建边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36222993/