ArcGIS api for javascript——地圖配置-

來源:互聯網
上載者:User

標籤:round   寬度   cgi   class   java   html 4.01   defaults   com   null   

描述

本例展示了如果刪除縮放等級滑動器的刻度標記。通過設定esriConfig裡的sliderLabel為null來實現:

esriConfig.defaults.map.sliderLabel = null;

預設情況下,縮放等級滑動器是垂直方向的。可以通過設定滑動器的高度屬性為null來使滑動器改為水平方向。

esriConfig.defaults.map.slider = { right:"10px", bottom:"10px", width:"200px", height:null };

如本例所示,能夠通過設定esriConfig上的屬性來改變縮放等級滑動器的大小。 這裡高度被設定為100像素。 寬度為null表示滑動器將是垂直方向的。

esriConfig.defaults.map.slider = { right:"10px", top:"10px", width:null, height:"100px" };

 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 2 <html> 3   <head> 4     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 5     <meta http-equiv="X-UA-Compatible" content="IE=7" /> 6     <title>增加沒有刻度的滑動器</title> 7     <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.5/js/dojo/dijit/themes/tundra/tundra.css"> 8     <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.5"></script> 9     <script type="text/javascript"> 10    11         dojo.require("esri.map");12         function init() {13             14             //增加沒有刻度的滑動器15             esriConfig.defaults.map.sliderLabel = null; 16             //將滑動器設定為水平方向17             //esriConfig.defaults.map.slider = { right:"10px", bottom:"10px", width:"200px", height:null };18             //將滑動器設定為垂直方向19               //esriConfig.defaults.map.slider = { right:"10px", top:"10px", width:null, height:"100px" };         20             var map = new esri.Map("map");          21             var layer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer");      22             map.addLayer(layer);23         24         }25         dojo.addOnLoad(init);      26         27     </script>28   </head>29    <body class="tundra">30     <div id="map" style="width:1024px; height:512px; border:1px solid #000;"></div>31   </body>32 </html>33  34  

 

ArcGIS api for javascript——地圖配置-

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.