Icon Map Introduction
The Icon Map custom visual from Altius is capable of drawing circles, images, lines and Well Known Text (WKT / SQL Server Spatial Data) shapes on a map. It is possible to draw a combination of these on the same map.
This documentation refers to Icon Map version 2 that will be released in 2020. Until then the beta version can be downloaded here. A significant update to the beta was released on 16th May 2020 – the documentation needs updating to reflect these changes.
In order to plot anything on the map, the Category field must be populated. This field is used to identify your objects for cross highlighting etc. For WKT objects only the “Icon URL / WKT / SVG” field need be populated in addition to this.
For all other types of object (images, circles and lines), the longitude and latitude field must be populated. For images and circles the size field must also be populated.
This table represents the required field configuration:
|Object Type||Category||Icon URL / WKT / SVG||Longitude||Latitude||Size|
The minimum configuration required to draw circles looks as follows:
With the fields applied as follows:
|Icon Map Field Name||Data field||Aggregation Type|
Longitude, Latitude and Size must all be numeric fields. Category must be a text. By setting the longitude and latitude aggregation types to Average, if there is more than one item with the same category value, the map will draw a circle in the centre point of these items.
The circle size is based on the value of the Size field. The minimum and maximum sizes can be configured in the settings under the Data Point options.
The colour of the circles can also be set within the options. It is not possible to set different colours based on the category field. However, it is possible to change the colour of the circles between a range by dragging a numeric field in to the Colour Range field. The colour range is set in the Data Point options within the map settings.
It is possible to change the circle fill and border opacity in the settings.
In order to draw images on the map, the URL to the image must be supplied in the Icon URL / WKT / SVG field. This image may be a calculated column, a text field in your data or a measure that returns a URL as an item of text.
It is possible to have all the images the same as above, or each item showing a different image:
The size of the image will be drawn between the minimum and maximum sizes set in the Data Point settings of the map. Within the Data Point settings, if you switch “Use Min and Max Size fields for Image Size” to Off, then the images will use the Size field as the number of pixels to use for the image width and height. All images are assumed to be square, so the size will be applied to both the width and height of the image.
Tip: If your images do not appear on the map, then check the minimum size field is of a sufficient size to show on the map. The default minimum size is 1, so if all your data has size 1, the images will be too small to see!
It is possible to rotate an image. For example, a vehicle on a map can be pointing in the direction of travel. The rotation field represents the number of degrees to rotate the image.
Binary encoded images
If you need to include the image within the report, rather than referencing an external URL, then it is possible to encode your image as a base 64 string. There are many online tools (such as https://www.base64-image.de) that will covert images to this format.
The following DAX creates a measure storing the plane icon, which can be used in the Image / WKT / SVG field
Icon map natively supports Scalable Vector Graphics (SVG). The advantage of using SVG images on the map over raster formats such as PNG or JPEG, is that they will not become pixelated when they are increased in size.
The house in this example is represented by the following measure:
House = "<svg viewBox='0 0 96 96' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' id='Icons_House' overflow='hidden'><path d='M72 34.8 72 18 64 18 64 27.2 48 12 48 12 6 52 10.5 55.8 48 20.2 48 20.2 85.5 55.8 90 52Z'/><path d='M18 54.3 18 84 42 84 42 59 54 59 54 84 78 84 78 54.3 48 25.8 18 54.3ZM36 71 24 71 24 59 36 59 36 71ZM60 59 72 59 72 71 60 71 60 59Z'/></svg>"
Icon Map will draw either a solid line or a dotted line on the map. The line can be drawn in dependently, or in addition to an image.
The line is drawn between the longitude and latitude fields and the corresponding Longitude / Latitude – Solid Line or Dotted Line fields.
At the moment, it is also necessary to have a numeric value in the size field, although this is not used in drawing the line.
If an image or SVG is included in the Icon URL / WKT / SVG field, then this will also be drawn.
Both the dotted and solid longitude and latitude fields can be populated. This will draw two lines, each from the longitude and latitude fields to the corresponding solid and dotted co-ordinates.
The line width and colour can be set in the Line settings. In addition it is possible to make the lines follow the curvature of the earth by setting the Geodesic Lines option to On.
The width of the lines can also be set by dragging a numeric field in the Line Width field:
Well Known Text (WKT) / SQL Server Spatial Data
Well Known Text is a format used to represent shapes on a map. It is supported by SQL Server Spatial data.
To draw a WKT shape on the map, use the Image URL / WKT / SVG field.
WKT objects can be included on the map at the same time as Images and other objects:
Whilst the size field does not impact how the WKT objects are drawn on the map, it must still be supplied (in order for features such as cross-visual highlighting to function). It can contain the a single numeric value which need to relate to an aspect of the object.
Spatial Data in SQL Server
If your shapes are stored in SQL Server using the Geometry or Geography data types, PowerQuery will import these in WKT format.
Note the maximum length of a text field that can be imported via PowerQuery is 32,766 characters. If your WKT has more characters than that, then you will need to split the output into multiple fields and use DAX to concatenate the fields as a new single column or measure.
Background Layer allows you to select from a choice of map backgrounds:
Open Street Map – Standard
Open Street Map – Humanitarian
Stamen – Terrain
Stamen – TonerLite
Stamen – Terrain Background
Stamen – Watercolor
Mapbox – Streets
Mapbox – Outdoors
Mapbox – Dark
Mapbox – Light
Mapbox – Satellite
Mapbox – Satellite Streets
NASAGIBS – ViirsEarthAtNight2012
Thunderforest – Landscape
Thunderforest – Neighbourhood
Thunderforest – Outdoors
Mapbox and Thunderforest layers require an API key or Access Token which is entered in the Mapbox/Thunderforest Access Token field within the background layer settings.
In addition, it is possible to specify a custom tile server by selecting the Custom URI option in the Background Layer dropdown. Selecting this option will make two further textboxes available. One to enter the URI of the tile server (which could include an on-premises server), and an attribution field to ensure that any maps include required attribution notices.
Turning on the daylight curve will show the daylight terminator on the map. This curve is either based on the current date and time – updated every second, or if a field of type DateTime is added to the Daylight Date & Time field of the map, then it will be based on the time represented there. This allows either the current daylight terminator or a historic or future one to be displayed.
Turning on the nautical layer will add an OpenSeaMap layer on top of the current background layer:
Current weather layers can be overlaid on the current background layer. It is necessary to obtain an API key from http://www.openweathermap.org and enter it into the OpenWeatherMap API Key field.
Once the API key has been entered it is possible to turn on the following layers:
The Map Reveal functionality moves up the bottom of the map when one of the map objects is selected, revealing any objects underneath the map. This is specified as a number of pixels to move the map up by. Due to limitations with the way custom visuals work in Power BI, the objects under the map can’t be interacted with, as the map visual is still on top:
The default longitude, latitude and zoom level are used when there is no data on the map, or if auto-zoom is turned off. These set the default centre point and zoom of the map. Zoom levels are 1 to 19.
Turns on or off the zoom buttons.
Turns on or off the map scale
Include WKT object in auto zoom
Turning this option off, means that WKT objects will not be taken into consideration when the map auto zooms into the objects on the map.
Change the colour of the border of shapes, or for lines, the colour of the line itself.
The width of the line or border
The opacity of the line. Setting to 0 will hide borders of shapes.
The colour of WKT polygons
The colour of WKT polygons. Setting to 0 will show only the border, but the shape will still be selectable.
By default, lines drawn on the map are straight. Turning this option on, lines follow the curvature of the earth.
Sets the colour of lines on the map.
Sets the width of lines on the map
The following options apply when report page tooltips are not in use. Turning both off, will prevent tooltips from showing.
Includes the category values as part of a tooltip
Shows the Size value as part of the tooltip.
When on, this will zoom the map in or out to ensure that all objects are visible.
Zoom when only one item
When off the map will not zoom when only one item. When on, the map will zoom to the zoom level specified by the “Zoom level when only one item”.
This is for the scenario where there are multiple items at the same location with different categories. When off, these icons will appear on top of each other. When on, the icons will appear next to each other.
Labels show the category as text alongside the icon. The text size and colour can be customised.
The circle start, mid and end colours are used when the Colour Range field is specified. If a circle range colour is not specified, then the start colour is used.
Opacity of the circle fill colour.
Opacity of the circle border. Set to 0 for no border.
Max and Min Size
Used to set the min and max of the circle sizes
Use Min and Max Size fields for Image Size
When off, the Size field is used to set the width and height of images in pixels.