当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


JavaScript ArcGIS SceneView.widthBreakpoint用法及代码示例


基本信息

以下是所在类或对象的基本信息。

AMD: require(["esri/views/SceneView"], (SceneView) => { /* code goes here */ });

ESM: import SceneView from "@arcgis/core/views/SceneView";

类: esri/views/SceneView

继承: SceneView > View > Accessor

自从:用于 JavaScript 4.0 的 ArcGIS API

用法说明

SceneView.widthBreakpoint函数(或属性)的定义如下:

widthBreakpoint String


指示视图宽度的一般大小的便利属性。该值是根据视图宽度在断点属性中定义的范围内确定的。请参阅下表以获取可能值的列表。使用断点属性来覆盖默认阈值。

请参阅 styling guide 以获取有关使用此函数的更多信息。

可能的值 说明 默认阈值(像素)
xsmall 视图的宽度小于xsmall断点中设置的值。 < 545
small 视图的宽度介于 xsmallsmall 断点中设置的值之间。 545 - 768
medium 视图的宽度介于 smallmedium 断点中设置的值之间。 769 - 992
large 视图的宽度介于 mediumlarge 断点中设置的值之间。 993 - 1200
xlarge 视图的宽度大于large断点中设置的值。 > 1200

可能的值"xsmall"|"small"|"medium"|"large"|"xlarge"

例子:

view.watch("widthBreakpoint", function(newVal){
  if (newVal === "xsmall"){
    // clear the view's default UI components if
    // app is used on a mobile device
    view.ui.components = [];
  }
});

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 SceneView.widthBreakpoint。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。