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

Question about filtering layers using open attribute table function #119

Open
ghost opened this issue Jun 18, 2020 · 2 comments
Open

Question about filtering layers using open attribute table function #119

ghost opened this issue Jun 18, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 18, 2020

Hi

When I open attribute table to filter my layers,
if filtering only one layer, it works well so that it will display filtered points corrently.

But when I filter two or more layers at the same time, it won't display filtered points correctly.

It seems like the last filtered information is always used so that old filtered information is ignored for some reason.

Do you have any ideas on this behaviour? or any workaround for this?

@uprel
Copy link
Member

uprel commented Jun 19, 2020

Hi,

That's true, it's current limitation that takes only current layer and override any previous filters.

Code is here:
https://github.com/uprel/gisapp/blob/65714a2e6951a620e0ca49d32162d7933dabef73/client/site/js/WebgisInit_functions.js#L1790

It should be changed to add new filter to existing when calling
thematicLayer.mergeNewParams

But cannot simply just add, because it's different logic if existing map filter already contains filter for current layer or it contains filter for any other layer.

@ghost
Copy link
Author

ghost commented Jun 19, 2020

Thank you for your reply.
I understand that it is not easy to fix this issue.

Is there any better workaroud for this?

For workaroud, I am thinking about making two layers into one layer
and apply filter to that unioned layer.

But in that case I need to filter text using "IN" or "OR" conditions...

For example,
Layer1 has country names with geom data

  • country1 geom
  • country2 geom

Layer2 has city names with geom data

  • city1 geom
  • city2 geom

I can make Layer3 which both have country and city names with geom data

  • country1 geom
  • country2 geom
  • city1 geom
  • city2 geom

but if I want to show only country1 and city2 on Map, I need to filter
the attribute by querying something like "name IN ('country1', 'city2')"

It seems like we cannot use IN clause nor Or clause for filtering attribute table,
but is there any change to modify the code with least work possible?

Thank you

@uprel uprel added enhancement and removed bug labels Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant