Map
The component for adding a map.
Declaration
object MapProperties
| Name | Type | Description |
|---|---|---|
latitude Required | number | The latitude of the map’s center. Provide both a If no center latitude/longitude has been provided, but one or more map items have been provided, the map automatically determines the center location of the map from the map items. |
longitude Required | number | The If no center latitude/longitude has been provided, but one or more map items have been provided, the map automatically determines the center location of the map from the map items. |
role Required | string | Always |
accessibilityCaption | string | The caption that describes what is visible on the map. The text is used for VoiceOver. For more information about VoiceOver, see the Vision page in Accessibility. If you don’t provide |
anchor | Anchor | An object that defines vertical alignment with another component. |
animation | (ComponentAnimation | string("none")) | An object that defines an animation you apply to the component. Use the |
behavior | (Behavior | string("none")) | An object that defines behavior for a component, like Parallax or Springy. Use the |
caption | string | A string that describes what is displayed on the map. The caption is displayed in the full screen version of the map. This text is used by VoiceOver if |
conditional | (ConditionalComponent | [ConditionalComponent]) | An instance or array of component properties that you can apply conditionally, and the conditions that cause Apple News Format to apply them. |
hidden | boolean | A Boolean value that determines whether the component is hidden. |
identifier | string | An optional unique identifier for this component. If you use |
items | [MapItem] | An array of |
layout | (ComponentLayout | string) | An inline If you don’t define |
mapType | string | A string that defines the type of map to display by default. Valid values:
|
span | MapSpan | An object for defining the visible area of a map, relative to its center. A span is defined in deltas for latitude and longitude. |
style | (ComponentStyle | string | string("none")) | An inline Use the |
Discussion
Use the Map component to display a location or geographical area on a map. You can display multiple pins on a map by setting the items property. (To display a specific point of interest, use the Place component.)
You can omit the latitude and longitude properties for map if at least one item is added to the array of items that defines the location you want to display on the map.
Example
{
"components": [
{
"role": "title",
"text": "Maps"
},
{
"role": "body",
"text": "With turn-by-turn spoken directions, interactive 3D views, proactive suggestions, lane guidance, and more, Maps gets you where you need to go."
},
{
"role": "heading2",
"text": "Map Heading"
},
{
"role": "map",
"mapType": "hybrid",
"latitude": 35.065908,
"longitude": -109.781623
}
]
}