Skip to content

Sync Map does not work if the geometry is too complex #2452

@offtherailz

Description

@offtherailz

Description

Using a complex spatial filter the cql_filter will be longer than max URL size. This happens mainly when you try to retrieve spatial filter from some geocoding service.

Please indicate if this issue is related to a bug or a new feature request

  • Bug
  • New Feature

In case of Bug (otherwise remove this paragraph)

Browser Affected
(use this site: https://www.whatsmybrowser.org/ for non expert users)

  • Internet Explorer
  • Chrome
  • Firefox
  • Safari

Steps to reproduce

  • Configure mapstore to use wfsGeocoder (or use an instance configured to do that, see info below).
  • Open feature grid for a vector layer
  • Open query panel
  • Select spatial filter from geocoder
  • Perform search
  • Activate query panel

Expected Result

  • The map is in sync with the filter

Current Result

  • You can not see changes or anything. Looking on dev tools you can see a lot of errors (url too long)

Notes

Not sure it is feasible in any map lib. Maybe OpenLayers provides a way to do some post request and so avoid the issue. Most probably this problem can not be fixed with Leaflet. Not sure about Cesium.

We should evaluate to catch the specific error and notify the user that syncmap can not be used in this condition.

Info

to configure the wfsGeoCoder you have to setup something like the following in localConfig.js (or open an instance that is already configured to do that).
See documentation

"spatialMethodOptions": [
  {"id": "Viewport", "name": "queryform.spatialfilter.methods.viewport"},
  {"id": "BBOX", "name": "queryform.spatialfilter.methods.box"},
  {"id": "Circle", "name": "queryform.spatialfilter.methods.circle"},
  {"id": "Polygon", "name": "queryform.spatialfilter.methods.poly"},
  {
      "id": "methodId",
      "name": "methodName",
      "type": "wfsGeocoder",
      "url": "urlToGeoserver",
      "filterProps": {
          "blacklist": [],
          "maxFeatures": 5,
          "predicate": "LIKE",
          "queriableAttributes": ["ATTRIBUTE_X"],
          "typeName": "workspace:typeName",
          "valueField": "ATTRIBUTE_Y"
      },
      "customItemClassName": "customItemClassName"
  }

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions