This project is for a Sisense plugin, which generates a new widget type for MapboxGL maps. This map takes data points, in Latitude and Longitude format, and automatically groups them for display when zoomed out.
The following steps will walk through the process of adding the new chart type and creating a sample map.
STEP 1 - ADD THE PLUGIN
Download the attached .zip file, and extract it to the following path "[Sisense installation path]\PrismWeb\Plugins".
STEP 2 - Get your Mapbox API Token
Open the included file, config.js, and add your mapbox API token in the apiToken setting. For more information on how to obtain a mapbox token, please use the following links
STEP 3 - Create the widget
On your dashboard, click the Create Widget button and select Advanced Configuration. Next, select Mapbox GL from the dropdown. In the data tab, there are several panels for adding data.
- Latitude*: The latitude field for each data point (must be a number)
- Longitude*: The longitude field for each data point (must be a number)
- Label: If used, this is the label that will show up within the tooltip for each point
- Value*: One or more measures to calculate per point. The first value added is also used to determine the coloring of the points
STEP 4 - Formatting
Basemap: This is the background to use for each widget. We've included the default public map styles, but you can add to this by editing the config.js file. For more information on creating your own basemaps, check out Mapbox's documentation site
Style: This is the grouping setting, can be clustering or heatmap. If Clustering is selected, the widget will generate larger circles to group the points. For heatmap, the points are blended together so they don't show up overlapping. Either way, zooming into the map will eventually show the specific data points
Tooltip: Determines how the tooltips are triggered
STEP 5 - Using the widget
- You can drag directly on map to pan across your data
- Double clicking on the map zooms in, and you can also use the scroll wheel of your mouse
- In order to make filter selections, hold down the shift key and draw a shape on the map. Once selected, a filter will be added to the dashboard for the Latitude and Longitude
- You can reset any filter selections by clicking the "Reset" button at the top left of the chart
- This sample has been confirmed working on Sisense version 7.0.1, and should be backwards compatible with previous version.
- There is a known limitation with this plugin, as it does not support export to PDF
Please sign in to leave a comment.