1.0.4 • Published 20 days ago

@vcmap/search-wfs v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
20 days 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.

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
}
1.0.4

20 days ago

1.0.3

20 days ago

1.0.2

21 days ago

1.0.1

28 days ago