Eagle Eyes
构造方法:esri.dijit.OverviewMap(params,srcNodeRef)//srcNodeRef是Html元素
params包括:attachTo,baseLayer,expandFactor,expandFactor,opacity;
Attribute Contains:hide,Show,startup,destory。
一个Tip:
在Dijit一系列生命周期中,一个重要方法是启动方法startup,这个方法会在DOM节点被创建并添加到网页之后执行,同时在这个方法也会等待当前小部件中所包含的子控件被创建并正确启动之后执行。
一个简单的鹰眼示例:
function OverviewMap(){
var over =
{
map:Map,
attachTo:"bottom-right",
color:"#F0F0F0“,
expandFactor:2,
baseLayer:new esri.layers.ArcGISTiledMapServiceLayer(MapServer)
};
var MapViewer = new esri.dijit.OverviewMap(over,dojo.byId("OverViewDiv"));
MapViewer.startup();
}
ScaleBar
Constructor: esri.dijit.Scalebar(params,srcNodeRef)
params contain : attachTo; scalebarUnit
Attribute Contain: hide;show
a sample:
function Scalebar()
{
var scalebar = new esri.dijit.Scalebar({map:Map,attachTo:"top-right"},dojo.byID("scaleBarDiv"));//这里通过dojo来获取了html元素.
}
Bookmark
Constructor: esri.dijit.Bookmarks(params,srcNodeRef)
params: bookmarks,editable
methods: addBookmark, hide,removeBookmark , show, toJson
Attribute: bookmarks
Events:onClick , onEdit , onRemove
an Sample:
function BookMarks()
{
var Books = new esri.dijit.Bookmarks({
map:Map,
editable:"true"
},dojo.byID("bookmarks"));
}
function addBook()
{
var bookextent = Map.extent;
var bookmarkItem = new esri.dijit.BookmarkItem({
"extent":bookextent,
"name":"深圳"
}
);
Books.addBookmark(bookmarkItem);
}
InfoWindow
InfoWindow is a HTML window,this window usual shows the attribute of Graphics.If Graphic has defined an InfoTemplate,the window will show those info the InfoTemplate defined when you click the graphic.Each map only has one InfoWindow,and there is no constructor for it.
Methods:hide,move,resize,setContent,setFixedAnchor,setTitle,show
Attribute:anchor,coords,fixedAnchor,isShowing
Events:onHide,onShow.