-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArcGIS API for Python StoryMaps v 2.3.0 Issues on StoryMap Publishing ("get" & "node" deprecation and content_list alternative) #1825
Comments
@nvshamblin Thanks for bringing this up! I will take a look and get back to you soon with some workaround if possible and see if this is an unintended bug! :) |
Thank you, Nanae! Through some experimenting, I've discovered that this error is resulting after I've updated my ArcGIS Pro to the latest 3.3.0 version. My colleagues still working in the earlier version (3.2.2) have not reported this issue, so just wanted to provide that additional info. Thanks for your help! |
@nvshamblin So for example you are using In the Sidecar class you will find a similar property called What we see is that my sidecar has 4 slides. Each sub-list is one slide. This means less guessing on what the nodes are to get your content. You can iterate through the list to find what you need. If I wanted to get all the maps in my Sidecar I can create a nested loop:
Since I only have one webmap present. You can then use this list of webmaps to loop through and change the viewpoint as you are doing above but without the
|
@nvshamblin As far as the save error goes I do not see it and it is probably specific to the storymap content you have and a bug on our end. Is this occurring if you just read the story item into the Storymap class and save without making any changes? |
Thank you so much @nanaeaubry! I really appreciate your thorough and prompt response. The I hadn't even thought to test out the "save" after simply reading the story item into the StoryMap class, but as you suggested, it did error out, so it must be something within the storymap content of my StoryMap. Based on this, I think I have narrowed the cause of the UnicodeEncodeError to something in the text of the sidecar slide descriptions. Do you think, if I can iterate a replacement of the unicode code, ie. Replace ('\u202f', '') in all of the sidecar 'text' instances, that this might solve the issue? If so, could you help in suggesting how to going about that process? Here's my initial thought process based on your advice above:
Thanks again for your help; your patience and support are much appreciated! :) |
@nvshamblin The code looks good! You're right that is probably the issue. There are some known complications with saving unicode text since we have to pass everything to json and back. I would try that and see if it works! Good luck! |
@nanaeaubry Sorry to keep this thread going, but I have somewhat solved the initial issue only to expose a new error! :( I attempted the However, it is okay because I was able to scrub my StoryMap for the unicode '\u202f' symbol using the Next, I updated my However, strangely enough, after running the script and opening the StoryMap to publish the edits, it exposed some weird symbols (see below). So then I simply cleaned up the symbols hoping to have a clean StoryMap to work off of. Then, for safe measure, I ran the same code as I had before on the same published StoryMap, just wanting to ensure that no other errors would arise, and I got a new error! :(
Any idea on what could be the issue here? Thanks so much for all your help! |
@nvshamblin For that first error that is my bad I missed something in your code.
The So the correct code is:
You can make it all one line but this way you see the workflow a bit better. Sorry about that oversight! For the next part of the issue that is odd. That property only applies if your map is a webscene and not a webmap... If you are in fact using a webscene then it seems that it is missing a resource when it got added to the Storymap. This could be for a few reasons... One suggestion is to find the webscene and re-add it. Replacing the one you have now and seeing if that works. You can get the current map item by getting that instance where it is failing and using the So something like this:
Let me know if that works! Also odd that you get the weird symbols... some pseudo-ish code:
If there are too many text just get the first two or three so I can test. I think it has to do with JSON encoding going wrong and I can ask the storymap team as well for some insight on how to accomplish what you want with the text. FYI: I am in a different time zone incase I don't reply until next week ;) |
@nvshamblin You can also make a smaller storymap that has just one or two maps and some text in a sidecar and share that publicly with me so I can test directly on it if that is easier. |
Hi @nanaeaubry, thank you so much for your code to replace the unicode text in the sidecar text, it worked flawlessly! After scouring through the sidecar properties, I found these symbols to be the "problem children":
So, using your code, I replaced these as needed. Even after that, I was still having an error come up :( . So, after further review I realized there was one of these symbols ("—") in the titles of one of the map layers in an underlying StoryMap map that was causing the issue! So, I renamed the layer and re-added the map to StoryMap and that did the trick! What's so strange is that I've been using the same StoryMap template for over a year now and have never had this issue. Goes to show, maybe I should've updated it a while ago ;) As for the web scene error, you were totally right about that. It was a web scene that was causing the "lightingDate" key error. I replaced the web scene per your suggestion, but that unfortunately didn't do the trick. So, I simply performed the "set_viewpoint" code on all maps less the web scene and that seems to work just fine! Do you know if the set_viewpoint works on web scenes (and/or swipes)? Up to now, I've been operating under the assumption that you can't set the viewpoints on those types of StoryMap items, which might explain why I was getting an error, but if this is not the case, I'm not sure... Thanks so much again for your help, you're a rockstar! |
@nvshamblin |
Describe the bug
After the release of 2.3.0, code that was previously functioning for StoryMap updating is now causing an error that I'm unable to troubleshoot. From the release documentation, it seems that both get and node functions are deprecated, however I've been able to run my script without error up until the step to publish the StoryMap.
To Reproduce
Steps to reproduce the behavior:
Below is a reduced version of the script. Its steps include setting the extent of each of the sidecar webmaps to a determined extent based on a shapefile input. The "webmap_list" contains a list of the webmap nodes.
error:
When I silence the "my_story.save()" code, no errors are returned. Otherwise, the following error occurs:
Expected behavior
The sidecar webmaps should all be set to the established extent based on a shapefile input.
Platform (please complete the following information):
I'm fairly green with coding and any help here is appreciated. Any help on using the new content_list property (recommended as an alternative to the deprecated get and node functions) for the StoryMaps API would be greatly appreciated. Thanks for your help!
The text was updated successfully, but these errors were encountered: