diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Map/BitMap.razor.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Map/BitMap.razor.cs index d6bc600fc0..9752e766fb 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Map/BitMap.razor.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Map/BitMap.razor.cs @@ -804,32 +804,32 @@ await _js.BitMapAddRectangle(JsObject, _Id, r.LayerId, private string JsObject => _activeProvider!.JsObjectName; - private static object ToMarkerPayload(BitMapMarker m) => new - { - lat = m.Position.Latitude, - lng = m.Position.Longitude, - title = m.Title, - popupHtml = m.PopupHtml?.Value, - popupText = m.PopupText, - tooltipHtml = m.TooltipHtml?.Value, - tooltipText = m.TooltipText, - tooltipPermanent = m.TooltipPermanent, - tooltipDirection = m.TooltipDirection.ToString().ToLowerInvariant(), - draggable = m.Draggable, - iconUrl = m.IconUrl, - iconWidth = m.IconWidth, - iconHeight = m.IconHeight, - zIndexOffset = m.ZIndexOffset, + private static object ToMarkerPayload(BitMapMarker m) => new Dictionary + { + ["lat"] = m.Position.Latitude, + ["lng"] = m.Position.Longitude, + ["title"] = m.Title, + ["popupHtml"] = m.PopupHtml?.Value, + ["popupText"] = m.PopupText, + ["tooltipHtml"] = m.TooltipHtml?.Value, + ["tooltipText"] = m.TooltipText, + ["tooltipPermanent"] = m.TooltipPermanent, + ["tooltipDirection"] = m.TooltipDirection.ToString().ToLowerInvariant(), + ["draggable"] = m.Draggable, + ["iconUrl"] = m.IconUrl, + ["iconWidth"] = m.IconWidth, + ["iconHeight"] = m.IconHeight, + ["zIndexOffset"] = m.ZIndexOffset, }; - private static object ToTileOverlayPayload(BitMapTileOverlay o) => new + private static object ToTileOverlayPayload(BitMapTileOverlay o) => new Dictionary { - id = o.Id, - urlTemplate = o.UrlTemplate, - attribution = o.Attribution, - opacity = o.Opacity, - zIndex = o.ZIndex, - maxZoom = o.MaxZoom, + ["id"] = o.Id, + ["urlTemplate"] = o.UrlTemplate, + ["attribution"] = o.Attribution, + ["opacity"] = o.Opacity, + ["zIndex"] = o.ZIndex, + ["maxZoom"] = o.MaxZoom, }; private static BitMapMarker CloneWithPosition(BitMapMarker prev, BitMapLatLng position) => new() @@ -855,21 +855,21 @@ private static object[] ToLatLngArray(IReadOnlyList pts) var arr = new object[pts.Count]; for (var i = 0; i < pts.Count; i++) { - arr[i] = new { lat = pts[i].Latitude, lng = pts[i].Longitude }; + arr[i] = new Dictionary { ["lat"] = pts[i].Latitude, ["lng"] = pts[i].Longitude }; } return arr; } private static object? ToStylePayload(BitMapVectorPathStyle? s) => s is null ? null - : new - { - color = s.Color, - weight = s.Weight, - opacity = s.Opacity, - fillColor = s.FillColor, - fillOpacity = s.FillOpacity, - dashArray = s.DashArray, + : new Dictionary + { + ["color"] = s.Color, + ["weight"] = s.Weight, + ["opacity"] = s.Opacity, + ["fillColor"] = s.FillColor, + ["fillOpacity"] = s.FillOpacity, + ["dashArray"] = s.DashArray, }; private static BitMapLatLng ReadLatLng(JsonElement e) => diff --git a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Map/BitMapProviderBase.cs b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Map/BitMapProviderBase.cs index 867918a6f4..03d7536a5b 100644 --- a/src/BlazorUI/Bit.BlazorUI.Extras/Components/Map/BitMapProviderBase.cs +++ b/src/BlazorUI/Bit.BlazorUI.Extras/Components/Map/BitMapProviderBase.cs @@ -127,7 +127,7 @@ protected void ValidateCommonOptions() return new Dictionary { - ["center"] = new { lat = Center.Latitude, lng = Center.Longitude }, + ["center"] = new Dictionary { ["lat"] = Center.Latitude, ["lng"] = Center.Longitude }, ["zoom"] = Zoom, ["minZoom"] = MinZoom, ["maxZoom"] = MaxZoom, @@ -140,10 +140,10 @@ protected void ValidateCommonOptions() ["dragPan"] = Dragging, ["keyboardNavigation"] = KeyboardNavigation, ["maxBounds"] = MaxBounds is { } b - ? new + ? new Dictionary { - southWest = new { lat = b.SouthWest.Latitude, lng = b.SouthWest.Longitude }, - northEast = new { lat = b.NorthEast.Latitude, lng = b.NorthEast.Longitude }, + ["southWest"] = new Dictionary { ["lat"] = b.SouthWest.Latitude, ["lng"] = b.SouthWest.Longitude }, + ["northEast"] = new Dictionary { ["lat"] = b.NorthEast.Latitude, ["lng"] = b.NorthEast.Longitude }, } : null, };