Skip To Content

esri_weblayer_add (AutoLISP)

Adds a new map layer, imagery layer, or a web feature layer to the drawing using the specified URL. This function consolidates the (esri_maplayer_add) and (esri_webfeaturelayer_add) AutoLISP functions of previous versions into one function. You can add all the feature layers from a feature service or specify the URL of a specific layer within a feature service

Syntax

(esri_weblayer_add url)

Arguments

  • url | string | required | URL of a valid web layer to add to the drawing as a layer.
    Note:

    The URL string must contain unicode quote marks. Word processing software often defaults to other types of quote characters. So be careful when cut-n-pasting URL from such sources.

Example usage

Attempt to add all of the feature layers of the pool permits feature server to the current drawing:

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

Result example usage

Adds all of the feature layers of the pool permits feature server to the current drawing and returns a list of true:

 (T)

Return values

  • If successful, returns a list of true: (T)
  • If failed, 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>"))

A failed return value can occur for any of the following reasons:

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

    The required argument is not supplied.

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

    The URL provided is invalid.

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

    The URL provided is invalid.

  • (nil ("Error" . "Invalid parameter type."))

    The supplied argument was not a valid URL string.

  • (nil ("Error" . "Unable to add data from this URL"))

    Was not able to add a layer from the URL, check to see if the URL is valid.