Frequently Asked Question

How to customize the position and value of the zone label on your Mapline/Drillmap/Webmap
Dernière mise à jour il y a un an

Symptom

  • Change the position of the zone label on the map
  • Use a different value for the zone label

Environment

  • Windows Server / Linux
  • Need4Viz : all versions

Resolution

Various properties can be added in the geojson file of your custom map in order to be used in the N4V Mapline/Webmap/Drillmap components.

The standard properties used in the N4V components are the following :

  • "code": the zone code used for the mapping of your data in Webi
  • "name": the default zone label displayed on the map
  • "latitude" & "longitude": position of the Pie chart on the zone (in GPS lat/lon coordinates)
  • "hc-middle-x" & "hc-middle-y": position of the zone label on the map. By default the label is placed in the middle of the zone polygon barycenter (smart calculation by the N4V engine). But if the "hc-middle-x" & "hc-middle-y" are set, they are used to place the label. Those values can be set between 0 and 1 (0.5 is the middle of the zone polygon). You can change the values to create an offset for the label display on the polygon.

You can also add other labels as you wish to display a different area name according to your needs. For example, if in some cases you want to display a short name (abbreviated, lowercase, ...) on a slightly smaller map, you can add one or more different properties:

  • "short_name": the short/abbreviated name
  • "lowercase_name": the name in lowercase or on several lines (use the HTML tag image to add a line break in the name of the zone)

Ex. of geojson with custom properties :

image

When you have added the additional zone label properties, you must declare them on the N4V engine side, in the \Need4Viz\nodejs\node_modules\custom_element\ce_libs\resources\list_maps_codes.js file:

image

After restarting the N4V services, you can then use these labels in the component (instead of the default "name" field):

image

Veuillez patienter!

S'il vous plaît patienter... il faudra une seconde !