serge-web / serge

Serious Gaming, Evolved - web interface
https://sites.google.com/deepbluec.com/serge/
Apache License 2.0
14 stars 4 forks source link

2867 Core Mapping - filter by shape type #2908

Closed lebaphi closed 4 months ago

lebaphi commented 5 months ago

Fixes #2867

Tristina1788 commented 5 months ago

@lebaphi , @IanMayo Shapetype filter should not show as text input when I don't create more shape item. And after creating more Shape items, 2 filter ShapeType are on filter lists, it should shows only one.

https://github.com/serge-web/serge/assets/107697044/6c2fbe6d-65a2-4485-83b4-2467c5573228

I think it's better for filter ShapeType is dropdown list with all shape type from beginning as below

image

lebaphi commented 5 months ago

Hi @Tristina1788 , @IanMayo about shapeType_should_alway_shows_as_dropdown_list.mp4 issue, I can explain a bit of logic here. When creating a new feature, we assign a shapeType in the feature properties and save it to the db (line 219)

image

So when adding a ShapeType filter, we load the dropdown options by the shapeType feature property (line 411)

image

In your case, the original features don't have a shapeType in the property, so that's why it's showing Input (choices.length === 0)

image

So I think Ian can update the shapeType property for the original features in the db, then will it be fixed.

Tristina1788 commented 5 months ago

Hi @Tristina1788 , @IanMayo about shapeType_should_alway_shows_as_dropdown_list.mp4 issue, I can explain a bit of logic here. When creating a new feature, we assign a shapeType in the feature properties and save it to the db (line 219) image So when adding a ShapeType filter, we load the dropdown options by the shapeType feature property (line 411) image

In your case, the original features don't have a shapeType in the property, so that's why it's showing Input (choices.length === 0) image

So I think Ian can update the shapeType property for the original features in the db, then will it be fixed.

@lebaphi Thanks for explaination. @IanMayo Could you help to update shapeType property for the original features in the db? So I can check again.

IanMayo commented 5 months ago

Hello @philb89 - I've just jumped in to fix the missing data.

But, I realise we don't need a new attribute. The shape-type is part of the GeoJSON standard, it's in the Geometry: image

I realise that our other filters only apply to properties - so I guess we'll need to move it in/out of the properties dictionary when we're changing the selected feature.

I know it's a pain supporting something that isn't in the properties @philb89 - but it's of great benefit that we're providing search for an attribute that should always be present in all GeoJSON data structures.

Tristina1788 commented 4 months ago

@lebaphi @IanMayo This branch still have some conflict. Could you help to resolve it first?

IanMayo commented 4 months ago

Hello @lebaphi - I see there is some outstanding work in supporting the GeoJSON geometry.type field, please.

lebaphi commented 4 months ago

okay @IanMayo, I will take a look

IanMayo commented 4 months ago

Thanks for the update @lebaphi .

@Tristina1788 - do you understand the requirement here, are you able to test? (I can give more explanation if necessary)

Tristina1788 commented 4 months ago

Thanks for the update @lebaphi .

@Tristina1788 - do you understand the requirement here, are you able to test? (I can give more explanation if necessary)

Thanks @IanMayo , I can test it. Now we have filter 'GeoType' with 3 values (Polygon and Point, LineString) and we can filter it as expected

https://github.com/serge-web/serge/assets/107697044/6cf935bc-151b-4131-a1ed-67dff75a0112

IanMayo commented 4 months ago

Thanks @lebaphi

But, in the property selector dialog and the filters panel, could we call it Shape, instead of GeoType please?