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


JavaScript ArcGIS MediaContent用法及代码示例


基本信息

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

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

ESM: import MediaContent from "@arcgis/core/popup/content/MediaContent";

类: esri/popup/content/MediaContent

继承: MediaContent > Content > Accessor

自从:用于 JavaScript 4.11 的 ArcGIS API

用法说明

MediaContent 弹出元素包含要在弹出内容中显示的图表和/或图像媒体元素的单个或数组。

popuptemplate-media-piechart

例子:

layer.popupTemplate.content = [{
  // The following creates a piechart in addition to an image. The chart is
  // also set  up to work with related tables.
  // Autocasts as new MediaContent()
  type: "media",
  activeMediaInfoIndex: 1,
  // Autocasts as array of MediaInfo objects
  mediaInfos: [{
    title: "<b>Count by type</b>",
    type: "pie-chart", // autocasts as new PieChartMediaInfo
    // Autocasts as new ChartMediaInfoValue object
    value: {
      fields: ["relationships/0/Point_Count_COMMON"],
      normalizeField: null,
      tooltipField: "relationships/0/COMMON"
    }
  }, {
    title: "<b>Mexican Fan Palm</b>",
    type: "image", // Autocasts as new ImageMediaInfo object
    caption: "tree species",
    // Autocasts as new ImageMediaInfoValue object
    value: {
      sourceURL: "https://www.sunset.com/wp-content/uploads/96006df453533f4c982212b8cc7882f5-800x0-c-default.jpg"
    }
  }]
}];

相关用法


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