Skip to content

Commit

Permalink
replace deprecated utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Raruto committed Jan 23, 2025
1 parent d579ebd commit cd2aa59
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions g3w-admin/openrouteservice/static/openrouteservice/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { ApplicationState, ApplicationService } = g3wsdk.core;
const Inputs = g3wsdk.gui.vue.Inputs.InputsComponents;
const { tPlugin } = g3wsdk.core.i18n;
const { GUI } = g3wsdk.gui;
const { XHR, colorHEXToRGB } = g3wsdk.core.utils;
const { XHR } = g3wsdk.core.utils;
const { CatalogLayersStoresRegistry } = g3wsdk.core.catalog;
const { TaskService } = g3wsdk.core.task;
const { ProjectsRegistry } = g3wsdk.core.project;
Expand Down Expand Up @@ -282,7 +282,7 @@ export default ({
if (qgis_layer_id) {
CatalogLayersStoresRegistry.getLayerById(qgis_layer_id)?.change()
} else {
ApplicationService.reloadCurrentProject();
ApplicationService.changeProject({ gid: ApplicationState.project.getGid() }); // reload current project
}
},

Expand Down Expand Up @@ -311,9 +311,15 @@ export default ({
if ('interval' === name) {
value = this.APP.data.ors.range.length > 1 ? null : (1 * value);
}


// HEX to RGB
if ('color' === name) {
value = colorHEXToRGB(value);
value = value ?? '#FFFFFF';
value = ([
parseInt(value.substr(1,2), 16),
parseInt(value.substr(3,2), 16),
parseInt(value.substr(5,2), 16)
]);
}

if ('from_layer' === name) {
Expand Down

0 comments on commit cd2aa59

Please sign in to comment.