-
container
String
|
HTMLElement
表示包含小部件的 DOM 元素的 ID 或節點。該屬性隻能設置一次。以下示例都是使用小部件時的有效用例。
例子:
// Create the HTML div element programmatically at runtime and set to the widget's container const basemapGallery = new BasemapGallery({ view: view, container: document.createElement("div") }); // Add the widget to the top-right corner of the view view.ui.add(basemapGallery, { position: "top-right" });
// Specify an already-defined HTML div element in the widget's container const basemapGallery = new BasemapGallery({ view: view, container: basemapGalleryDiv }); // Add the widget to the top-right corner of the view view.ui.add(basemapGallery, { position: "top-right" }); // HTML markup <body> <div id="viewDiv"></div> <div id="basemapGalleryDiv"></div> </body>
// Specify the widget while adding to the view's UI const basemapGallery = new BasemapGallery({ view: view }); // Add the widget to the top-right corner of the view view.ui.add(basemapGallery, { position: "top-right" });
基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/widgets/Widget"], (Widget) => { /* code goes here */ });
ESM:
import Widget from "@arcgis/core/widgets/Widget";
類:
esri/widgets/Widget
繼承: Widget > Accessor
子類: AreaMeasurement2D , AreaMeasurement3D , Attachments , Attribution , BasemapGallery , BasemapLayerList , BasemapToggle , Bookmarks , BuildingExplorer , ButtonMenu , Compass , CoordinateConversion , DatePicker , Daylight , DirectLineMeasurement3D , Directions , DistanceMeasurement2D , Editor , ElevationProfile , Expand , Feature , FeatureForm , FeatureTable , FeatureTemplates , FloorFilter , Fullscreen , HeatmapSlider , Histogram , HistogramRangeSlider , Home , LayerList , Legend , LineOfSight , Locate , Measurement , NavigationToggle , Popup , Print , ScaleBar , ScaleRangeSlider , Search , SearchResultRenderer , ShadowCast , Sketch , Slice , Slider , SmartMappingSliderBase , SnappingControls , Swipe , TableList , TimePicker , TimeSlider , Track , UtilityNetworkTrace , Weather , Zoom
自從:用於 JavaScript 4.2 的 ArcGIS API
用法說明
Widget.container
函數(或屬性)的定義如下:
相關用法
- JavaScript ArcGIS Widget.classes用法及代碼示例
- JavaScript ArcGIS Widget.when用法及代碼示例
- JavaScript ArcGIS Widget.on用法及代碼示例
- JavaScript ArcGIS Widget.visible用法及代碼示例
- JavaScript ArcGIS WebTileLayer layerview-create-error事件用法及代碼示例
- JavaScript ArcGIS WMSLayer.on用法及代碼示例
- JavaScript ArcGIS WebTileLayer.maxScale用法及代碼示例
- JavaScript ArcGIS WebMap.saveAs用法及代碼示例
- JavaScript ArcGIS WaterSymbol3DLayer.waveDirection用法及代碼示例
- JavaScript ArcGIS WMTSLayer.minScale用法及代碼示例
- JavaScript ArcGIS WebMap.save用法及代碼示例
- JavaScript ArcGIS WebScene.loadAll用法及代碼示例
- JavaScript ArcGIS WFSLayer refresh事件用法及代碼示例
- JavaScript ArcGIS WFSLayerView.availableFields用法及代碼示例
- JavaScript ArcGIS WebMap.destroy用法及代碼示例
- JavaScript ArcGIS WMTSLayer.maxScale用法及代碼示例
- JavaScript ArcGIS Weather.when用法及代碼示例
- JavaScript ArcGIS WFSLayerView.effect用法及代碼示例
- JavaScript ArcGIS WFSLayer.orderBy用法及代碼示例
- JavaScript WeakMap set()用法及代碼示例
- JavaScript ArcGIS WebMap.basemap用法及代碼示例
- JavaScript ArcGIS WebTileLayer.refreshInterval用法及代碼示例
- JavaScript ArcGIS WMSLayer.when用法及代碼示例
- JavaScript ArcGIS WCSLayer layerview-create-error事件用法及代碼示例
- JavaScript ArcGIS WebTileLayer.urlTemplate用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 Widget.container。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。