Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,10 @@ export class GeoengineRenderer extends Component {
this.styleVectorLayerAndLegend(vector, data, layer);
this.useRelatedModel(vector, layer, data);
} else {
const data = this.props.data.records;
// Filter records with coordinates for styling vector layers & legends
const data = this.props.data.records.filter(
(record) => record.data[vector.geo_field_id[1]] !== false
);
this.styleVectorLayerAndLegend(vector, data, layer);
this.addSourceToLayer(data, vector, layer);
}
Expand Down Expand Up @@ -823,7 +826,10 @@ export class GeoengineRenderer extends Component {
this.styleVectorLayerAndLegend(cfg, data, lv);
this.useRelatedModel(cfg, lv, data);
} else {
const data = this.props.data.records;
const geo_field_id_name = cfg.geo_field_id[1];
const data = this.props.data.records.filter(
(record) => record.data[geo_field_id_name] !== false
);
if (!data.length) {
return new ol.layer.Vector({
source: new ol.source.Vector(),
Expand All @@ -850,10 +856,13 @@ export class GeoengineRenderer extends Component {

async getModelData(cfg, fields_to_read) {
const domain = this.evalModelDomain(cfg);
const geo_field_id_name = cfg.geo_field_id[1];
let data = await this.orm.searchRead(cfg.model, [domain][0], fields_to_read);
const modelsRecords = this.models.find((e) => e.model.resModel === cfg.model)
.model.records;
data = data.map((data) => modelsRecords.find((rec) => rec.resId === data.id));
data = data
.map((data) => modelsRecords.find((rec) => rec.resId === data.id))
.filter((rec) => rec.data[geo_field_id_name] !== false);
return data;
}

Expand Down
Loading