简体   繁体   English

样式化多边形笔画并以不同方式填充?

[英]Stylize polygon stroke and fill differently?

Stylize polygon stroke and fill differently is not working from example I found like so:从我发现的示例中,样式化多边形笔划和填充方式不起作用:

   // Add a layer for rendering polygons.
    polygonLayer = new atlas.layer.PolygonLayer(dataSource, null, {
            filter: ['any', ['==', ['geometry-type'], 'Polygon'], ['==', ['geometry-type'], 'MultiPolygon']], // Only render Point or MultiPoint in this layer.
            minZoom: 18,
            strokeColor: 'navy',
            strokeWidth: 2,
            fillColor: 'light blue',
            fillOpacity: 0.3
        });

The polygon is getting the fill color and opacity applied but no stroke color is being applied correctly?多边形正在应用填充颜色和不透明度,但没有正确应用描边颜色? So what has changed or more importantly how can I do this?那么发生了什么变化或更重要的是我该怎么做呢?

The polygon layer only renders the fill area.多边形层只渲染填充区域。 To draw an outline of a polygon, use a line layer connected to the same data source.要绘制多边形的轮廓,请使用连接到同一数据源的线图层。 See the second example in the documentation:https://docs.microsoft.com/en-us/azure/azure-maps/map-add-shape请参阅文档中的第二个示例:https://docs.microsoft.com/en-us/azure/azure-maps/map-add-shape

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM