Skip to content

Commit 051a189

Browse files
committed
Add GenericChart withMapBox extension
1 parent f81a92c commit 051a189

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: src/Plotly.NET/GenericChartExtensions.fs

+10
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,16 @@ module GenericChartExtensions =
335335
|> Layout.UpdateMapById(id,map)
336336
GenericChart.setLayout layout this
337337

338+
/// Sets a mapbox for the given chart (will only work with traces supporting mapboxes, e.g. choroplethmapbox, scattermapbox)
339+
[<CompiledName("WithMapBox")>]
340+
[<Extension>]
341+
member this.withMapBox(mapBox:MapBox,[<Optional;DefaultParameterValue(null)>] ?Id ) =
342+
let layout =
343+
let id = defaultArg Id 1
344+
GenericChart.getLayout this
345+
|> Layout.UpdateMapBoxById(id,mapBox)
346+
GenericChart.setLayout layout this
347+
338348

339349
/// Sets the map style for the given chart (will only work with traces supporting geo, e.g. choropleth, scattergeo)
340350
///

0 commit comments

Comments
 (0)