Adds a map or imagery layer to the current drawing using the specified service properties. The layer will use the current coordinate system of the drawing to which it was added. If the layer is added to a drawing containing no coordinate system, the drawing will inherit it from the layer.
Syntax
(esri_maplayer_add url service_properties)
Arguments
- url | string | required | A valid path to an ArcGIS map or image layer.
- service_properties | associated List | optional | An associated list of map service properties as dotted pairs defined as follows:
Associated label Value type Value description Required or optional "TRANSPARENCY" Integer
Percentage of image transparency to apply to the map: {0-99: zero is opaque} (default = 30)
Optional
Example usage
Attempts to add the map or image layer from the given URL that is 70% transparent: (esri_maplayer_add "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Water_Network/MapServer"
(list
(cons "TRANSPARENCY" 70)
)
)
Result example usage
Adds the map layer and returns a list containing the new map layer index number: (1)
Return values
This function returns a value.
- If successful, it returns a list that includes the new map layer index number.
- If failed, it returns a list with the first value of nil; then an associated list is returned containing the key value Error and an associated error message as a string: (nil ( "Error" . "<message>")).
Failed return values
A failed return value can occur for any of the following reasons:
- (nil ("Error" . "Invalid URL"))
The URL provided is invalid.
- (nil ("Error" . "Error adding layer."))
Could not add a map layer from the supplied URL.
- (nil ("Error" . "Missing required
argument."))
-One or more of the required arguments was not supplied.