Skip To Content

esri_maplayer_get (AutoLISP)

此函数可返回指定图层索引编号的地图或影像图层属性。

语法

(esri_maplayer_get maplayerid)

参数

  • maplayerid | 整型 | 必填 | 可以使用 (esri_maplayers) 获取的与图层相关联的整型索引编号。

示例用法 1

尝试获取索引编号 1 地图图层的地图图层属性。

(esri_maplayer_get 1)

结果示例用法 1

返回索引 1 地图图层的地图图层属性。

(("Id" . 1) ("Name" . "ThreeLayers") ("ItemId" . "eecb1e37eb5b42c5a2d270a5454c17c0") ("ItemUrl" . "https://cadserver.esri.com/portal/home/item.html?id=eecb1e37eb5b42c5a2d270a5454c17c0") ("PortalUrl" . "https://cadserver.esri.com/portal/sharing/rest") ("ItemType" . "MapImageServiceLayer") ("IsConnected" . T) ("ServiceUri" . "https://cadserver.esri.com/server/rest/services/afaHarness/ThreeLayers/MapServer") ("SpatialReference" . "3857") ("Sublayer_0_Name" . "myGroupOfLayers") ("Sublayer_0_Visible" . T) ("Sublayer_1_Name" . "ETH_ThreeLayers_6543") ("Sublayer_1_Visible" . T) ("Sublayer_1_SourceSpRef" . "103122") ("Sublayer_2_Name" . "ETH_ThreeLayers_2882") ("Sublayer_2_Visible" . T) ("Sublayer_2_SourceSpRef" . "2882") ("Sublayer_3_Name" . "ETH_ThreeLayers_6425") ("Sublayer_3_Visible" . T) ("Sublayer_3_SourceSpRef" . "103002") ("Visible" . T) ("Transparency" . 30) ("Dynamic") ("DatumTransformations" ((("From" . "6543") ("To" . "3857") ("Transformation" ((("Direction" . "Reverse") ("Step" . "108354"))))) (("From" . "2882") ("To" . "3857") ("Transformation" ((("Direction" . "Forward") ("Step" . "1901"))))))))
注:
在打印时,设置为 nil 的布尔类型变量将不使用点对标记法显示,如以上示例中的 ("Dynamic") 变量。 这等效于 ("Dynamic" . nil) 并且将在 AutoLISP 中使用相同的方法进行处理。

示例用法 2

尝试获取索引编号 3 影像图层的影像图层属性。

(esri_maplayer_get 3)

结果示例用法 2

返回索引 3 地图图层的影像图层属性。

(("Id" . 3) ("Name" . "CharlotteLAS") ("ItemType" . "RasterServiceLayer") ("IsConnected" . T) ("ServiceUri" . "https://sampleserver6.arcgisonline.com/arcgis/rest/services/CharlotteLAS/ImageServer") ("SpatialReference" . "102719") ("Visible" . T) ("Transparency" . 30) ("Dynamic" . T) ("Allow_Raster_Function" . T) ("ProcessingTemplate" . "RFTShadedReliefElevationColorRamp") ("ProcessingTemplateNames" ("None" "RFTAspectColor" "RFTHillshade" "RFTShadedReliefElevationColorRamp")))

返回值

该函数将返回一个值。

  • 如果成功,SERVICE_PROPERTIES [关联列表] 将返回属性的关联列表,其中具有包含参数及其值的点对。 参数列表将因服务而异。
  • 如果失败,则该函数将返回一个列表,其中第一个值为 nil,并将返回一个包含键值 Error 的关联列表以及字符串形式的关联错误消息:(nil ("Error" . "<message>"))

失败的返回值

出于以下原因,可能出现失败的返回值:

  • (nil ("Error" . "No item selected."))

    未找到指定的地图图层。

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

    未提供一个或多个必填参数。

另请参阅

(esri_maplayers) - 返回工程图中地图和影像图层名称的列表,及其在当前工程图中的图层索引编号。