- Changes the language from french to english or english to french and reloads the map if it exists. Note: this will change the
- names of the layers, as maintainGeocoreLayerNames is set to false. In this case, we will lose any custom names, and they will
- have to be reinserted (in the new language). If set to true, the layer names will remain as they were.
+
+
+
+ Changes the language from french to english or english to french and reloads the map if it exists.
+ Note: The checkbox determines if the layer names are kept as is, or replaced with the names from the service (in the new language).
Code
+
+
+
+ Creates and updates a map config, replacing some of the default layer names (from above) and refreshes the map.
+ Note: This will replace any layer name from the array with its partner, the order that the pairs are in, and the order of the names in the pair do not matter.
+
+ Code
+
+ const pairs = [["Radioactivité de l'air", 'Radioactivity'], ['Périmètre de localisation des stations', 'Perimeter'], ['Carte commémorative du Canada', 'Commemorative Map']];
+ const mapConfig = cgpv.api.maps.Map1.createMapConfigFromMapState();
+ cgpv.api.maps.Map1.replaceMapConfigLayerNames(pairs, mapConfig);
+ refreshMap();
+
+
+
+
+ Creates and updates a map config, replacing some of the layer names (from above) and refreshes the map.
+ Note: This will replace any layer name from the array with its partner, the order that the pairs are in, and the order of the names in the pair do not matter.
+
+ Code
+
+ const pairs = [["Radioactivité de l'air", 'Radioactivity'], ['Périmètre de localisation des stations', 'Perimeter'], ['Carte commémorative du Canada', 'Commemorative Map']];
+ const mapConfig = cgpv.api.maps.Map1.createMapConfigFromMapState();
+ cgpv.api.maps.Map1.replaceMapConfigLayerNames(pairs, mapConfig);
+ refreshMap();
+