RayCraftDocs
v1.0.3 raycraft.dev
On this page

Map

Complete

A map drawn as plain SVG from GeoJSON. Regions can be coloured by a value, markers sit at coordinates, and the user can select a region, zoom and move. RayCraft ships no map data; the application supplies the GeoJSON.

Example

Map control

Parameters

ParameterTypeDescription
ClassstringExtra CSS classes added to the root element.
ClassesintNumber of colour steps (1 to 9).
FeaturesIEnumerable<MapFeature>Shapes you built in code (instead of GeoJson).
GeoJsonstringGeoJSON text with the shapes.
HeightDoubleMaximum height of the grid body, for example 24rem (default 28rem with VirtualScroll).
KeyPropertystringProperty that holds the key of a region when the feature has no id.
LabelstringVisible label text (charts: accessible name; IconButton: accessible name and tooltip).
MarkersIEnumerable<MapMarker>Points drawn as squares.
MarkerSizeDoubleSize of a marker in pixels of the drawing.
NamePropertystringProperty that holds the name of a region.
ProjectionMapProjectionMercator or Equirectangular.
SelectedstringKey of the selected region. Use with @bind-Selected.
ShowDataLabelsboolWrites the value on each mark (bars, line points, pie slices).
ShowExportboolAdds buttons that save the chart as a PNG or SVG image.
ShowLegendboolShows the clickable legend.
StylestringInline style added to the root element.
ValueFormatstringNumber format for axis and tooltips, e.g. N0 or P1.
ValuesIReadOnlyDictionary<string, Double>Number per region key; colours the regions.
WidthDoubleSkeleton: any CSS length. Charts: drawing width in SVG units (the chart still scales to its container).
ZoomableboolAdds zoom and move to the toolbar and the keyboard.

Events

EventTypeDescription
OnFeatureClickEventCallback<MapFeature>Raised when a region is activated.
OnMarkerClickEventCallback<MapMarker>Raised when a marker is activated.
SelectedChangedEventCallback<string>Raised when a region is selected or cleared.

Package

Map is part of RayCraft Complete. Package: RayCraft.Blazor.Complete. It comes from the private RayCraft feed and needs an active license. See Getting started.