diff --git a/samples/AzureMapsControl.Sample/Pages/Layers/LineLayerOnReady.razor b/samples/AzureMapsControl.Sample/Pages/Layers/LineLayerOnReady.razor index 3e4934c..ce5e326 100644 --- a/samples/AzureMapsControl.Sample/Pages/Layers/LineLayerOnReady.razor +++ b/samples/AzureMapsControl.Sample/Pages/Layers/LineLayerOnReady.razor @@ -40,7 +40,14 @@ new AzureMapsControl.Components.Atlas.Position(11.581155, 48.141852), new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534), new AzureMapsControl.Components.Atlas.Position(11.583355, 48.143896), - new AzureMapsControl.Components.Atlas.Position(11.583662, 48.144258), + new AzureMapsControl.Components.Atlas.Position(11.583662, 48.144258) + }), + new Dictionary() + { + { "Color", "#00FF00" } + })); + await dataSource.AddAsync(new AzureMapsControl.Components.Atlas.Shape( + new AzureMapsControl.Components.Atlas.LineString(new[] { new AzureMapsControl.Components.Atlas.Position(11.585458, 48.145596), new AzureMapsControl.Components.Atlas.Position(11.587910, 48.145779), new AzureMapsControl.Components.Atlas.Position(11.589632, 48.146608), @@ -51,40 +58,23 @@ new AzureMapsControl.Components.Atlas.Position(11.593594, 48.151084), new AzureMapsControl.Components.Atlas.Position(11.594028, 48.151803), new AzureMapsControl.Components.Atlas.Position(11.592281, 48.152074) - }))); + }), + new Dictionary() + { + { "Color", "#FF0000" } + })); var layer = new AzureMapsControl.Components.Layers.LineLayer { - Options = new Components.Layers.LineLayerOptions + Options = new AzureMapsControl.Components.Layers.LineLayerOptions { Source = dataSourceId, - StrokeWidth = new Components.Atlas.ExpressionOrNumber(6), - StrokeGradient = new Components.Atlas.Expression( + StrokeWidth = new AzureMapsControl.Components.Atlas.ExpressionOrNumber(6), + StrokeColor = new AzureMapsControl.Components.Atlas.ExpressionOrString( new AzureMapsControl.Components.Atlas.Expression[] { - new AzureMapsControl.Components.Atlas.ExpressionOrString("interpolate"), - new Components.Atlas.Expression( - new AzureMapsControl.Components.Atlas.Expression[] - { - new AzureMapsControl.Components.Atlas.ExpressionOrString("linear") - }), - new Components.Atlas.Expression( - new AzureMapsControl.Components.Atlas.Expression[] - { - new AzureMapsControl.Components.Atlas.ExpressionOrString("line-progress") - }), - new AzureMapsControl.Components.Atlas.ExpressionOrNumber(0), - new AzureMapsControl.Components.Atlas.ExpressionOrString("blue"), - new AzureMapsControl.Components.Atlas.ExpressionOrNumber(0.1), - new AzureMapsControl.Components.Atlas.ExpressionOrString("royalBlue"), - new AzureMapsControl.Components.Atlas.ExpressionOrNumber(0.3), - new AzureMapsControl.Components.Atlas.ExpressionOrString("cyan"), - new AzureMapsControl.Components.Atlas.ExpressionOrNumber(0.5), - new AzureMapsControl.Components.Atlas.ExpressionOrString("lime"), - new AzureMapsControl.Components.Atlas.ExpressionOrNumber(0.7), - new AzureMapsControl.Components.Atlas.ExpressionOrString("yellow"), - new AzureMapsControl.Components.Atlas.ExpressionOrNumber(1), - new AzureMapsControl.Components.Atlas.ExpressionOrString("red"), + new AzureMapsControl.Components.Atlas.ExpressionOrString("get"), + new AzureMapsControl.Components.Atlas.ExpressionOrString("Color") }) } }; diff --git a/src/AzureMapsControl.Components/typescript/geometries/geometry-builder.ts b/src/AzureMapsControl.Components/typescript/geometries/geometry-builder.ts index 7a14806..b3359eb 100644 --- a/src/AzureMapsControl.Components/typescript/geometries/geometry-builder.ts +++ b/src/AzureMapsControl.Components/typescript/geometries/geometry-builder.ts @@ -14,7 +14,8 @@ export class GeometryBuilder { public static buildShape(shape: Shape): azmaps.Shape { return new azmaps.Shape( this.buildGeometry(shape.geometry), - shape.id + shape.id, + Core.formatProperties(shape.properties) ); }