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
Map point section links #23
Comments
The idea is that ArcGIS Online does not allow you to insert the link that Map Journal require but if you are able to create your data outside of ArcGIS Online like for example in a CSV and insert to the webmap, those links will work. One way to do it is to have one attribute of the layer that contains those links and then to configure the popup to use that attribute. Please see this thread for more https://geonet.esri.com/thread/118904 |
I read through the forum post and it provided some good insight. Is there a sample CSV in creating those links? Can you create links on the actual marker and not within the popup for the marker (like in the Bee Story). |
Great. Yes you can access the CSV here (a bit buried in the post) https://gist.githubusercontent.com/glazou/72900f70e6192bdb9dac/raw/5eae0bee65e197a055c4f7484bf27c4332324520/MapJournal-popup-section-nav.csv Make the navigation by clicking the markers require to customize Map Journal. |
I was able to successfully use the sample CSV to create the link from within the popup. I assume to be able to recreate the map point behavior links from the Bee Story, it would take a bit more customization to the app itself? |
Great. |
An updated procedure to do this is documented here https://github.com/Esri/map-journal-storytelling-template-js#link-between-sections |
I'm a complete newbie with this app: trying also to implement the ability to navigate from the map back to a story section. I created an attribute in my webmap feature that has the code as shown in your sample CSV file as above. In the storymap popup, it shows as a hyperlinked phrase, but clicking on it does not advance to the section. I think after Mar 2015, this functionality was replaced by adding code to the index.html file of the sourcecode? However, I'm having trouble deciphering where to get my layer ID to add the click handler on the map feature. I have the webmap_ID. Your help explains: Can you explain where the 'console' is? Is this something i get from ArcGISOnline, or the java console? |
I will try to help you but as you notice this unfortunately require developer skills as the procedure with CSV is not supported anymore :/ The steps are:
Good luck, let us know how it goes :) |
Thank you! So, I do already have my Application ID and my webmap ID, and I have cut/paste the entire bit of code into the index.html file, inserting those two pieces. Still cannot seem to find the layer_id’s though, even when looking at the console achieved by pressing F12 while looking at the home section of my storymap. Perhaps if you look at the app it would help? Below is the webmap_id of my webmap which I have included in the index.html file . But in the console I cannot find anything that looks like layer_ids? I commented out the layer_id line for now since I didn’t know what to put in there…
I’m not sure if this will be useful, but attached is a screen cap of what I see in the console when viewing the app and again, I don’t see anything that looks like layers referenced, though it does show the appID and the webmap_ids… There seem to be lots of error messages! Thanks for trying to help! |
Cool you should almost be there, is your map displaying in the app? This error may indicate that one of the map layer is not accessible. Your issue may just be that you have commented LAYER_ID. The layer ids should be displayed just before or after the second error. Int he code if you can modify that line it will help you see if that line is printed... |
Yes, the webmap is displaying in the main panel, and I can see the layers, and click on the features to see the popups I have configured. From: glazou [mailto:notifications@github.com] Cool you should almost be there, is your map displaying in the app? This error may indicate that one of the map layer is not accessible. Your issue may just be that you have commented LAYER_ID. The layer ids should be displayed just before or after the second error. Int he code if you can modify that line it will help you see if that line is printed... — |
I think I found your issue, the documentation is not clear enough and you must have pasted the code at a wrong place, this is how it should looks like i.e. from the sample of code the following is already present in index.html
|
Seems like we may be close! <script type="text/javascript" src="app/main-config.js"></script>
From: glazou [mailto:notifications@github.com] I think I found your issue, the documentation is not clear enough and you must have pasted the code at a wrong place, this is how it should looks like [image]https://cloud.githubusercontent.com/assets/994078/8319176/c1b0fc3e-19c0-11e5-9b94-00bb8f655d79.png i.e. from the sample of code the following is already present in index.html require(["dojo/topic"], function(topic) {
— |
You should see it in your console. Can you share a link to your app? |
well, I seem to have gotten past this sticking point, and identified the layer_id. However, now the application is still throwing errors when I try to click on a point on the map, the app freezes and I get this error message: Script: http://dswcapps.dcr.virginia.g…ymap/app/viewer-min.js?v=1.3.0:1"If I stop the script, the app is no longer usuable and I have to restart it. when i look at the console messages, the first error showing there is: My app is not shared as public yet, only to a group within my organization. There are other error messages further down, but this seems the first sticking point.. |
Do you get a new error message right after you click on the map? I never faced that, not sure if I can help if your app isn't public. |
yes, the first error message about the script occurs immediately upon clicking a point on the layer. It pops up on screen, not in the console. Notice it says "You do not have permissions to access this resource or perform this operation" in the first console message. The story map references another arcgisonline web map; i thought that both had the same access/sharing setup, but could something be going on there perhaps? Since this is in development i didn't want to make it public yet! Not sure what else I can do to get help at this point.. |
I see. I remember one thing now... I fixed a bug (fix to be released tomorrow) that was making the application freeze if the section index you are trying to navigate to was not existing. That should be your issue. Could you modify the click event to be
If it doesn't freeze anymore, make sure that you have at least the number of section printed in the console. With the patch I will release tomorrow, the application won't freeze but the navigation would not occur either as the section doesn't exist. |
ok, yes, that stops it from freezing. I did make sure to click a point that has an associated section, but it doesn't do anything. this appears to be the relevant error message in the console: TypeError: c is null when your patch is applied tomorrow, do I uncomment out that line above? topic.publish("story-navigate-section", index); again, I can't thank you enough for trying to help me! |
You are welcome. You could use |
ah yes, that makes sense! i had objectid as not visible in the featurelayer, and the popup... here again, is a portion of the console:I'm clicking on MANAME= Crows Nest which corresponds to section 4 in the application. Does it matter that the value of MANAME as shown below "Crows Nest" is not the same as the title of the section, which displays as "Crow's Nest - Stafford County - 2,872 acres" Note also, that the underlying web map with the two layers shown below are scale dependent; va_snap_link_5934 shows as a point layer in the main view, and that's the one I'm clicking on to try and jump to a section in the side panel. the va_snap_8756 is a polygon layer of the boundaries of preserves, that gets displayed once the user has selected one of the sections and is zoomed in... Both layers have the same attribute names, at least for MANAME."layers id" Array [ "va_snap_8756", "va_snap_link_5934", "locateLayer" ] index.html:423:12 |
so, in the code i see the cursor DOES change to a pointer, but when mousing over a point, I don't get the attribute name and appended 'CLick to zoom' as a popup as expected. It appears that the value within the attribute name is supposed to be parsed into comma separated values, or is it looking for comma separated values already?, so for example, if my MANAME = Crows Nest, should the message be or is it looking for a value of Crows Nest? |
Cool, getting there. What the app is expecting is an index not a section name.
For the mouse-over, you probably want to replace with |
ok, I do have a javascript person here who might be able to help w/ the fine tuning, but to be clear, if I made OBJECTID visible in the webmap application again, and went back to using that would it be easier? Although, I don't think the objectid values correspond to the journal sections either... I was just going to list those alphabetically by preserve name. Possibly complicating things more: I have 62 preserves, but only 21 will have corresponding sections, as they are the only preserves with public access.. but i wanted the default view for the "home section" to be a map zoomed out to whole state showing the preserves. User would hover over a point, and if it showed as public access = Y, they could click on it, and zoom to the corresponding section.. |
The sectionMapping logic may be the most simple but you can also think about having another attribute in your data that give you the corresponding section. If that attribute has a value of 0 you could skip navigating... Glad to hear a developer can help you, good luck. |
he's awesome w/ Javascript and Jquery, but doesn't know ArcGIS at all, so if we run into trouble making some edits can we still check in? And I'd like to thank you by name, but I don't know it! You've been above and beyond helping someone who's barely literate! I can almost follow along w/ what's happening, but am not a programmer by training... |
You are welcome, our priority is to help our user succeed. I never promise to be help if it's not strictly related to the app and your data come into the game, but I will try. I'm Greg! |
Thanks Greg! Any chance the app will get this functionality some point in the future? From: glazou [notifications@github.com] You are welcome, our priority is to help our user succeed. I never promise to be help if it's not strictly related to the app and your data come into the game, but I will try. I'm Greg! — |
it's not on our development list right now but hoping to do it soon! |
Is this possible in the current version? I have used the code provided and it still does not work. I am not using a CSV though. UPDATE: I figured out how to do this. A feature layer is needed if hosting on your own server How would one get this to work on mobile devices? Click does not work. |
I'm having trouble with the story-loaded-map event not being hit. The function(result) never runs. |
I've created a map with points in ArcGIS online, but I'm unable to link to different sections from that map. I see this in the Readme, but I'm not clear what this means:
What does "layer attributes" refer to?
I'm trying to duplicate the same section linking as seen here: http://storymaps.esri.com/stories/2014/bee-tour/
Thanks.
The text was updated successfully, but these errors were encountered: