Arc gis api for js比例尺,书签
dojo.require("esri.map");
dojo.require("esri.dijit.Scalebar");
dojo.require("esri.dijit.Bookmarks");
dojo.require("esri.dijit.BookmarkItem");
1 var scalebar = new esri.dijit.Scalebar({ 2 map: myMap, 3 // "dual" displays both miles and kilmometers 4 // "english" is the default, which displays miles 5 // use "metric" for kilometers 6 scalebarUnit: "dual" 7 }, dojo.byId("scalebardiv")); 8 9 Books = new esri.dijit.Bookmarks({ 10 map: myMap, 11 editable: "true" 12 }, dojo.byId("bookmarks")); 13 14 dojo.connect(button1, "click", addBook); 15 16 } 17 function addBook() { 18 19 var bookextent = myMap.extent; 20 21 var bookmarkItem = new esri.dijit.BookmarkItem({ 22 "extent": bookextent, 23 "name": "北京" 24 }); 25 Books.addBookmark(bookmarkItem); 26 }