Media Layer (Media)

Media layer displays one media on the map positioned by 4 control points.

Referenced by: operationalLayers

Properties

Property Details
blendMode Blend modes are used to create various effects by blending colors of top and background layers. normal blend mode is the default.
Valid values: average, color, color-burn, color-dodge, darken, destination-atop, destination-in, destination-out, destination-over, difference, exclusion, hard-light, hue, invert, lighten, lighter, luminosity, minus, multiply, normal, overlay, plus, reflect, saturation, screen, soft-light, source-atop, source-in, source-out, vivid-light, xor
effect Effect provides various filter functions to achieve different visual effects similar to how image filters (photo apps) work.
georeference The georeference used to place a media in a MediaLayer.
id A unique identifying string for the layer.
itemId Optional string containing the item ID of the Media Layer item registered on ArcGIS Online or your organization's portal.
layerType String indicating the layer type.
Valid value of this property MediaLayer
maxScale A number representing the maximum scale at which the layer will be visible. The number is the scale's denominator.
mediaType Indicates the type of media that the url points to. The currently supported media types are image and video. Images must be in JPEG or PNG format. For supported video formats, please refer to the MDN video codec guide. mediaType is applicable only when the url is defined.
Valid values:
  • image
  • video
minScale A number representing the minimum scale at which the layer will be visible. The number is the scale's denominator.
opacity The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.
title A user-friendly string title for the layer that can be used in a table of contents.
url URL to the media file. It is not applicable when itemId is defined. The url is relative when the media file is stored as an item resource. Relative urls are only applicable for image media types. video media types only support external video urls at this time. See related mediaType property.
visibility Boolean property determining whether the layer is initially visible in the web map.
visibilityTimeExtent Represents time extent that will control when a layer should be visible based on webmap's current time. Visibility time extent only affects the layer visibility and will not filter the data.

Example

Sample media layer with media stored as a resource in the web map item

{
  "id": "MediaLayer_1234",
  "layerType": "MediaLayer",
  "mediaType": "image",
  "url": "./resources/media/23ba39fd-e5fa-4169-a65f-1b0c8dc122ef.png",
  "visibility": true,
  "opacity": 1,
  "title": "Cosmic Cliffs",
  "blendMode": "multiply",
  "minScale": 0,
  "maxScale": 0,
  "georeference": {
    "coefficients": [
      0.00041916284273128335,
      -0.00012801254624143232,
      -107.88221857339221,
      -0.00011708772565063326,
      -0.000023939400565098393,
      38.006978138302806,
      -0.000003076164047493454,
      0.0000011840018297336857
    ],
    "controlPoints": [
      {
        "x": 89,
        "y": 1918
      },
      {
        "x": 83,
        "y": 101
      },
      {
        "x": 1508,
        "y": 97
      },
      {
        "x": 1517,
        "y": 1906
      }
    ],
    "height": 2048,
    "spatialReference": {
      "wkid": 4267
    },
    "width": 1585
  }
}

Example

Sample media layer with media stored in the associated Media Layer item (referenced in itemId)

{
  "id": "MediaLayer_1234",
  "layerType": "MediaLayer",
  "itemId": "58a541efc59545e6b7137f961d7de883",
  "title": "Cosmic Cliffs"
}

Example

Sample media layer with media stored in the associated Media Layer item, and georeference override

{
  "id": "MediaLayer_1234",
  "layerType": "MediaLayer",
  "itemId": "58a541efc59545e6b7137f961d7de883",
  "title": "Cosmic Cliffs",
  "georeference": {
    "coefficients": [
      0.00041916284273128335,
      -0.00012801254624143232,
      -107.88221857339221,
      -0.00011708772565063326,
      -0.000023939400565098393,
      38.006978138302806,
      -0.000003076164047493454,
      0.0000011840018297336857
    ],
    "controlPoints": [
      {
        "x": 89,
        "y": 1918
      },
      {
        "x": 83,
        "y": 101
      },
      {
        "x": 1508,
        "y": 97
      },
      {
        "x": 1517,
        "y": 1906
      }
    ],
    "height": 2048,
    "spatialReference": {
      "wkid": 4267
    },
    "width": 1585
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.