2.0.0 • Published 9 months ago

@vcmap/search-wfs v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

WFS Search Plugin

Extends search widget using Web Feature Service (WFS)

Configuration:

PropertyTypeStateDescription
urlstringrequiredURL of the search service
addressMappingRecord<string, string>requiredMapping the feature attributes to the VC Map Address Balloon attributes
getFeatureOptionsol.format.WFS.writeGeFeatureOptionsrequiredThe options passed to writeGetFeature for WFS query
isStoredQuerybooleanoptionalWether this is a wfs:StoredQuery. Stored query filter expressions are treated as entire Query not just the body of the Query. All attributes of the query tag are copied at runtime (featureType etc)
filterExpressionstringrequiredThe filter expression as a template. Is passed an array of tokens (the result of .match(regEx))
regExstringrequiredThe RegEx to use for tokenizing.
minTokennumberrequiredThe minimum number of RegEx groups to find in a given string to search. For instance if requiring both a street and house number, the count would be 2.
projectionProjectionOptionsoptionalThe projection of the data. Defaults to WGS84

Example:

{
  "url": "./search-wfs",
  "addressMapping": {
    "city": "ort",
    "street": "strasse",
    "number": "hnr",
    "zip": "plz"
  },
  "getFeatureOptions": {
    "featureNS": "http://gingko.de/dueren",
    "featurePrefix": "dueren",
    "featureTypes": ["hausnummern"],
    "maxFeatures": 10,
    "geometryName": "geom",
    "srsName": "urn:ogc:def:crs:EPSG::4326"
  },
  "filterExpression": "<ogc:Filter xmlns='http://www.opengis.net/wfs' xmlns:ogc=\"http://www.opengis.net/ogc\"><% if (token[2]) { %><ogc:And>      <ogc:PropertyIsLike wildCard=\"%\" singleChar=\"_\" escape=\"\\\">        <ogc:PropertyName>dueren:strasse</ogc:PropertyName>        <ogc:Literal><%= token[1] %></ogc:Literal>      </ogc:PropertyIsLike>    <ogc:PropertyIsEqualTo>      <ogc:PropertyName>dueren:hnr</ogc:PropertyName>      <ogc:Literal><%= token[2] %></ogc:Literal>    </ogc:PropertyIsEqualTo></ogc:And><% } else { %>      <ogc:PropertyIsLike wildCard=\"%\" singleChar=\"_\" escape=\"\\\">        <ogc:PropertyName>dueren:strasse</ogc:PropertyName>        <ogc:Literal><%= token[1] %></ogc:Literal>      </ogc:PropertyIsLike><% } %>    </ogc:Filter>",
  "regEx": "([a-zA-ZßäöüÄÖÜ\\.\\-\\s]+)\\s*([0-9]+\\s*[a-zA-Z]*)?",
  "minToken": 1
}
2.0.0

9 months ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago