1. 程式人生 > >幾何物件不一定要疊加,可以根據幾何物件確定資訊顯示的位置

幾何物件不一定要疊加,可以根據幾何物件確定資訊顯示的位置

//幾何物件不一定要疊加,可以根據幾何物件確定資訊顯示的位置
var CurPos = new Point(CurX, CurY, map.spatialReference);
map.infoWindow.setContent("長度:" + caculateResult);    //顯示的內容
map.infoWindow.show(CurPos);    //顯示的位置

//確定中心點
var CurX = (currentGrahpic.cache._extent.xmax +currentGrahpic.cache._extent.xmin) / 2;
var CurY = (currentGrahpic.cache._extent.ymax+currentGrahpic.cache._extent.ymin) / 2;
var CurPos = new Point(CurX, CurY, map.spatialReference);