简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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