AzureMapsCodeSamples icon indicating copy to clipboard operation
AzureMapsCodeSamples copied to clipboard

Type error on PolygonExtrusionLayerOptions

Open Jxlle opened this issue 1 year ago • 3 comments

I think there is an error in the type definition of the PolygonExtrusionLayerOptions: fillPattern?: string; should be fillPattern?: string | DataDrivenPropertyValueSpecification<string>; as in the type definition of PolygonLayerOptions.

With the current definition, you cannot define the fillPattern as an expression.

Jxlle avatar Oct 02 '24 12:10 Jxlle

According to the docs, expressions are not supported on the fill pattern option of extruded polygon layers: https://learn.microsoft.com/en-us/javascript/api/azure-maps-control/atlas.polygonextrusionlayeroptions?view=azure-maps-typescript-latest#azure-maps-control-atlas-polygonextrusionlayeroptions-fillpattern

Interestingly I just tested an expression with an extruded polygon layer recently and was surprised it worked. I remember when this was first added to Azure Maps 5 or 6 years ago, and the underlying map render engine (used to be Mapbox gl js, now MapLibre), had a lot of bugs with expressions for fill-patterns so there was a decision not to document that at the time. If you passed one in (either JavaScript or ignored the Typescript type error), it would still work, but in the past had a lot of issues. It looks like this is more stable than it issued to be, so it may be safe to document this now. I'll reach out to the Azure Maps team to let them know.

rbrundritt avatar Oct 02 '24 17:10 rbrundritt

@rbrundritt Yes, I created this ticket because I also tested it and it worked, which was not compatible with the current documentation. :)

Jxlle avatar Oct 03 '24 08:10 Jxlle

Hi, @Jxlle , thanks for reporting this. We will update the API spec to reflect the feasibility.

sinnypan avatar Oct 14 '24 07:10 sinnypan

Fixed in latest release

Jxlle avatar Dec 13 '24 09:12 Jxlle