Comments (7)
@knoopum Great suggestion I will work on putting this in. For now the workaround about looking at the node is the best way but we can add a property or make it so the method returns a theme if no parameters are given :)
from arcgis-python-api.
I'll note a complication I ran into is that StoryMap Collections, which can also reference Themes, are not currently accessible via the API. Passing an item ID for a StoryMap Collection to arcgis.apps.storymap.StoryMap() results in a 404.
For Collections, it looks like I will have to harvest the Theme info from the item's JSON for now?
from arcgis-python-api.
@knoopum Good news for collections! Support will be added at 2.3.0 (coming out next week) so you will be able to access them soon. However the theme property you are suggesting was not added so it will be in Storymap, Collections, and Briefings for 2.3.1
I would refer to the json for now. I will make a custom method and can post it here soon as well to facilitate this.
from arcgis-python-api.
@nanaeaubry that is great! I'll scrape the JSON in the meantime, and look forward to the updates
from arcgis-python-api.
Here is a quick method that can be used to get the theme
def get_theme(story):
"""
Get the theme of the story, briefing, or collection.
"""
for node, node_info in story._properties["resources"].items():
for key, val in node_info.items():
if key == "type" and val == "story-theme":
return story._properties["resources"][node]["data"]["themeId"]
This will either return the name or the itemid of the theme used
from arcgis-python-api.
@nanaeaubry Thank you! that confirms the logic I ended up using
from arcgis-python-api.
Related Issues (20)
- Table query fails with "TypeError: Casting to unit-less dtype 'datetime64' is not supported. Pass e.g. 'datetime64[ns]' instead." HOT 6
- clone_items() with item_mapping parameter misses group layers in the web map HOT 1
- Item.share() is not working when the groups parameter is specified HOT 1
- generate_raster fails in local and ArcGIS Online notebooks HOT 3
- Installing into Azure Databricks. Could you document recommended arcgis & databricks runtime versions and prerequisites?
- GeoAccessor.from_table results in empty array HOT 3
- AttributeError: module 'numpy' has no attribute 'float' HOT 1
- Property resouces of Server class is misspelled. HOT 1
- AttributeError: 'Server' object has no attribute 'services' HOT 1
- Empty SHAPE HOT 4
- Efficient way to identify ArcGIS Online Named User Pro licenses that have been taken offline HOT 1
- Why is the Folders class not named FolderManager? HOT 3
- workforce.Project.assignment.add() - TypeError: Object of type FeatureSet is not JSON serializable (Did not exist in previous version)
- Upload a photo returns 'Item type not valid.' HOT 2
- `sources` endpoint for hosted views is not exposed
- GeoAccessor.to_featureclass function converting all column names to lowercase when sanitize_columns parameter is True HOT 1
- Publish function for shapefile items create duplicate indexes for area and length HOT 10
- In clone_items, a valid name is not always created if the name of the original item is missing (None) HOT 1
- FeatureLayerCollectionManager insert_layer() fails with unknown error HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arcgis-python-api.