Skip to content

Commit

Permalink
Correctly name added layers
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMuehlhauserNRCan committed Jan 15, 2025
1 parent 503ae5a commit afe69e0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,11 @@ export function AddNewLayer(): JSX.Element {
(layerEntries as TypeGeoviewLayerConfig[]).forEach((geoviewLayerConfig) => {
if (layerName !== geoviewLayerConfig.geoviewLayerName) {
const tempConfig = geoviewLayerConfig;
tempConfig.listOfLayerEntryConfig[0].layerName = layerName;
if (tempConfig.listOfLayerEntryConfig.length > 1) {
tempConfig.geoviewLayerName = layerName;
} else {
tempConfig.listOfLayerEntryConfig[0].layerName = layerName;
}
const addedLayer = api.maps[mapId].layer.addGeoviewLayer(tempConfig);
if (addedLayer) addedLayers.push(addedLayer);
} else {
Expand Down

0 comments on commit afe69e0

Please sign in to comment.