Skip to content

Commit

Permalink
Merge branch 'GEOLYTIX:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cityremade authored May 2, 2024
2 parents 11c0e6d + 909354e commit 76ef045
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
10 changes: 10 additions & 0 deletions lib/layer/format/vector.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ function clusterConfig(layer) {
return;
};

// Check if distance is defined as <1 and layer is a format wkt
if (layer.cluster.distance < 1) {

console.warn(`Layer: ${layer.key}, cluster.distance is less than 1 [pixel]. The cluster config will be removed.`)

// Remove the cluster object
delete layer.cluster;
return;
}

// If cluster.resolution is used, the layer srid must be set to 3857.
if (layer.cluster.resolution) {

Expand Down
2 changes: 1 addition & 1 deletion lib/mapp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if (window.ol === undefined) {

if (olVersion < _ol.current) {

console.warn(`The current support OL version ${ol?.util.VERSION} supersedes the loaded version.`)
console.warn(`Update the current OpenLayers version:${ol?.util.VERSION} to ${_ol.current}.`)
}
}

Expand Down
10 changes: 6 additions & 4 deletions lib/ui/layers/filters.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ async function generateMinMax(layer, filter, minmax) {
})}`);

// If the response contains response.min or response.max - we can assume the query was successful.
// Have to check that response is not null as well
response ??= {}
if (response[minmax]) {
filter[minmax] = filter.type === 'integer' ? Math.round(response[minmax]) : parseFloat(response[minmax]);
}
Expand All @@ -162,12 +164,12 @@ async function filter_numeric(layer, filter) {

if (!filter.max) {

generateMinMax(layer, filter, 'max');
await generateMinMax(layer, filter, 'max');
}

if (!filter.min) {

generateMinMax(layer, filter, 'min');
await generateMinMax(layer, filter, 'min');
}

if (!filter.step) {
Expand All @@ -189,8 +191,8 @@ if (!filter.min) {
entry.filterInput = true
applyFilter(layer);

// Only if filter.min and filter.max are defined should the slider be rendered.
if (!filter.min || !filter.max) {
// Only if filter.min and filter.max are not numeric values, return a message.
if (isNaN(filter.min) || isNaN(filter.max)) {
// Return text to indicate that the min and max values are not defined.
return mapp.utils.html.node`<div>${mapp.dictionary.no_data_filter}</div>`
};
Expand Down
2 changes: 1 addition & 1 deletion public/views/_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ <h1>Account admin</h1>

if (JSON.stringify(e._cell.value) === JSON.stringify(e._cell.oldValue)) return;

xhrPromise(`${document.head.dataset.dir}/api/user/update?email=${e._cell.row.data.email}&field=roles&value=${e._cell.value}`)
xhrPromise(`${document.head.dataset.dir}/api/user/update?email=${e._cell.row.data.email}&field=roles&value=${encodeURIComponent(e._cell.value)}`)
}
}

Expand Down

0 comments on commit 76ef045

Please sign in to comment.