arcgis 4.x 不用点击线才会显示Popup 怎么实现
var polylineGraphic = new Graphic({
id: "baba",
geometry: {
type: "polyline",
paths: [
[-111.30, 52.68],
[-98, 49.5],
[-93.94, 29.89]
]
},
symbol: {
type: "simple-line",
color: [226, 119, 40],
width: 4
},
attributes: {
Name: "Keystone Pipeline",
Owner: "TransCanada",
Length: "3,456 km"
},
popupTemplate: {
title: "{Name}",
content: [{
type: "fields",
fieldInfos: [{
fieldName: "Name"
}, {
fieldName: "Owner"
}, {
fieldName: "Length"
}]
}]
}
});
我给Graphic一个Id,然后我去遍历所有的Graphic, 当id == baba的时候 拿到他的popupTemplate显示出来,怎么实现4.x用的那个方法显示Popup找不到啊
2 个回复
swaggyP - 网络粉刷匠
赞同来自:
gishome - GIS之家,我们的团队,具备丰富的webgis项目开发经验以及开源GIS项目经验(openlayer+geoserver、三维开源GIS cesium.js);GIS之家知乎专栏:https://zhuanlan.zhihu.com/gishome
赞同来自:
view.popup.open({ title: "You clicked here", // title displayed in the popup content: "This is a point of interest", // content displayed in the popup updateLocationEnabled: true // updates the location of popup based on // selected feature's geometry });
view.popup.open({ features: graphics, // array of graphics featureMenuOpen: true, // selected features initially display in a list });
要回复问题请先登录或注册
发起人
最帅的人
相关问题
问题状态