本文主要是介绍基于点进行弹框,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
/*点的样式*/var mpJson = {
"points":[[]],
"spatialReference":{"wkid":102021}
};
for (var j=0;j<len;j++){
var mp=[pointInfo.data[j].point.x,pointInfo.data[j].point.y];
mpJson.points.push(mp);
}
var mlpoint = new Multipoint(mpJson);
var red = new PictureMarkerSymbol({
"url":"/img/RedPin1LargeB.png",
"height":16,
"width":16,
"xoffset": 0,
"yoffset": 8
});
/*对数据中所有点进行气泡处理*/
/*对点进行弹框处理*/
var graphic;
arrayUtils.forEach(polyLineJson.paths[0], function(p) {
graphic = new Graphic(new Point(p), red);
map.graphics.on("click", function(evt){
var attr = {"Xcoord":evt.mapPoint.x,"Ycoord":evt.mapPoint.y,"Plant":"Mesa Mint"};
var infoTemplate = new InfoTemplate("Vernal Pool Locations","Latitude: ${Ycoord} <br/>Longitude: ${Xcoord} <br/>Plant Name:${Plant}");
evt.graphic.setInfoTemplate(infoTemplate);
});
map.graphics.add(graphic);
});
这篇关于基于点进行弹框的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!