Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed GIS View not showing the coordinates and polygons #462

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion spp_base_gis/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ def set_gis_field_name(self, in_tuple):
return in_tuple
field_obj = self.env["ir.model.fields"]
name = field_obj.browse(in_tuple[0]).name
return (in_tuple[0], name, in_tuple[1], field_obj.browse(in_tuple[0]).field_description)
return (
in_tuple[0],
name,
in_tuple[1],
field_obj.browse(in_tuple[0]).field_description,
field_obj.browse(in_tuple[0]).ttype,
)

@api.model
def get_gis_layers(self, view_id=None, view_type="gis", **options):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ export class GisRenderer extends Component {
createDefaultDataLayers(layer) {
let layer_obj = {};
const visibility = layer.isVisible ? "visible" : "none";
const geoType = layer.geo_field_id[3];
const geoType = layer.geo_field_id[4];
const opacity = Math.min(1, Math.max(0, layer.layer_opacity));

if (geoType === "Polygon") {
if (geoType === "geo_polygon") {
layer_obj = {
id: layer.id,
type: "fill",
Expand All @@ -330,7 +330,7 @@ export class GisRenderer extends Component {
};
}

if (geoType === "Point") {
if (geoType === "geo_point") {
layer_obj = {
id: layer.id,
type: "circle",
Expand All @@ -346,7 +346,7 @@ export class GisRenderer extends Component {
};
}

if (geoType === "LineString") {
if (geoType === "geo_line") {
layer_obj = {
id: layer.id,
type: "line",
Expand Down Expand Up @@ -445,17 +445,17 @@ export class GisRenderer extends Component {
async onDataLayerChanged() {
for (const layer of this.dataLayersStore.getLayers) {
const visibility = layer.isVisible ? "visible" : "none";
const geoType = layer.geo_field_id[3];
const geoType = layer.geo_field_id[4];
const opacity = Math.min(1, Math.max(0, layer.layer_opacity));
let layerType = "";

if (geoType === "Point") {
if (geoType === "geo_point") {
layerType = "circle";
}
if (geoType === "LineString") {
if (geoType === "geo_line") {
layerType = "line";
}
if (geoType === "Polygon") {
if (geoType === "geo_polygon") {
layerType = "fill";
}

Expand Down
Loading