Skip To Content

esri_webfeaturelayer_add (AutoLISP)

Adds a new web feature layer with an optional filtering query. Resulting features within the project area will be drawn. If the web layer being added is secure, the user will be prompted to enter credentials as required by the portal.

Syntax

(esri_webfeaturelayer_add url [service_properties])

Arguments

  • url | string | required | URL of a valid web feature layer to add to the drawing.
  • service_properties | associated list | optional | An associated list of web feature layer properties as dotted pairs as defined in the following table:

Associated labelValue typeValue descriptionRequired or optional
"DEFINITIONEXPRESSION"

String

WHERE clause expression to limit features from the layer by attribute values. The syntax of the WHERE clause is determined by the source data.

Required

Example usage 1

Attempt to add the USA Major Cities web feature layer where the FID field value is greater than 3800:

(esri_webfeaturelayer_add "https://www.arcgis.com/home/item.html?id=85d0ca4ea1ca4b9abf0c51b9bd34de2e"
(list (cons "DEFINITIONEXPRESSION" "FID > 3800")))

Result example usage 1

Adds the USA Major Cities web feature layer and draws features within the current project area where the FID field value is greater than 3800 and the function returns a list of true:

(T)

Example usage 2

Attempt to add the USA States Generalized Boundaries web feature layer and features where the STATE_NAME field value starts with the letter N:

(esri_webfeaturelayer_add "https://esri.maps.arcgis.com/home/item.html?id=8c2d6d7df8fa4142b0a1211c8dd66903"
(list (cons "DEFINITIONEXPRESSION" "STATE_NAME LIKE \'N%\'")))

Result example usage 2

Adds the USA States Generalized Boundaries web feature layer, draws features within the project area where the STATE_NAME field value starts with the letter N, and the function returns a list of true:

(T)

Example usage 3

Attempt to add all PoolPermits feature layers without any filtering query:

(esri_webfeaturelayer_add "http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/FeatureServer")

Result example usage 3

Adds the PoolPermits web feature layer, draws all features within the project area, and the function returns a list of true:

(T)

Return values

The following are the possible return values:

  • If successful, the function returns a list of true: (T)
    Note:
    Software asynchronous behavior

    If the provided URL can be interpreted, it will return (T) even though the service is not fully added. It will return (T) before the features have completed drawing. A return value of (nil) typically means the service did not connect.

  • If failed, it returns a list with the first value of nil and then an associated list containing the key value "Error" and an associated error message as a string: (nil ("Error" . "<message>")), or only (nil).

Failed return values

Failed return values can occur for any of the following reasons:

  • (nil ("Error" . "Invalid URL"))

    The URL provided is invalid.

  • (nil ("Error" . "Error"))

    The URL provided is invalid.

  • (nil ("Error" . "Missing required argument."))

    One or more of the required arguments was not supplied.

See also

(esri_docfeaturelayer_add) | Adds a new document feature layer.

(esri_weblayer_add) | Adds a new web layer: image layer, map image layer, or web feature layer.