Geo Mapping
This section displays how to map the Polygone Geometry type (and Line) with the Leaflet Map charting component in the Designer.
Pre-requisite: Please configure the Geo Shape settings for Polygone and Line Geometry type before using them inside the Map chart component of the Designer.
The integration guide for the Leaflet Map charting component explains how to visualize complex geographic features—specifically Polygons and Lines—using data fields that represent geographical coordinates.
This process involves more than just basic point plotting; it requires you to correctly map a geometry field (often in JSON or a similar structured format like WKT) from your dataset to the Leaflet component. The designer allows you to select the data field containing the geometric definition for a Line (a sequence of connected points, great for showing routes or paths) or a Polygon (a closed loop of connected points, ideal for defining boundaries like regions, territories, or zones).
Set up the Map chart (Leaflet)
Drag and drop the Map Chart component onto the canvas.
Create a connection for associating with the chart.
Open General properties and set Map Type = Leaflet.
Under Leaflet, the available Geometry Type options are:
Line
Polygone
Line Type
Navigate to Geometry Type and select Line.
Associate Category and Series fields to the chart (Dataset tab).
In the dashboard script pane, fetch the Line shape file JSON configured in Admin Module:
sdk.getWidget('map1').m_shapedetails.filename = "Line shape file";Replace
map1with your Map chart widget ID and"Line shape file"with the exact name configured in the Admin Module.
Preview the dashboard to view line-type geometry.
Polygon Type
Navigate to Geometry Type and select Polygon.
Associate Category and Series fields with the chart.
In the dashboard script pane, fetch the Polygon shape file JSON configured in the Admin Module:
sdk.getWidget('map1').m_shapedetails.filename = "Polygon shape file";Replace
map1with your widget ID and"Polygon shape file"with the configured shape file name.
Preview the dashboard to view the polygon-type geometry.
Troubleshooting
No shapes displayed:
Verify Map Type = Leaflet and the correct Geometry Type (Line/Polygon).
Confirm the shape file name matches the one in the Admin Module.
Check that your dataset’s Category key aligns with the shape file’s feature properties.
Geometry renders, but values don’t color/fill:
Ensure Series is bound to a valid numeric measure.
Verify any join key/lookup logic used by the component (Category vs. shape feature attribute).
Script has no effect:
Confirm the code is in the dashboard script context and references the correct widget ID.
Reopen Preview to reload the script.