Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Canadian-Geospatial-Platform/geoview
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1985fedcd752945ba46af9cd79b4b90a98cd0c5c
Choose a base ref
..
head repository: Canadian-Geospatial-Platform/geoview
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9820dd32490d227a9d365f86380d00ff889e2c3d
Choose a head ref
1 change: 1 addition & 0 deletions packages/geoview-core/public/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -110,6 +110,7 @@
"errorServer": "source is not valid",
"errorNotLoaded": "An error occured when loading the layer",
"errorProj": "does not support current map projection",
"errorImageLoad": "Error loading source image for layer: __param__ at zoom level __param__",
"only": "only",
"opacity": "Opacity",
"opacityMax": "Maximum from parent",
1 change: 1 addition & 0 deletions packages/geoview-core/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
@@ -110,6 +110,7 @@
"errorServer": "source n'est pas valide",
"errorNotLoaded": "Une erreur s'est produite lors du chargement de la couche",
"errorProj": "ne prend pas en charge la projection cartographique actuelle",
"errorImageLoad": "Erreur de chargement de l'image source pour le couche: __param__ au niveau de zoom __param__",
"only": "seulement",
"opacity": "Opacité",
"opacityMax": "Maximum du parent",
16 changes: 4 additions & 12 deletions packages/geoview-core/src/geo/layer/gv-layers/abstract-gv-layer.ts
Original file line number Diff line number Diff line change
@@ -29,17 +29,7 @@ import { MapEventProcessor } from '@/api/event-processors/event-processor-childr
import { MapViewer } from '@/geo/map/map-viewer';
import { AbstractBaseLayer } from './abstract-base-layer';
import { TypeGeoviewLayerType, TypeOutfieldsType } from '@/api/config/types/map-schema-types';

const translations = {
en: {
errorImageLoad: 'Error loading source image for layer: ',
errorZoomLevel: ' at zoom level ',
},
fr: {
errorImageLoad: "Erreur de chargement de l'image source pour le couche: ",
errorZoomLevel: ' au niveau de zoom ',
},
};
import { getLocalizedMessage } from '@/core/utils/utilities';

/**
* Abstract Geoview Layer managing an OpenLayer layer.
@@ -259,7 +249,9 @@ export abstract class AbstractGVLayer extends AbstractBaseLayer {
const lang = document.getElementById(this.getMapId())!.getAttribute('data-lang') as 'en' | 'fr';
// Add notification with the current zoom level
this.getMapViewer().notifications.showError(
`${translations[lang].errorImageLoad}${this.getLayerName()}${translations[lang].errorZoomLevel}${this.getMapViewer().getView().getZoom()}`
getLocalizedMessage('layers.errorImageLoad', lang),
[this.getLayerName()!, this.getMapViewer().getView().getZoom()!],
true
);
}

1 change: 1 addition & 0 deletions packages/geoview-core/src/geo/layer/other/geocore.ts
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ export class GeoCore {
const tempLayerConfig = { ...layerConfig } as unknown as TypeGeoviewLayerConfig;
tempLayerConfig.metadataAccessPath = response.layers[0].metadataAccessPath;
tempLayerConfig.geoviewLayerType = response.layers[0].geoviewLayerType;
// Use the name from the first layer if none is provided in the config
if (!tempLayerConfig.geoviewLayerName) tempLayerConfig.geoviewLayerName = response.layers[0].geoviewLayerName;

const config = new Config(this.#displayLanguage);