调用 Portal 中 WebMap 并显示图例
通过3.x的api调用webmap,并显示图例
发起人
相关问题
- 在windows server2008 R2 64位中安装了portal 10.5 设置好托管arcgis server站点,并用data store为托管数据库,发布数据出错
- ArcGIS图例问题
- arcgis10.4 离线部署js api 4.3 版本 无法显示
- Arcgis for server 集群调用
- 使用ArcGIS Desktop10.2版本,如何设置图例横着放且label在正下方?
- ArcGis打开图层后显示unknown units,想要define一个投影坐标系,但数据大小似乎不一致
- 如何改变坐标的小数点后显示位数?
- arcgis api for js中三维的TileLayer默认会显示在MapImageLayer的下面且显示顺序无法调整吗
- ArcGIS JS API同时调用天地图和超图服务冲突?
- portal for arcgis 1031使用管理员角色创建的3d场景怎么没有发布功能?
- 请问如何在C# ArcEngine开发中调用GP工具处理后将数据保存到到任意位置?并读取?
问题状态
- 最新活动: 2018-05-31 16:24
- 浏览: 3107
- 关注: 2 人
1 个回复
邵明升
赞同来自: fengye
用户使用的3.x的api,想调用WebMap,并显示图例
【解决方案】:
require([
"esri/map",
"esri/arcgis/utils",
"esri/dijit/Legend",
"dojo/domReady!"], function(Map, arcgisUtils,Legend) {
arcgisUtils.arcgisUrl = " https://sms.esrichina.com/port ... 3B%3B
arcgisUtils.createMap("f6caf2ca33fc46d6b53bcd9c7f099791", "mapDiv").then(function (response) {
map = response.map;
var legend = new Legend({
map: map,
layerInfos:(arcgisUtils.getLegendLayers(response))
}, "legendDiv");
legend.startup();
});
});
需要定义一个div,id=“legendDiv”,并且要设置样式
#legendDiv{
background-color: #fff;
position: absolute !important;
z-index: 99;
top:10px;
right:20px;
}
要回复问题请先登录或注册