I am trying to increase the width of the 1px stroke around the outside of a polygon using Mapbox Android SDK version 4.2.0.beta4.
First I tried using the PolygonOptions but there was no option available.
public Polygon addPolygon(MapboxMap mapboxMap) {
PolygonOptions polygonOptions = new PolygonOptions()
.addAll(latLngs)
.alpha(ALPHA_UNSELECTED)
.fillColor(FILL_COLOR)
.strokeColor(BORDER_COLOR);
// no option for stroke width
return mapboxMap.addPolygon(polygonOptions);
}
I then tried using the using the new Runtime Style API as defined in the Style Spec but could not find a suitable layer ID, I tried "background" https://www.mapbox.com/mapbox-gl-style-spec/
public void changeStrokeWidth(MapboxMap mapboxMap) {
Layer styleLayer = mapboxMap.getLayer("background");
styleLayer.setProperties(PropertyFactory.lineWidth(10f));
}
Does anyone know how to make this work or do I just have to create my own set of polylines over the top of the polygon to emulate the behaviour?