====== Custom maplines in N4V ====== Source : [[https://www.need4viz.com/documents/install/Custom_maplines_in_N4V.pdf|install/Custom_maplines_in_N4V.pdf]] N4V FOR WEBI Custom Maps Mapline · Drillmap · DeepMap Integrating your own base maps into the N4V map components GeoJSON preparation · Map declaration · Cluster deployment · Troubleshooting Document Value Document version 3.0 — December 2026 %%Replaces Custom maps integration V2.1 (2024-12-02)%% Audience SAP BI administrators, map designers N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap Contents 1. Purpose and scope............................................................................................................................3 1.1 Notation used in this guide.................................................................................................................................3 1.2 Prerequisites.......................................................................................................................................................3 2. Common step: prepare the map file..................................................................................................4 3. Mapline.............................................................................................................................................5 4. Drillmap............................................................................................................................................6 5. DeepMap (new component)..............................................................................................................7 5.1 Mandatory properties per level..........................................................................................................................7 5.2 Steps....................................................................................................................................................................8 6. Deployment and use in Webi.............................................................................................................9 7. Upgrading N4V................................................................................................................................10 8. Troubleshooting..............................................................................................................................11 © Need4Viz · need4viz.com2 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap 1. Purpose and scope This guide explains how to integrate your own base maps (administrative boundaries, sales territories, building floor plans…) into the three map components of N4V FOR WEBI. The principle is the same for all three: a map file on the Tomcat side, and a declaration on the N4V Node.js server. Component Rendering Levels Map folder (Tomcat) Map list (N4V Node.js) Mapline %%Choropleth, plus a mini-chart per%% area (pie) or in a popup on click %%1 maps_custom _list_genmaps.json%% Drillmap %%Same as Mapline, with a drill-%% down to a lower level %%2 maps_custom%% %%_list_gendrillmaps.js%% on DeepMap (new) Choropleth only 1 to 5 %%maps_custom_dee%% p %%list_deepmaps_conf.js%% %%, _list_deepmaps.json%% T I P How to choose: you need a chart per area, on 1 or 2 levels → Mapline or Drillmap; you need to drill down up to 5 levels with simple area colouring → DeepMap. 1.1 Notation used in this guide %%■{WEBAPP} = tomcat\webapps\N4VCustomElements on each Tomcat server hosting the N4V webapp.%% %%■{CE} = Need4Viz\nodejs\node_modules\custom_element on each N4V (Node.js) server.%% %%■dkx = custom index of a Mapline or Drillmap map (e.g. dk3). The index range is specific to each customer%% and is given to you when you download your setup. Each new map uses a free index. In our examples, the range goes from dk3 to dk72. %%■abc0, abc1, abc2 = DeepMap file names. The actual prefix is the one of the files Need4Viz delivered to%% you. 1.2 Prerequisites %%■Write access to the {WEBAPP} and {CE} folders on all servers.%% %%■An editor that preserves UTF-8 encoding (Notepad++, VS Code).%% %%■To simplify or reproject your maps: mapshaper.org and/or QGIS.%% ■The full product documentation is available at help.need4viz.com. © Need4Viz · need4viz.com3 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap 2. Common step: prepare the map file Every map starts from a clean, lightweight and enriched GeoJSON file, then converted into a JavaScript file. This preparation is the same for all three components; only the mandatory properties differ (see each component). 1.Get the GeoJSON of your boundaries (open data, internal GIS, QGIS export…). 2.Make it lighter. Aim for less than 1.5 MB per file for fast display in Webi and in the browser. Reduce coordinate precision or simplify polygons, for example with mapshaper.org. %%3.One feature per area. Merge all polygons sharing the same code (in mapshaper: -dissolve code%% command). 4.Set the properties of each area: –code: area identifier, used in Webi to link your data to the map. Always in quotes, even if numeric ("69", not 69). –name: label displayed on the map. –Optional: other naming properties (short name, abbreviation…) that the designer can choose in Webi. 5.Mapline and Drillmap, geographic maps: add latitude and longitude to each area, the coordinates of %%its centroid. They are used to place the area's mini-chart (pie). Not needed for a non-geolocated floor%% plan, nor for DeepMap. %%6.Mapline and Drillmap: declare the projection in the global properties of the GeoJSON (header) with hc-%% %%transform, in proj4 format. QGIS shows it in Project Properties > CRS. Not needed for DeepMap, which%% reprojects by itself if necessary. %%7.Convert to JavaScript: add Highcharts.maps[""] = at the very beginning of the file, then rename%% %%it .js (dk3.js for a Mapline, abc0.js for a DeepMap). The name in brackets and the file name%% must be identical. %%8.Save as UTF-8, without changing the original encoding.%% Example of a Mapline file ready to deploy (excerpt): %%Highcharts.maps["dk3"] = {%% "type": "FeatureCollection", %%"hc-transform": { "default": { "crs": "+proj=longlat +datum=WGS84 +no_defs" } },%% %%"features": [%% %%{%% "type": "Feature", %%"properties": {%% "code": "101", "name": "Islev Skoledistrikt", "latitude": 55.6950, "longitude": 12.4500 %%},%% %%"geometry": { "type": "Polygon", "coordinates": [ ... ] }%% %%}%% %%]%% %%};%% © Need4Viz · need4viz.com4 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap %%QGIS: Project Properties > CRS, proj4 string to copy into hc-transform%% 3. Mapline A Mapline uses a single dkx.js file, declared in the map list on the Node.js side. %%1.Deploy the map. Copy dkx.js to {WEBAPP}\res\js\highcharts\maps_custom on each Tomcat server.%% %%2.Add the map to the list. In {CE}\ce_settings\lang_EN\_list_genmaps.json (and lang_FR if N4V is used%% in French), add an entry: –id: the chosen index (dk3); –name: the label shown in the map list; –description: leave "", but the key is mandatory. %%[%% %%{ "id": "dk2", "name": "Denmark : Municipalities", "description": "" },%% %%{ "id": "dk3", "name": "Denmark : Rødovre skoledistrikter", "description": "" }%% %%]%% %%3.Restart the Need4Viz service (Start_Need4Viz.ps1 script in a PowerShell window) so that it reloads the%% configuration. I M P O R T A N T %%Watch the syntax: a missing comma between two entries is enough to make the component's Extended%% parameters disappear in Webi. Validate the file with a JSON editor before saving it. Correct entry: do not omit the comma between two entries N O T E No Tomcat restart is needed. © Need4Viz · need4viz.com5 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap 4. Drillmap %%A Drillmap = a level 1 map, and for each of its areas a level 2 map that opens on click. Each map is prepared%% like a Mapline and has its own index. %%1.Prepare the level 1 map (e.g. dk24.js). In addition to code and name, each area has hc-key: the index of%% %%the level 2 map to open on click (e.g. "hc-key": "dk25").%% 2.Prepare the level 2 maps (e.g. dk25.js, dk26.js…), one per level 1 area, like Maplines. %%3.Deploy all files to {WEBAPP}\res\js\highcharts\maps_custom on each Tomcat server.%% %%4.Add the map to the list in {CE}\ce_settings\lang_EN\_list_gendrillmaps.json (and lang_FR if%% %%needed), with the level 1 index and the same syntax as _list_genmaps.json.%% 5.Restart the Need4Viz service. © Need4Viz · need4viz.com6 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap 5. DeepMap (new component) %%DeepMap colours areas (choropleth) on 1 to 5 nested levels (e.g. regions > counties > towns), with one or%% %%several files per level. It does not display a mini-chart per area. The simplest approach is to keep the names of%% the files delivered by Need4Viz and replace their content with your maps: the delivered configuration then remains valid as is. %%DeepMap · 3-level example%% %%A single file per level is enough: on drill-down, the component automatically displays only the areas whose%% %%parent-code matches the clicked area. If a level is too heavy (e.g. all the towns of a country), split it into%% %%several files to reduce what is loaded in memory. Each area of the upper level then points, via hc-key, to the%% %%file containing its sub-areas.%% 5.1 Mandatory properties per level Property Level 1 (abc0.js) Intermediate levels (abc1.js) Last level (abc2.js) code Area code, identical to your Webi data Same Same name Label displayed on the map Same Same %%hc-key%% %%Name of the next level's file, without%% .js: "abc1" if the next level fits in a single file, otherwise the file %%containing the area's sub-areas%% "abc2" or the file %%containing the sub-areas%% None %%parent-code None%% code of the parent area in abc0.js code of the parent area in abc1.js Example, one area per level: %%// abc0.js – level 1%% %%{ "code": "84", "name": "Auvergne-Rhône-Alpes", "hc-key": "abc1" }%% %%// abc1.js – level 2%% %%{ "code": "69", "name": "Rhône", "hc-key": "abc2", "parent-code": "84" }%% %%// abc2.js – level 3%% %%{ "code": "69123", "name": "Lyon", "parent-code": "69" }%% © Need4Viz · need4viz.com7 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap 5.2 Steps 1.Prepare one file per level (common step) with the properties above. Each file starts with %%Highcharts.maps["abc0"] = (the file name without .js). No latitude/longitude nor hc-transform:%% the component reprojects by itself if necessary. %%2.Replace the files in {WEBAPP}\res\js\highcharts\maps_custom_deep on each Tomcat server.%% %%3.Check the configuration on each N4V server: {CE}\ce_libs\resources\list_deepmaps_conf.js and%% %%{CE}\ce_settings\lang_EN\_list_deepmaps.json / lang_FR\_list_deepmaps.json must be the ones%% delivered by Need4Viz. 4.Restart the Need4Viz service. %%5.Allow the tile servers used for the base map: tiles.need4viz.com, *.tile.osm.org,%% %%*.tile.opentopomap.org, and any other internal or external provider you use.%% N O T E For an additional DeepMap, other file names or a different number of levels, contact Need4Viz support: the configuration will be provided to you. © Need4Viz · need4viz.com8 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap 6. Deployment and use in Webi On a cluster, each file must be present on all relevant nodes, otherwise the map is only displayed for some of the users. File Where to copy it Component dkx.js %%{WEBAPP}\res\js\highcharts\maps_custom, each Tomcat%% server Mapline, Drillmap %%abc*.js%% %%{WEBAPP}\res\js\highcharts\maps_custom_deep, each%% Tomcat server DeepMap %%list_deepmaps_conf.js {CE}\ce_libs\resources, each N4V server DeepMap%% %%_list_genmaps.json {CE}\ce_settings\lang_EN and lang_FR, each N4V serverMapline%% %%_list_gendrillmaps.jso%% n %%{CE}\ce_settings\lang_EN and lang_FR, each N4V serverDrillmap%% %%_list_deepmaps.json {CE}\ce_settings\lang_EN and lang_FR, each N4V serverDeepMap%% Once the files are in place and the Need4Viz service restarted: %%1.In a Webi report, add a table with the area code (identical to the map's code) and your measures.%% 2.Turn it into a Mapline, Drillmap or DeepMap component and map the parameters (code, values…). 3.In the Extended parameters, choose your map from the list. 4.Apply: the map is displayed with your data. Extended parameters: choosing the new map in the list Map rendering in Webi © Need4Viz · need4viz.com9 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap 7. Upgrading N4V N O T E The N4V setup automatically backs up and restores the configuration files, and stops and restarts the N4V services by itself. As a precaution, still keep a copy of your map files before each upgrade. ☐ %%Before the upgrade: copy your maps (maps_custom\dkx.js, maps_custom_deep\abc*.js) and your%% %%configuration files (list_deepmaps_conf.js, _list_genmaps.json, _list_gendrillmaps.json,%% %%_list_deepmaps.json in EN and FR).%% ☐ After the upgrade: check in Webi that each custom map appears in the list and is displayed. ☐ %%If missing: put back the relevant backed-up file and restart the Need4Viz service.%% © Need4Viz · need4viz.com10 N 4 V F O R W E B ICustom Maps — Mapline, Drillmap, DeepMap 8. Troubleshooting Most issues come from a JSON syntax error, a code that does not match, or a file missing from one of the servers. Symptom What to check %%The component's Extended parameters are%% no longer displayed %%Syntax of the modified _list_*.json file (comma between entries,%% quotes, brackets) The new map does not appear in the list %%Entry in _list_genmaps.json, _list_gendrillmaps.json or%% %%_list_deepmaps.json for the language in use; Need4Viz service%% restarted The map is not displayed .js file present on each Tomcat server, in the right folder; same name %%in Highcharts.maps["…"] and in the file name; file syntax%% Mapline, Drillmap: partial map, or only a few pies on a white background %%hc-transform value (projection); latitude / longitude values of the%% areas Some areas remain uncoloured although data exists %%Webi codes identical to the map's code (leading zeros, case); codes in%% quotes in the map Drillmap or DeepMap: clicking does not drill down to the lower level %%hc-key = exact name of the next level's file, without .js%% DeepMap: areas missing at the lower level %%parent-code identical to the parent area's code (same leading zeros,%% same case) DeepMap: no base map Tile servers allowed by the firewall or proxy Unreadable accented characters, or any other issue %%UTF-8 encoding of the .js and .json files, unchanged from the original%% files Symptom of a syntax error: the Extended parameters menu has disappeared If the problem persists, open a ticket at support.need4viz.com, attaching the map file and the modified configuration files. © Need4Viz · need4viz.com11