How to add custom layers in Need4Viz Maplines

Source : Support Need4Viz — KB #23 — Category : Mapline, WebMapline & Drilldown mapline

Symptom

  • Add custom layers for a specific map used in the Mapline component

Environment

  • Windows Server
  • Need4Viz : versions >= 2021.1.0

Resolution

To add custom layers for a specific map used in the Mapline component of N4V :

  1. Get the name of the map file used by the component, on which layers should be added. The maps are js files in the folder ~Tomcat_folder\webapps\N4VCustomElements\res\js\highcharts\maps_xx\ (ex. fr-regions.js for the French region map).
  2. Create a new file with exactly the same name as get in the previous step (but with .json extension instead of .js), in the target folder ~Need4Viz_folder_installation\ nodejs\node_modules\custom_element\ce_lib\resources\mappoints\ (ex. fr-regions . json )
  3. The structure of this new json file as to respect exactly the following : [image: image]
  4. Save the file
  5. In the mapline component, create a chart based on the choosen map
  6. In the settings / extended parameters, open the layers menu and tick the 3 first options [image: image]
  7. You should see the result when applying the settings
  8. [image: image]
  9. You can limit the layers to display on the map by setting the list (use “;” separataor) with layers name [image: image]

Options

You can change the type of marker used on the map.

For geometric maker, you can use 'circle' , 'square' , 'diamond' , 'triangle' and 'triangle-down' . You can also change color of the marker with the “fillColor” propertie.

For a specific online image, you can use 'url(path/graphic.png)' , but the graphic.png file should be accessible by the server in case of print.

For a specific embeded image, you can convert your image on base64 file and use it as 'url(data:image/png;base64,iVBORw0KGgo....)'

Caution

The use of custom files needs to respect exactly the instruction and structure mentionned above.

You can see an example of file in attachment.