Frequently Asked Question
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 :
- 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).
- 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 )
- The structure of this new json file as to respect exactly the following :
- Save the file
- In the mapline component, create a chart based on the choosen map
- In the settings / extended parameters, open the layers menu and tick the 3 first options
- You should see the result when applying the settings
- You can limit the layers to display on the map by setting the list (use ";" separataor) with layers name
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.