Skip to content

Using maps in LoqklDx

Neil MacMullen edited this page Oct 5, 2025 · 3 revisions

To render maps use

render scatterchart with (kind=map)

Column conventions

The map control uses a convention-based approach to using the columns in the query result so you may need to extend or project columns with the expected names. Note that column-names are not case-sensitive for the purposes of selection.

Required

  • latitude,lat - the latitude of the point to render (must be a column of real)
  • latitude,lon,lng - the longitude of the point to render (must be a column of real)

Optional Styling columns

  • PinScale - controls the size of the pin symbols. The default value is 0.3 which can be changed via the map.pin.scale setting.
  • PinFill - defines the color used to fill pin symbols. The default value is ff0000 which can be changed via the map.pin.fill setting.
  • PinSymbol - defines the symbol used for pins. The default value is ellipse which can be changed via the map.pin.symbol setting. Valid values are:
    • ellipse
    • triangle
    • rectangle
  • index,timestamp - if either of these two columns are present, lines will be drawn between pins to show route. Note that currently no ordering is done on this column by the map control so you should ensure the rows in your result are already ordered correctly. The line color is set using the map.line.pen.color setting and the default value is 0000ff
  • series - if lines are being drawn then defining a series column ensures that paths are grouped by series.
  • tooltip - allows a tooltip to be placed over pins. Use extend tooltip=strcat(line1,"\n",line2) for multi-line tooltips

Map layers

The default map layer is "OpenStreetMap" but you can change this using the map.defaultLayer setting.

Heatmaps

A special function heatmap_color is provided to allow coloring of items based on a continual color. The method returns a color in the form "#RRGBB" and accepts parameters

  • type : one of 'grayscale','gradient' or 'hue'
  • min : the minimum value of the range
  • max : the maximum value of the range
  • value : the value for which the color should be calculated
# assuming a table called "data" with lat,lng,value
let min = toscalar(data | summarize min(value));
let max = toscalar(data | summarize max(value));
data
| extend pinFill = heatmap_color("hue",min,max,value)
| extend pinScale=0.1
| order by value asc
| render scatterchart with (kind=map)
image

Examples

See the chart-demo project in the tutorials folder.

Clone this wiki locally