arcgis.apps.storymap module
StoryMap Implementation
TheStoryMap
is the main entry point into the Story Map module.
StoryMap
- classarcgis.apps.storymap.story.StoryMap(item:Item|str|None=None,gis:GIS|None=None)
Bases:
object
A Story Map is a web map that has been thoughtfully created, given context, and providedwith supporting information so it becomes a stand-alone resource. It integrates maps, legends,text, photos, and video and provides functionality, such as swipe, pop-ups, and time sliders,that helps users explore this content.
ArcGIS StoryMaps is the next-generation storytelling tool in ArcGIS, and story authors areencouraged to use this tool to create stories. The Python API can help you create and edityour stories.
Create a Story Map object to make edits to a story. Can be created from an item of type ‘Story Map’,an item id for that type of item, or if .nothing is passed, a new story is created from a generic draft.
If an Item or item_id is passed in, only published changes or new drafts are taken from the Story Map.If you have a story with unpublished changes, they will not appear when you construct your story with the API.If you start to work on your Story that has unpublished changes and save from the Python API, yourunpublished changes on the GUI will be overwritten with your work from the API.
Parameter
Description
item
Optional String or Item. The string for an item id or an item of type‘Story Map’. If no item is passed, a new story is created and saved toyour active portal.
gis
Optional instance of
GIS
. If none provided the active gis is used.- add(content:Image|Video|Audio|Embed|Map|Button|Text|Gallery|Timeline|Sidecar|Code|Table|None=None,caption:str|None=None,alt_text:str|None=None,display:str=None,position:int|None=None)
Use this method to add content to your StoryMap. content can be of various class types and whenyou add this content you can specify a caption, alt_text, display style, and the positionat which it will be in your story.Not passing in any content means a separator will be added.
Parameter
Description
content
Optional content of type:
Image
,Gallery
,Video
,Audio
,Embed
,Map
,Text
,Button
,Timeline
,Sidecar
Swipe
,Separator
,Code
,Table
caption
Optional String. Custom text to caption the webmap.
alt_text
Optional String. Custom text to be used for screen readers.
display
Optional String. How the item will be displayed in the story map.
For Image, Video, Audio, or Map object.Values: “standard” | “wide” | “full” | “float”
For Gallery:Values: “jigsaw” | “square-dynamic”
For Embed:Values: “card” | “inline”
For Swipe:Values: “small” | “medium” | “large”
position
Optional Integer. Indicates the position in which the content will beadded. To see all node positions use the
node
property.- Returns:
A String depicting the node id for the content that was added.
new_story=StoryMap()# Example with Image>>>image1=Image("<image-path>.jpg/jpeg/png/gif ")>>>new_node=new_story.add(image1,position=2)# Example with Map>>>my_map=Map(<item-idoftypewebmap>)>>>new_node=new_story.add(my_map,"A map caption","A new map alt-text")# Example to add a Separator>>>new_node=new_story.add()>>>print(new_story.nodes)
- propertycontent_list
Get a list of all the content instances in order of appearance in the story.This returns a list of class instances for the content in the story.
- copy_content(target_story:StoryMap,node_list:list)
Copy the content from one story to another. This will copy the contentindicated to the target story in the order they are provided. To change theorder once the nodes are copied, use themove() method on the target story.
Note
Do not forget to save the target story once you are done copying and makingany further edits.
Note
This method can take time depending on the number of resources. Each resource comingfrom a file must be copied over and heavy files, such as videos or audio, can be timeconsuming.
Parameter
Description
target_story
Required StoryMap instance. The target story that the content will becopied to.
node_list
Required list of content. The list of contentthat will be copied to the target story.You can get the list of contentsfor the story using thecontent_list property.
- Returns:
True if all content have been successfully copied over.
- cover(title:str|None=None,type:str=None,summary:str|None=None,by_line:str|None=None,image:Image|None=None)
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Cover class instead found when callingcontent_list property.
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Cover class instead found when callingcontent_list property.
A story’s cover is at the top of the story and always the first node.This method allows the cover to be edited by updating the title, byline, image, and more.Changing one part of the story cover will not change the rest of the story cover. If just theimage is passed in then only the image will change.
Note
To change the date seen on the story cover, use the
cover_date
property.Parameter
Description
title
Optional string. The title of the StoryMap cover.
type
Optional string. The type of story cover to be used in the story.
Values:"full"|"sidebyside"|"minimal"
summary
Optional string. The description of the story.
by_line
Optional string. Crediting the author(s).
image
Optional url or file path or
Image
object. The cover image for the story cover.- Returns:
Dictionary representation of the story cover node.
story=StoryMap(<storyitem>)story.cover(title="My Story Title",type="minimal",summary="My little summary",by_line="python_dev")story.save()
- propertycover_date
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Cover class instead found when callingcontent_list property.
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Cover class instead found when callingcontent_list property.
Get/Set the date type shown on the story cover.
Parameter
Description
date_type
Optional String. Set the desired date type for the story cover.
Values:"first-published"|"last-published"|"none"
- credits(content:str|None=None,attribution:str|None=None,heading:str|None=None,description:str|None=None)
Credits are found at the end of the story and thus are always the last node.
To create a credit, add the text that should be shown on each side of the divider.content represents the text seen on the left side and attribution is in line with contenton the right side of the divider. (i.e. ‘content’ | ‘attribution’)
Adding
content
andattribution
will add a new line to the credits and will not change previouscredits.Adding
heading
anddescription
will change what is currently in place.Parameter
Description
content
Optional String. The content to be added. (Seen on the left side ofthe credits.)
Make sure text has ‘<strong> </strong>’ tags.Adds to the existing credits.
attribution
Optional String. The attribution to be added. (Seen on right side ofthe credits.)Adds to the existing credits.
heading
Optional String. Replace current heading for credits.
description
Optional String. Replace current description for credits.
- Returns:
A list of strings that are the node ids for the text nodes that belong to credits.
#Example>>>story=StoryMap()>>>story.credits("Python Dev","Python API Team","Thank You","A big thank you to those who contributed")
- duplicate(title:str|None=None)
Duplicate the story. All items will be duplicated as they are. This allows you to createa story template and duplicate it when you want to work with it.
It is highly recommended that once the duplicate is created, open it in Story Mapsbuilder to ensure the issue checker finds any issues before editing.
Note
Can be used with ArcGIS Online or with ArcGIS Enterprise starting 10.8.1
Parameter
Description
title
Optional string. The title of the duplicated story. Only available forArcGISOnline.
- Returns:
The Item that was created.
# Example for ArcGIS Online>>>story=StoryMap(<storyitem>)>>>story.duplicate("A Story Copy")# Example for ArcGIS Enterprise>>>story=StoryMap(<storyitem>)>>>story.duplicate()
- get(node:str|None=None,type:str|None=None)
Deprecated since version 2.2.0:get method has been deprecated, usecontent_list property instead.
Deprecated since version 2.2.0:get method has been deprecated, usecontent_list property instead.
Get node(s) by type or by their id. Using this function will help grab a specific nodefrom the story if a node id is provided. Set this to a variable and this way edits can bemade on the node in the story.
Parameter
Description
node
Optional string. The node id for the node that should be returned.This will return the class of the node if of type story content.
type
Optional string. The type of nodes that user wants returned.If none specified, list of all nodes returned.
Values:image |video |audio |embed |webmap |text |button |separator |expressmap |webscene |immersive |code
- Returns:
If type specified: List of node ids and their types in order of appearance in the story map.
If node_id specified: The node itself.
>>>story=StoryMap(<storyitem>)# Example get by type>>>story.get(type="text")Returns a list of all nodes of type text# Example by id>>>text=story.get(node="<id for text node>")>>>text.propertiesReturns a specific node of type text
- get_theme()→str
Get the theme name or the theme item that is used in the story.
return: The theme name or the theme item item_id.
- move(node_id:str,position:int|None=None,delete_current:bool=False)
Move a node to another position. The node currently at that position willbe moved down one space. The node at the current position can be deletedinstead of moved ifdelete_current is set to True.
Parameter
Description
node_id
Required String. The node id for the content that will be moved. Find alist of node order by using the
nodes
property.position
Optional Integer. Indicates the position in which the content will beadded. If no position is provided, the node will be placed at the end.
delete_current
Optional Boolean. If set to True, the node at the current position willbe deleted instead of moved down one space. Default is False.
new_story=StoryMap()# Example with Image>>>image1=Image("<image-path>.jpg/jpeg/png/gif")>>>image2=Image("<image-path>.jpg/jpeg/png/gif")>>>new_node=new_story.add(image1,"my caption","my alt-text","float",2)>>>new_story.add(image2)>>>new_story.move(new_node,3,False)
- navigation(nodes:list[str]|None=None,hidden:bool|None=None)
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Navigation class instead found when callingcontent_list property.
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Navigation class instead found when callingcontent_list property.
Story navigation is a way for authors to add headings aslinks to allow readers to navigate between different sectionsof a story. The story navigation node takes
TextStyle.HEADING
text stylesas its only allowed children.You can only have 30Text
child nodesas visible and act as links within a story.The text nodes must already exist in the story. Pass the list of node ids for the headingtext nodes to assign them to the navigation.
Parameter
Description
nodes
Optional list of nodes to include in the navigation. These nodes canonly be of style heading (“h2”).Include in order. This will override current list and order.
To see current list use
navigation_list
property.hidden
Optional boolean. If True, the navigation is hidden.
- Returns:
List of nodes in the navigation.
#Example>>>story=StoryMap("<existing story id>")>>>story.navigation_list>>>story.navigation(["<header node id>","<header node id>"],False)
- save(title:str|None=None,tags:list|None=None,access:str=None,publish:bool=False,make_copyable:bool=None,no_seo:bool=None)
This method will save your Story Map to your active GIS. The story will be savedwith unpublished changes unlesspublish parameter is specified to True.
The title only needs to be specified if a change is wanted, otherwise existing titleis used.
Warning
Publishing your story through the Python API means it will not go through the Story Mapissue checker. It is recommended to publish through the Story Maps builder if youwant your story to go through the issue checker.
Warning
Changes to the published story may not be visible for up to one hour. You can openthe story in the story builder to force changes to appear immediately and performother optimizations, such as updating the story’s social/SEO metadata.
Parameter
Description
title
Optional string. The title of the StoryMap.
tags
Optional string. The tags of the StoryMap.
access
Optional string. The access of the StoryMap. If none is specified, thecurrent access is kept. This is used whenpublish parameter is setto True.
Values:private |org |public
publish
Optional boolean. If True, the story is saved and also published.Default is false so story is saved with unpublished changes.
make_copyable
Optional boolean. If True, the story is saved as copyable for users.
no_seo
Optional boolean. If True, the story is saved without SEO metadata.
- Returns:
The Item that was saved to your active GIS.
- set_logo(image:str|None=None,link:str|None=None,alt_text:str|None=None)
Set the logo for the story. The logo is seen in the header of the story.
Note
To remove the logo, link, or alt text, pass in an empty string. If they are None, nothingwill be changed for that parameter. For example if you only want to update the link but leavethe image and alt text as is, pass in None for the image and alt text. Pass in the new linkfor the link parameter.
Parameter
Description
image
Required string. The file path to the image to be used as thelogo.
link
Optional string. The url to link to when the logo is clicked.
alt_text
Optional string. The alt text to be used for screen readers.
- Returns:
True if successful.
story=StoryMap("<story item>")story.set_logo("<image-path>.jpg/jpeg/png/gif")
- show(width:int|None=None,height:int|None=None)
Show a preview of the story. The default is a width of 700 and height of 300.
Parameter
Description
width
Optional integer. The desired width to show the preview.
height
Optional integer. The desired height to show the preview.
- Returns:
An Iframe display of the story map if possible, else the item url is returned to beclicked on.
- propertystory_locale
Get/Set the locale and language of the story.
If your story was created with the Python API then the default is “en-US”
- theme(theme:Themes|str=Themes.SUMMIT)
Each story has a theme node in its resources. This method can be used to change the theme.To add a custom theme to your story, pass in the item_id for the item of type Story Map Theme.
Parameter
Description
theme
Required Themes Style or custom theme item id.The theme to set the story to.
Values:SUMMIT |TIDAL |MESA |RIDGELINE |SLATE |OBSIDIAN |<item_id>
>>>fromarcgis.apps.storymapimportThemes>>>story=StoryMap()>>>story.theme(Themes.TIDAL)
Image
- classarcgis.apps.storymap.story_content.Image(path:str|None=None,**kwargs)
Bases:
object
Class representing animage from a url or file.
Warning
Image must be smaller than 10 MB to avoid having issues when saving or publishing.
Note
Once you create an Image instance you must add it to the story to be able to edit it further.
Parameter
Description
path
Required String. The file path or url to the image that will be added.
- propertyalt_text
Get/Set the alternate text property for the image.
Parameter
Description
alt_text
String. The new alt_text for the Image.
- Returns:
The alternate text that is being used.
- propertycaption
Get/Set the caption property for the image.
Parameter
Description
caption
String. The new caption for the Image.
- Returns:
The caption that is being used.
- propertyfull_view
This property, if True, will set the image to fit to screen. Enable this optionfor portrait images you would like readers to see in their entirety withoutscrolling. This constraint does not apply when the story is viewed on a smallscreen, and other image sizing options may have no effect when it is enabled.
Parameter
Description
enable
Boolean. Set to True to enable full view.
- Returns:
A boolean representing if full view is enabled.
- propertyimage
Get/Set the image property.
Parameter
Description
image
String. The new image path or url for the Image.
- Returns:
The image that is being used.
Video
- classarcgis.apps.storymap.story_content.Video(path:str|None=None,**kwargs)
Bases:
object
Class representing avideo from a url or file
Note
Once you create a Video instance you must add it to the story to be able to edit it further.
Parameter
Description
path
Required String. The file path or embed url to the video that willbe added.
Note
URL must be an embed url.Example: “https://www.youtube.com/embed/G6b7Kgvd0iA”
- propertyalt_text
Get/Set the alternate text property for the video.
Parameter
Description
alt_text
String. The new alt_text for the Video.
- Returns:
The alternate text that is being used.
- propertycaption
Get/Set the caption property for the video.
Parameter
Description
caption
String. The new caption for the Video.
- Returns:
The caption that is being used.
- propertydisplay
Get/Set display for the video.
Values:small |wide |full |float
Note
Cannot change display when video is created from a url
Audio
- classarcgis.apps.storymap.story_content.Audio(path:str|None=None,**kwargs)
Bases:
object
This class represents content that is of typeaudio. It can be created froma file path and added to the story.
Note
Once you create an Audio instance you must add it to the story to be able to edit it further.
Parameter
Description
path
Required String. The file path to the audio that will be added.
- propertyalt_text
Get/Set the alternate text property for the audio.
Parameter
Description
alt_text
String. The new alt_text for the Audio.
- Returns:
The alternate text that is being used.
- propertyaudio
Get/Set the audio path.
Parameter
Description
audio
String. The new audio path for the Audio.
- Returns:
The audio that is being used.
Embed
- classarcgis.apps.storymap.story_content.Embed(path:str|None=None,**kwargs)
Bases:
object
Class representing awebpage orembedded audio.Embed will show as a card in the story.
Note
Once you create an Embed instance you must add it to the story to be able to edit it further.
Parameter
Description
path
Required String. The url that will be added as a webpage, video, oraudio embed into the story. Make sure your url includes “https://” or “http://”.
- propertyalt_text
Get/Set the alternate text property for the embed.
Parameter
Description
alt_text
String. The new alt_text for the Embed.
- Returns:
The alternate text that is being used.
- propertycaption
Get/Set the caption property for the webpage.
Parameter
Description
caption
String. The new caption for the Embed.
- Returns:
The caption that is being used.
- propertylink
Get/Set the link property.
Parameter
Description
link
String. The new url for the Embed.
- Returns:
The embed that is being used.
Map
- classarcgis.apps.storymap.story_content.Map(item:Item|None=None,**kwargs)
Bases:
object
Class representing amap orscene for the story
Note
Once you create a Map instance you must add it to the story to be able to edit it further.
Parameter
Description
item
An Item of type
Map
orScene
or a String representing the itemid to add to the story map.- propertyalt_text
Get/Set the alternate text property for the map.
Parameter
Description
alt_text
String. The new alt_text for the Map.
- Returns:
The alternate text that is being used.
- propertycaption
Get/Set the caption property for the map.
Parameter
Description
caption
String. The new caption for the Map.
- Returns:
The caption that is being used.
- propertydisplay
Get/Set the display type of the map.
Values:standard |wide |full |float right |float left
- propertylegend_pinned
Get/Set the legend pinned toggle. True if enabled and False if disabled.
Note
If set to True, make sureshow_legend is also True. Otherwise, you will notsee the legend pinned.
- propertymap
Get/Set the map property.
Parameter
Description
map
One of three choices:
String being an item id for an Item of type
An
Item
of type
Note
Only replace a Map with a new map of same type. Cannot replace a2D map with 3D.
- Returns:
The item id for the map that is being used.
- propertyoffline_media
Get/Set the offline media. This is an alternative version of this mediafor offline viewing using the ArcGIS StoryMaps Briefings app.
Note
This property is only available for ArcGIS StoryMaps Briefings andthe map must be part of the Briefing before setting this property.
Parameter
Description
offline_media
The new offline media for the Map or Scene.This can either be the item ofa Mobile Map Package or Mobile Scene Package or itcan be an item of type Image or Video from Story Contents.
- propertypinned_popup
Get/Set the pinned popup. You must know the layer id and the featureId name and value that representsthe popup you want to pin. You can find the layer id by looking at themap_layers property.
This is considered a more advance workflow as you must know the layer data to pin the popup.
Parameter
Description
pinned_popup_info
The new pinned popup info for the Map. This is adictionary containing the following keys:-layerId: String. The layer id of the feature layer. You can find this value in themap_layers property.-idFieldName: String. The field name that represents the id of the feature.-idFieldValue: Integer. The id of the feature you want to show.
- Example:
- {“layerId”: “0”,“idFieldName”: “OBJECTID”,“idFieldValue”: 1}
If you want to remove the pinned popup, set this to None.
- propertyproperties
Get properties for the Map.
- Returns:
A dictionary depicting the node dictionary and resourcedictionary for the map. The resource dictionary depicts theoriginal map settings. The node dictionary depicts the current map settings.If nothing it returned, make sure the content is part of the story.
Note
To change various properties of the Map use the other property setters.
- set_viewpoint(extent:dict=None,scale:Scales=None)
Set the extent and/or scale for the map in the story.
If you have an extent to use from a bookmark,find this extent by using thebookmarks property inthe
Map
Class.Themap property on this class will return the Web MapItem being used. By passing this item intotheMap
Class you can retrieve a list of allbookmarks and their extents with thebookmarks property.To see the current viewpoint call theproperties property on the Mapnode.
Parameter
Description
extent
Optional dictionary representing the extent ofthe map. This will update the extent, center and viewpointaccordingly.
- Example:
- {‘spatialReference’: {‘latestWkid’: 3857, ‘wkid’: 102100},‘xmin’: -609354.6306080809,‘ymin’: 2885721.2797636474,‘xmax’: 6068184.160383142,‘ymax’: 6642754.094035632}
scale
Optional Scales enum class value or dict with ‘scale’ and ‘zoom’ keys.
Scale is a unit-less way of describing how any distance on the map translatesto a real-world distance. For example, a map at a 1:24,000 scale communicates that 1 uniton the screen represents 24,000 of the same unit in the real world.So one inch on the screen represents 24,000 inches in the real world.
- Returns:
The current viewpoint dictionary
Text
- classarcgis.apps.storymap.story_content.Text(text:str|None=None,style:TextStyles=TextStyles.PARAGRAPH,color:str=None,size:str=None,**kwargs)
Bases:
object
Class representing atext and a style of text.
Note
Once you create a Text instance you must add it to the story to be able to edit it further.
Properties of the different text types:
Type
Text
paragraph
String can contain the following tags for text formatting:<strong>, <em>, <a href=”{link}” rel=”noopener noreferer” target=”_blank”and a class attribute to indicate color formatting:class=sm-text-color-{values} attribute in the <strong> | <em> | <a> | <span> tags
Values:themeColor1 |themeColor2 |themeColor3 |customTextColors
heading
String can only contain <em> tag
subheading
String can only contain <em> tag
bullet-list
String can contain the following tags for text formatting:<strong>, <em>, <a href=”{link}” rel=”noopener noreferer” target=”_blank”and a class attribute to indicate color formatting:class=sm-text-color-{values} attribute in the <strong> | <em> | <a> | <span> tags
Values:themeColor1 |themeColor2 |themeColor3 |customTextColors
numbered-list
String can contain the following tags for text formatting:<strong>, <em>, <a href=”{link}” rel=”noopener noreferer” target=”_blank”and a class attribute to indicate color formatting:class=sm-text-color-{values} attribute in the <strong> | <em> | <a> | <span> tags
Values:themeColor1 |themeColor2 |themeColor3 |customTextColors
quote
String can only contain <strong> and <em> tags
- add_attachment(content:Item|Image|Video,text:str=None)→bool
Add a text action to your text. You can specify the data of the action.This can only be used within a Briefing
Parameter
Description
content
Required content that can be added as an attachment.Content can be:* An Item object of type: Web Map, Image, StoryMap, Collection, Dashboard,Web Experience, or other arcgis Apps.* A story content of type Image or Video
text
Optional String. The part of the text that the attachment will be linked to. The textmust already exist in the text node.
For example, if the entire text is “Look at this dog.” and you want to link the word “dog”to the attachment, then the text parameter would be “dog”.
- Returns:
True if successful.
- propertyproperties
Get the properties for the text.
- Returns:
The Text dictionary for the node.If nothing is returned, make sure the content is part of the story.
- remove_attachment(text:str=None)
Remove an attachment from the text. If text_to_remove is None, remove all attachments.This can only be used within a Briefing.
Parameter
Description
text
Optional String. The part of the text that the attachment will be removed from.The text must already exist in the text class. If text is None, then allattachments will be removed.
- Returns:
True if successful.
- propertysize
Get/Set the size for the text node.
Parameter
Description
size
Optional String. The new size to be displayed.Applicable for Paragraph, Bullet List, and Numbered List.
Values:small |medium |large
Note
“small” can only be used in a Briefing.
- Returns:
The size for the node.If nothing is returned, make sure the content is part of the story.
Button
- classarcgis.apps.storymap.story_content.Button(link:str|None=None,text:str|None=None,**kwargs)
Bases:
object
Class representing abutton.
Note
Once you create a Button instance you must add it to the story to be able to edit it further.
Parameter
Description
link
Required String. When user clicks on button, they will be brought tothe link.
text
Required String. The text that shows on the button.
- propertylink
Get/Set the link for the button.
Parameter
Description
link
Optional String. The new path for the button.
- Returns:
The link being used.If nothing is returned, make sure the content is part of the story.
Gallery
- classarcgis.apps.storymap.story_content.Gallery(**kwargs)
Bases:
object
Class representing animage gallery
To begin with a new gallery, simply call the class. Once added to the story,you can add up to 12 images.
Note
Once you create a Gallery instance you must add it to the story to be able to edit it further.
# Images to add to the gallery.>>>image1=Image(<urlorpath>)>>>image2=Image(<urlorpath>)>>>image3=Image(<urlorpath>)# Create a gallery and add to story before adding images to it.>>>gallery=Gallery()>>>my_story.add(gallery)>>>gallery.add_images([image1,image2,image3])
- add_images(images:list[Image])
Parameter
Description
images
Required list of images of type Image.
- propertyalt_text
Get/Set the alternate text property for the swipe.
Parameter
Description
alt_text
String. The new alt_text for the Gallery.
- Returns:
The alternate text that is being used.
- propertycaption
Get/Set the caption property for the swipe.
Parameter
Description
caption
String. The new caption for the Gallery.
- Returns:
The caption that is being used.
- delete_image(image:str|Image)
The delete_image method is used to delete one image from the gallery. To see a list of imagesused in the gallery, use the
images()
property.Parameter
Description
image
Required String. The node id for the image to be removed from the gallery or the Image instance.
- Returns:
The current list of images in the gallery.
- propertyimages
Get/Set list of image nodes in the image gallery. Setting the lists allows the imagesto be reordered.
Parameter
Description
images
List of node ids for the images in the gallery. Nodes must already bein the gallery and this list will adjust the order of the images.
- To add new images to the gallery use:
Gallery.add_images(images)
- To delete an image from a gallery use:
Gallery.delete_image(node_id)
- Returns:
A list of node ids in order of image appearance in the gallery.If nothing is returned, make sure the gallery is part of the story.
Swipe
- classarcgis.apps.storymap.story_content.Swipe(content:list[Map|Image]|None=None,**kwargs)
Bases:
object
Create a Swipe node.
Note
Once you create a Swipe instance you must add it to the story to be able to edit it further.
Parameter
Description
node_id
Required String. The node id for the swipe type.
story
Required
StoryMap
that the swipe belongs to.>>>my_story.nodes#use to find swipe node id# Method 1: Use the Swipe Class>>>swipe=Swipe()# Method 2: Use the get method in story>>>swipe=my_story.get(node=<node_id>)
- propertyalt_text
Get/Set the alternate text property for the swipe.
Parameter
Description
alt_text
String. The new alt_text for the Swipe.
- Returns:
The alternate text that is being used.
- propertycaption
Get/Set the caption property for the swipe.
Parameter
Description
caption
String. The new caption for the Swipe.
- Returns:
The caption that is being used.
- propertycontent:list[Image|Map]
Get the content that is in the swipe. There can be up to 2 items in a swipe.
The content will be returned as their class instance.
Parameter
Description
content
Optional list of Image or Map instances. The content that will bedisplayed in the swipe. There can be up to 2 items in a swipe. The itemsmust be of the same type (Image or Map). If you want to add content to onlyone side of the swipe, use None for the other side.
- Returns:
A list of class:~arcgis.apps.storymap.Image or class:~arcgis.apps.storymap.Map instances.
- edit(content:Image|Map|None=None,position:str='right')
Deprecated since version 2.4.0:Use the content property to get and set.
Deprecated since version 2.4.0:Use the content property to get and set.
Edit the media content of a Swipe item. To save your edits and see themin the StoryMap’s builder, make sure to save the story.
Use this method to add new content if your swipe is empty. You can specify the content to addand which side of the swipe it should be on.
Parameter
Description
content
Required story content of type:
Image
orMap
. Must be the same media typeon both panels.position
Optional String. Either “right” or “left”. Default is “right” so contentwill be added to right panel.
- Returns:
True if successful
Sidecar
- classarcgis.apps.storymap.story_content.Sidecar(style:str|None=None,**kwargs)
Bases:
object
Create an Sidecar immersive object.
A sidecar is composed of slides. Slides are composed of two sub structures: a narrative panel and a media panel.The media node can be a(n): Image, Video, Embed, Map, or Swipe.The narrative panel can contain multiple types of content including Image, Video, Embed, Button, Text, Map, and more.
Note
Once you create a Sidecar instance you must add it to the story to be able to edit it further.
Parameter
Description
style
Optional string that depicts the sidecar style.Values: ‘floating-panel’ | ‘docked-panel’ | ‘slideshow’
>>>my_story.nodes#use to find sidecar node id# Method 1: Use the Sidecar Class>>>sidecar=Sidecar("floating-panel")# create from scratch# Method 2: Use the get method in story>>>sidecar=my_story.content_list()[3]# sidecar is fourth item in story
- add_action(slide_number:int,text:str,viewpoint:dict|None=None,extent:dict|None=None,map_layers:list[dict]|None=None,media:Image|Video|Embed|None=None)
Add a map action button to a slide. You can specify the data of the action.
Parameter
Description
slide_number
Required Integer. The slide that the map action will be added to. First slide is 1.
text
Required String. The map action button text
viewpoint
Optional Dictionary. The viewpoint to be set. The minimum keys to include arean x and y center point in the target geometry.
Set the viewpoint, extent, and map layers if you want the action to be a map action.
- Example:
- viewpoint = {
“rotation”: 0,“scale”: 18055.954822,“targetGeometry”: {
- “spatialReference”: {
“latestWkid”: 3857,“wkid”: 102100
},“x”: -8723429.856341356,“y”: 4019095.847955684
}
}
extent
Optional Dictionary. The extent of the map that will be shown whenthe action button is used.
- Example:
- extent = {
- “spatialReference”: {
“latestWkid”: 3857,“wkid”: 102100
},“xmin”: -8839182.968379805,“ymin”: 3907027.5240857545,“xmax”: -8824335.075635428,“ymax”: 3915378.269425899
}
map_layers
Optional list of dictionaries. Each dictionary represents a map layerand the parameters set on the map layer.
- Example:
- map_layers = [
- {
“id”: “18511776c33-layer-2”,“title”: “USA Forest Type”,“visible”: true
}
]
media
Optional item that is a story content item of type Image, Video, or Embed.Set the media if you want the action to be a media action.
- Returns:
The node id for the action that was added to the slide
- add_slide(contents:list|None=None,media:Image|Video|Map|Embed|None=None,slide_number:int=None)
Add a slide to the sidecar. You are able to specify the position of the slide, thecontent of the narrative panel and the media of the slide.
Parameter
Description
contents
Optional list of story content item(s). The instances of story content thatwill be added to the narrative panel such as Text, Image, Embed, etc.
media
Optional item that is a story content item.Item type for the media node can be: Image, Video, Map, Embed, or Swipe.
slide_number
Optional Integer. The position at which the new slide will be.If none is provided then it will be added as the last slide.
First slide is 1.
# Get sidecar from story and see the propertiessc=story.get(<sidecar_node_id>)sc.properties>>returnsadictionarystructureofthesidecar# create the content we will add to narrative_panel_nodes parameterim=Image(<img_url_or_path>)txt=Text("Hello World")embed=Embed(<url>)narrative_nodes=[im,txt,embed]mmap=Map(<item_idwebmap>)# Add new slide with the content:sc.add_slide(narrative_nodes,mmap,4)>>Newslideaddedwiththecontentatposition4
- propertycontent_list
Get a list of all the content within the sidecar in order of appearance.The content will be displayed in the following order:A list of the content in slide 1, a list of the content in slide 2, etc.Each sub-list will contain content found in the narrative panel, if any, and the media content, if any.
- edit(content:Image|Video|Map|Embed,slide_number:int)
Edit method can be used to edit thetype of media in a slide of the Sidecar.This is done by specifying the slide number and the media content to be added.The media can only be of type: Image, Video, Map, or Embed.
Note
This method should not be used to edit the narrative panel of the Sidecar. To better edit boththe media and the narrative panel, it is recommended to use the
get()
methodin the Sidecar class. Theget method can be used to change media if the content is of the sametype as what is currently present and preserve the node_id.Parameter
Description
content
Required item that is a story content item.Item type for the media node can be:
Image
,Video
,Map
Embed
,Swipe
slide_number
Required Integer. The slide that will be edited. First slide is 1.
# Get sidecar from story and see the propertiessc=story.get(<sidecar_node_id>)sc.properties>>returnsadictionarystructureofthesidecar# If a slide 2 contains a map and you want to change it to an imageim=Image(<img_url_or_path>)sc.edit(im,2)sc.properties>>noticeslide2nowhasanimage# If I want to update the image then 2 methods:# OPTION 1im2=Image(<img_url_or_path>)sc.edit(im2,2)# OPTION 2 (only applicable if content is of same type as existing)im2=sc.get(im.node_id)im2.image=<img_url_or_path>
- get(node_id:str)
The get method is used to get the node that will be edited. Usesidecar.properties tofind all nodes associated with the sidecar.
Parameter
Description
node_id
Required String. The node id for the content that will be returned.
- Returns:
An class instance of the node type.
# Find the nodes associated with the sidecarsc=story.get(<sidecar_node_id>)sc.properties>>returnsadictionarystructureofthesidecar# Get a node associated with the sidecar, in this example an image, and change the imageim=sc.get(<node_id>)im.image=<new_image_path># Save the story to see changes applied in Story Map builderstory.save()
Timeline
- classarcgis.apps.storymap.story_content.Timeline(style:str|None=None,**kwargs)
Bases:
object
Create a Timeline object from a pre-existingtimeline node.
A timeline is composed of events.Events are composed of maximum three nodes: an image, a sub-heading text, and a paragraph text.
Note
Once you create a Timeline instance you must add it to the story to be able to edit it further.
Parameter
Description
style
Required string, the style type of the timeline. If the timeline will beadded to a Sidecar, then onlywaterfall andsingle-sided are allowed.
Values: ‘waterfall’ | ‘single-side’ | ‘condensed’
>>>my_story.nodes#use to find timeline node id# Method 1: Use the Timeline Class>>>timeline=Timeline(my_story,<node_id>)# Method 2: Use the get method in story>>>timeline=my_story.get(node=<node_id>)
- add_event(contents:list[Image|Text]|None=None,position:int|None=None)→bool
Add event or spacer to the timeline.
Parameter
Description
contents
Optional item list that will be in the event. Need to be passed inby order of appearance.Item type can be
Image
orText
.Text can only be of style TextStyles.SUBHEADING or TextStyles.PARAGRAPH
Note
To create timeline spacer, do not pass in any value for this parameter.
position
Optional Integer. The position at which the even will be added. First event is 1.If None, then the event will be added to the end.
- edit(content:Image|Text,event:int)
Edit event text or image content. To add a new event use theadd_event method.
Parameter
Description
content
Required content to replace current content.Item type can be
Image
orText
.Text can only be of style TextStyles.SUBHEADING or TextStyles.PARAGRAPH
event
Required Integer. The event that will be edited. First event is 1.
- propertyproperties
List all events and their children
- Returns:
A list where the first item is the node id for the timeline. Nextitems are dictionary of events and their children.
MapTour
- classarcgis.apps.storymap.story_content.MapTour(**kwargs)
Bases:
object
Create a MapTour object from a pre-existingmaptour node.
Note
Once you create a MapTour instance you must add it to the story to be able to edit it further.
>>>my_story.nodes#use to find map tour node id# Method 1: Use the MapTour Class>>>maptour=MapTour(my_story,<node_id>)# Method 2: Use the get method in story>>>maptour=my_story.get(node=<node_id>)
- get(node_id:str)
The get method is used to get the node that will be edited. Usemaptour.properties tofind all nodes associated with the sidecar.
Parameter
Description
node_id
Required String. The node id for the content that will be returned.
- Returns:
An class instance of the node type.
# Find the nodes associated with the map tourmt=story.get(<maptour_node_id>)mt.places>>returnsplacesofthemaptour# Get a node associated with the map tour, in this example an image, and change the imageim=mt.get(<node_id>)im.image=<new_image_path># Save the story to see changes applied in Story Map builderstory.save()
Code
- classarcgis.apps.storymap.story_content.Code(content:str|None=None,language:Language|str|None=None,**kwargs)
Bases:
object
Class representing acode content card.Code will show as a block of code in your Storymap.
Note
Once you create a Code instance you must add it to the story to be able to edit it further.
Parameter
Description
content
Required String. The code content to have in the block.
language
Required Language or String. The coding language of the content provided.For values see Language Enum Class.
- propertycontent:str
Get/Set the content property.
Parameter
Description
content
String. The new content for the code block.
- Returns:
The content that is being used.
Briefing
- classarcgis.apps.storymap.briefing.Briefing(item:Item|str|None=None,gis:GIS|None=None)
Bases:
object
Synthesize critical information and maintain mission readiness with briefings, a new slide-based presentationstyle now available as a type of ArcGIS StoryMap. Make data-driven decisions and provide meaningful context toyour audience by infusing your presentations with real-time data and dynamic maps. Briefings also allow you tounify images, videos, and other multimedia in your presentation to create a cohesive experience for both youand your viewers.
Example use cases include on-the-ground disaster briefings, budget numbers presented in real-time, and dailyleadership briefings. After the briefings mobile app launches in September, you’ll be able to securely connectwith your stakeholders wherever they are with a tablet app that works on- and offline.
Create a StoryMap Briefing object to make edits to a story. Can be created from an item of type ‘StoryMap Briefing’,an item id for that type of item, or if nothing is passed, a new story is created from a generic draft.
If an Item or item_id is passed in, only published changes or new drafts are taken from the StoryMap Briefing.If you have a story with unpublished changes, they will not appear when you construct your story with the API.If you start to work on your Briefing that has unpublished changes and save from the Python API, yourunpublished changes on the GUI will be overwritten with your work from the API.
Parameter
Description
item
Optional String or Item. The string for an item id or an item of type‘StoryMap Briefing’. If no item is passed, a new story is created and saved toyour active portal.
gis
Optional instance of
GIS
. If none provided the active gis is used.- propertyactions
Get list of action nodes. These are nodes that trigger an action to occur, forexample when text is linked to an image, map, etc.
- add(layout:str,*,sublayout:str|None=None,title:str|None=None,subtitle:str|None=None,section_position:str|None=None,position:int|None=None)
Use this method to add content to your StoryMap. content can be of various class types and whenyou add this content you can specify a caption, alt_text, display style, and the positionat which it will be in your story.Not passing in any content means a separator will be added.
Parameter
Description
layout
Required SlideLayout or string, the layout type of the slide.
sublayout
Optional SlideSubLayout or string, the sublayout type of the slide.Only applicable when the layout is “double” or “titleless-double”.
title
Optional string or
Text
object, the title of the slide.Text can only be of type heading (h2).subtitle
Optional string or
Text
object, the subtitle of the slide.Text can only be of type paragraph.section_position
Optional string, the title panel position of the section slide. Onlyapplicable for “section-double”.Values: ‘start’ | ‘end’
position
Optional Integer. Indicates the position in which the slide will beadded. If no position is provided, the slide will be placed at the end.
- Returns:
The new slide that was added to the story
- copy_content(target_briefing:Briefing,content:list)
Copy the content from one briefing to another. This will copy the contentindicated to the target briefing in the order they are provided.
Note
Do not forget to save the target briefing once you are done copying and makingany further edits.
Note
This method can take time depending on the number of resources. Each resource comingfrom a file must be copied over and heavy files, such as videos or audio, can be timeconsuming.
Parameter
Description
target_briefing
Required Briefing instance. The target briefing that the content will becopied to.
content
Required list of content. The list of content that will be copied tothe target briefing.
- Returns:
True if all content has been successfully copied over.
- cover(title:str|None=None,type:str=None,summary:str|None=None,by_line:str|None=None,media:Image|Video|None=None)
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Cover class that can be accessed through the cover property in the cover slide.
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Cover class that can be accessed through the cover property in the cover slide.
A briefing’s cover is the first slide.This method allows the cover to be edited by updating the title, byline, media, and more.Changing one part of the briefing cover will not change the rest of the cover. If just themedia is passed in then only the media will change.
Parameter
Description
title
Optional string. The title of the Briefing cover.
type
Optional string. The type of briefing cover to be used in the story.
Values:"full"|"sidebyside"|"minimal"
summary
Optional string. The description of the story.
by_line
Optional string. Crediting the author(s).
media
- Returns:
True if the cover was updated successfully.
briefing=Briefing(<briefingitem>)briefing.cover(title="My Briefing Title",type="sidebyside",summary="My little summary",by_line="python_dev")briefing.save()
- duplicate(title:str|None=None)
Duplicate the story. All items will be duplicated as they are. This allows you to createa briefing template and duplicate it when you want to work with it.
It is highly recommended that once the duplicate is created, open it in StoryMap Briefingbuilder to ensure the issue checker finds any issues before editing.
Note
Can be used with ArcGIS Online or with ArcGIS Enterprise starting 10.8.1.
Note
To duplicate into another organization, use the
clone_items()
method.Parameter
Description
title
Optional string. The title of the duplicated story. Only availablefor ArcGIS Online.
- Returns:
The Item that was created.
# Example for ArcGIS Online>>>briefing=Briefing(<briefingitem>)>>>briefing.duplicate("A Briefing Copy")
- get_theme()→str
Get the theme name or the theme item that is used in the briefing.
return: The theme name or the theme item item_id.
- move(slide:int,position:int|None=None,delete_current:bool=False)
Move a slide to another position. The slide currently at that position willbe moved down one space. The slide at the current position can be deletedinstead of moved ifdelete_current is set to True.
Parameter
Description
slide
Required integer. The slide number to move. The cover is slide 0 and thiscannot be moved.
position
Optional Integer. Indicates the position in which the slide will beadded. If no position is provided, the slide will be placed at the end.
delete_current
Optional Boolean. If set to True, the slide at the current position willbe deleted instead of moved down one space. Default is False.
- Returns:
True if the slide was moved successfully.
- save(title:str|None=None,tags:list|None=None,access:str=None,publish:bool=False,make_copyable:bool=None,no_seo:bool=None)
This method will save your Story Map to your active GIS. The story will be savedwith unpublished changes unlesspublish parameter is specified to True.
The title only needs to be specified if a change is wanted, otherwise existing titleis used.
Warning
Publishing your story through the Python API means it will not go through the Story Mapissue checker. It is recommended to publish through the Story Maps builder if youwant your story to go through the issue checker.
Warning
Changes to the published story may not be visible for up to one hour. You can openthe story in the story builder to force changes to appear immediately and performother optimizations, such as updating the story’s social/SEO metadata.
Parameter
Description
title
Optional string. The title of the StoryMap.
tags
Optional string. The tags of the StoryMap.
access
Optional string. The access of the StoryMap. If none is specified, thecurrent access is kept. This is used whenpublish parameter is setto True.
Values:private |org |public
publish
Optional boolean. If True, the story is saved and also published.Default is false so story is saved with unpublished changes.
make_copyable
Optional boolean. If True, the story is saved as copyable for users.
no_seo
Optional boolean. If True, the story is saved without SEO metadata.
- Returns:
The Item that was saved to your active GIS.
- set_logo(image:str|None=None,link:str|None=None,alt_text:str|None=None)
Set the logo for the briefing. The logo is seen in the header of the story.
Note
To remove the logo, link, or alt text, pass in an empty string. If they are None, nothingwill be changed for that parameter. For example if you only want to update the link but leavethe image and alt text as is, pass in None for the image and alt text. Pass in the new linkfor the link parameter.
Parameter
Description
image
Required string. The file path to the image to be used as thelogo.
link
Optional string. The url to link to when the logo is clicked.
alt_text
Optional string. The alt text to be used for screen readers.
- Returns:
True if successful.
story=Briefing("<story item>")story.set_logo("<image-path>.jpg/jpeg/png/gif")
- show(width:int|None=None,height:int|None=None)
Show a preview of the briefing. The default is a width of 700 and height of 300.
Parameter
Description
width
Optional integer. The desired width to show the preview.
height
Optional integer. The desired height to show the preview.
- Returns:
An Iframe display of the briefing if possible, else the item url is returned to beclicked on.
- propertyslides
Get a list of all the content instances in order of appearance in the story.This returns a list of class instances for the content in the story.
- theme(theme:Themes|str=Themes.SUMMIT)
Each briefing has a theme node in its resources. This method can be used to change the theme.To add a custom theme to your story, pass in the item_id for the item of type Story Map Theme.
Parameter
Description
theme
Required Themes Style or custom theme item id.The theme to set on the briefing.
Values:SUMMIT |TIDAL |MESA |RIDGELINE |SLATE |OBSIDIAN |<item_id>
>>>fromarcgis.apps.storymapimportThemes,Briefing>>>briefing=Briefing()>>>briefing.theme(Themes.TIDAL)
Block
- classarcgis.apps.storymap.story_content.Block(block_index,slide:BriefingSlide,story)
Bases:
object
Represents a block in a briefing slide.
Note
Blocks are automatically created when you create a new slide. You can access the blocksthrough theblocks property of the slide. Do not create this class directly.
- add_content(content:Text|Image|Video|Embed|Map|Swipe|Gallery|Code|Table)→bool
Add content to the block.
Parameter
Description
content
Required content object to be added to the block. The contentobject can be of type Text, Image, Video, Embed, Map, or Swipe. Therecan be more than one Text contents in the same block but only one of theother types of content.Setting an Image, Video, Embed, Map, or Swipe content will overwrite thecurrent content. Setting a Text content will add the text to the block.
- Returns:
The Content object that was added to the block.
Table
- classarcgis.apps.storymap.story_content.Table(rows:int|None=None,columns:int|None=None,**kwargs)
Bases:
object
Class representing atable block.Table will show as a gridded table in your Storymap.
Note
Once you create a Table instance you must add it to the story to be able to edit it further.
Parameter
Description
rows
Optional int. The number of rows in the table. Table supports a maximumof 10 rows. Minimum of 2 rows supported.
columns
Optional int. The number of columns in the table. Table supports amaximum of 8 columns. Minimum of 1 column supported.
- propertycontent
Get the content of the table as a panda’s DataFrame.Each cell content is held within a dictionary where the‘value’ key is the text of the cell. The other key that can be included inthe dictionary is the ‘textAlignment’ key.
Parameter
Description
content
Required pandas DataFrame. The content of the table as a pandasDataFrame. The index of the DataFrame will be the row headers andthe columns of the DataFrame will be the column headers.
ExpressMap
- classarcgis.apps.storymap.story_content.ExpressMap(**kwargs)
Bases:
object
Class representing an ExpressMap.
Note
You can only create an ExpressMap from a pre-existingexpressmap in a story or briefing. You cannot createan ExpressMap from scratch.
Collection
- classarcgis.apps.storymap.collection.Collection(item:Item|str|None=None,gis:GIS|None=None)
Bases:
object
Parameter
Description
item
Optional String or Item. The string for an item id or an item of type‘StoryMap Collection’. If no item is passed, a new story is created and saved toyour active portal.
gis
Optional instance of
GIS
. If none provided the active gis is used.- add(item:content.Image|content.Video|content.Embed|_gis.Item|str,title:str|None=None,thumbnail:str|None=None,position:int|None=None)
Add an item to the collection. Specify this item with the item object.The item can be a portal item, file resource, or a story content of typeImage, Video, or Embed.
Parameter
Description
item
Required object. Either an Image, Video, or Embed content type object.
title
Optional string. The title of the item to add under the thumbnail in the collection.
thumbnail
Optional string. The image file path to use as the thumbnail for the item.
position
Optional integer. The position in the collection to add the item.If none is specified, the item is added to the end of the collection.
- cover(title:str|None=None,type:str=None,summary:str|None=None,by_line:str|None=None)
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Cover class that is accessed in the cover property.
Deprecated since version 2.4.0:Removed in: 2.4.2. Use thearcgis.apps.storymap.Cover class that is accessed in the cover property.
A collection’s cover is the first slide.This method allows the cover to be edited by updating the title, byline, media, and more.Changing one part of the collection cover will not change the rest of the cover. If just themedia is passed in then only the media will change.
Parameter
Description
title
Optional string. The title of the Collection cover.
type
Optional string. The type of collection cover to be used in the story.
Values:"full"|"sidebyside"|"minimal"
summary
Optional string. The description of the story.
by_line
Optional string. Crediting the author(s).
- Returns:
True if the cover was updated successfully.
collection=Collection(<collectionitem>)collection.cover(title="My Collection Title",type="sidebyside",summary="My little summary",by_line="python_dev")collection.save()
- get_theme()→str
Get the theme name or the theme item that is used in the collection.
return: The theme name or the theme item item_id.
- remove(index)
Remove an item from the collection. Specify this item with the index positionof the item in the collection. The list of items in the collection can be foundby using thecontent property. The index position is the position of the itemin the list.
Parameter
Description
index
Required integer. The index position of the item to remove.
- Returns:
True if the item was removed successfully.
- save(title:str|None=None,tags:list|None=None,access:str=None,publish:bool=False,make_copyable:bool=None,no_seo:bool=None)
This method will save your Story Map to your active GIS. The story will be savedwith unpublished changes unlesspublish parameter is specified to True.
The title only needs to be specified if a change is wanted, otherwise exisiting titleis used.
Warning
Publishing your story through the Python API means it will not go through the Story Mapissue checker. It is recommended to publish through the Story Maps builder if youwant your story to go through the issue checker.
Warning
Changes to the published story may not be visible for up to one hour. You can openthe story in the story builder to force changes to appear immediately and performother optimizations, such as updating the story’s social/SEO metadata.
Parameter
Description
title
Optional string. The title of the StoryMap.
tags
Optional string. The tags of the StoryMap.
access
Optional string. The access of the StoryMap. If none is specified, thecurrent access is kept. This is used whenpublish parameter is setto True.
Values:private |org |public
publish
Optional boolean. If True, the story is saved and also published.Default is false so story is saved with unpublished changes.
make_copyable
Optional boolean. If True, the story is saved as copyable for users.
no_seo
Optional boolean. If True, the story is saved without SEO metadata.
- Returns:
The Item that was saved to your active GIS.
- show(width:int|None=None,height:int|None=None)
Show a preview of the collection. The default is a width of 700 and height of 300.
Parameter
Description
width
Optional integer. The desired width to show the preview.
height
Optional integer. The desired height to show the preview.
- Returns:
An Iframe display of the collection if possible, else the item url is returned to beclicked on.
- theme(theme:Themes|str=Themes.SUMMIT)
Each collection has a theme node in its resources. This method can be used to change the theme.To add a custom theme to your story, pass in the item_id for the item of type Story Map Theme.
Parameter
Description
theme
Required Themes Style or custom theme item id.The theme to set on the collection.
Values:SUMMIT |TIDAL |MESA |RIDGELINE |SLATE |OBSIDIAN |<item_id>
>>>fromarcgis.apps.storymapimportThemes,Collection>>>collection=Collection()>>>collection.theme(Themes.TIDAL)
Navigation
Cover
- classarcgis.apps.storymap.story_content.Cover(**kwargs)
Bases:
object
Represents the cover slide of a Briefing or the cover of a Storymap.
- propertybyline:str|None
Get/Set the byline of the cover slide.
Parameter
Description
byline
Text instance or string depicting the byline of the cover slide.
- propertydate:str
Get/Set the date of the cover slide.
Parameter
Description
date
Optional string. How the date should be shown on the cover.
Values:"first-published"|"last-published"|"current-date"|"none"
- propertyhorizontal_position:str
Get/Set the horizontal position of the cover panel.
Parameter
Description
horizontal_position
Optional string or instance of HorizontalPosition Enum. The horizontal position of the cover slide.This is available when the cover type is “minimal”, “top”, or “full”.
Values:"start"|"center"|"end"
- propertymedia:str|None
Get/Set the media of the cover slide.
Parameter
Description
media
The media of the cover slide. This can be an instance ofImage or Video.
- propertysize:str
Get/Set the size of the cover panel.
Parameter
Description
size
Optional string. The size of the cover slide.This is available when the type is ‘full’, “card”, or “sidebyside”.
Values:"small"|"medium"|"large"
- propertystyle:str
Get/Set the style of the cover panel.
Parameter
Description
style
Optional string or instance of CoverStyle Enum. The style of the cover slide.This is available when the type is ‘full’.
Values:"gradient"|"themed"|"transparent-with-light-color"|"transparent-with-dark-color"
- propertysummary:str|None
Get/Set the summary of the cover slide.
Parameter
Description
summary
Text instance or string depicting the summary of the cover slide.
- propertytitle:str|None
Get/Set the title of the cover slide.
Parameter
Description
title
Text instance or string depicting the title of the cover slide.
- propertytype:str
Get the type of the cover.
Parameter
Description
type
Optional string or CoverType enum. The type of story cover to be used in the story.
ValuesforStorymapandBriefing:"full"|"sidebyside"|"minimal"|"card"|"split"|"top"
ValuesforCollection:"grid"|"magazine"|"journal"
Note
As of Enterprise 11.4 only “full”, “sidebyside”, and “minimal” are supported for Storymap and Briefing.
- Returns:
A string of the cover type.
CollectionNavigation
Separator
- classarcgis.apps.storymap.story_content.Separator(**kwargs)
Bases:
object
Add a subtle break in between different sections of your story. The exact look of the separator will vary based on the theme you have chosen.
Class representing aseparator. You can use this class to edit and remove separators from a storymap.This refers to the main separator content type that can be added to a story. For timeline separators usethe Timeline class.
BriefingSlide
- classarcgis.apps.storymap.BriefingSlide(**kwargs)
Bases:
object
Represents a Slide for a Briefing.
Note
To create a new slide use theadd method in the Briefing class.
- propertyblocks:list[Block]
Get blocks of the Slide. Blocks hold content of various types such asText, Image, Map, Swipe, etc. If you want to edit the content you can accesstheadd_content,delete_content method of the block.
- Returns:
A list of blocks in the slide
- propertyhidden:bool
Get/Set the visibility of the slide.
Parameter
Description
hide
Bool. Set to True if you want the slide to be hidden, False otherwise.
- propertylayout:str
Get the layout of the slide.
Note
Once a slide is created, the layout cannot be changed.
- Returns:
A string of the layout type.
- propertysection_position:str
Get/Set the title panel position for a section-double layout slide.
Values: ‘start’ or ‘end’
- propertysublayout:str
Get/Set the sublayout when the layout is “double”. This determinesthe proportion of the slide that the content takes up.
Parameter
Description
sublayout
SlideSubLayout value or String depicting the sublayout type of the slide.Only applicable when the layout is “double” or “titleless-double”.
Enumerations
Language
Scales
- classarcgis.apps.storymap.story_content.Scales(value,names=None,*,module=None,qualname=None,type=None,start=1,boundary=None)
Bases:
Enum
Scale is a unit-less way of describing how any distance on the map translatesto a real-world distance. For example, a map at a 1:24,000 scale communicates that 1 uniton the screen represents 24,000 of the same unit in the real world.So one inch on the screen represents 24,000 inches in the real world.
This can be used for methods involving viewpoint in the Map Content.
TextStyles
SlideLayout
SlideSubLayout
Language
CoverType
- classarcgis.apps.storymap.story_content.CoverType(value,names=None,*,module=None,qualname=None,type=None,start=1,boundary=None)
Bases:
Enum
The different cover types for the StoryMap, briefings, and collections.
Storymap and Briefing can be: FULL | SIDEBYSIDE | MINIMALCollection can be: GRID | MAGAZINE | JOURNAL