当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python ArcGIS WebMap.basemap用法及代码示例


本文简要介绍 python 语言中 arcgis.mapping.WebMap.basemap 的用法。

用法:

property basemap

返回:

作为字典的底图图层列表

获取/设置 WebMap 中的基本Map图层。

Parameter

Description

value

必需的字符串。您想要将什么底图应用于Map(‘topo’、‘national-geographic’等)。有关完整列表,请参阅basemapsgallery_basemaps

例子:

# Usage example 1: Get the basemap used in the web map

from arcgis.mapping import WebMap
wm = WebMap(wm_item)

wm.basemap
>> {"baseMapLayers": [
    {"id": "defaultBasemap",
    "layerType": "ArcGISTiledMapServiceLayer",
    "url": "https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",
    "visibility": true,
    "opacity": 1,
    "title": "Topographic"
    }],
    "title": "Topographic"
    }

# Usage example 2: Set the basemap used in the web map
from arcgis.mapping import WebMap
wm = WebMap(wm_item)

print(wm.basemaps)
>> ['dark-gray-vector', 'gray-vector', 'hybrid', 'oceans', 'osm', 'satellite', 'streets-navigation-vector', 'streets-night-vector', 'streets-relief-vector', 'streets-vector', 'terrain', 'topo-vector']
wm.basemap = 'dark-gray'
print(wm.gallery_basemaps)
>> ['custom_dark_gray_canvas', 'imagery', 'imagery_hybrid', 'light_gray_canvas', 'custom_basemap_vector_(proxy)', 'world_imagery_(proxy)', 'world_street_map_(proxy)']
wm.basemap = 'custom_dark_gray_canvas'

# Usage example 3: Set the basemap equal to an item
from arcgis.mapping import WebMap
wm = WebMap(wm_item)
# Use basemap from another item as your own
wm.basemap = wm_item_2
wm.basemap = tiled_map_service_item
wm.basemap = image_layer_item
wm.basemap = wm2.basemap
wm.basemap = wm2

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 arcgis.mapping.WebMap.basemap。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。