Ik werk met veel klanten die de mogelijkheid willen om hun feature service-bijlagen weer te geven in de web map-popup in plaats van een hyperlink. Het bijgevoegde script zet de URL van de feature services-bijlagen om naar een veld. U kunt de bijlage dan direct in de popup weergeven na enige configuratie.<\/P>
<\/P>
Hier is een screenshot van hoe bijlagen standaard worden weergegeven binnen een web map-popup:<\/P>
Hieronder staan de stappen om de bijgevoegde afbeelding direct in de popup te tonen:<\/P>
1. Voeg een TEKST\/STRING-veld toe<\/A> (bijv. "Picture<\/STRONG>") aan de feature service dat een groot aantal tekens kan ondersteunen (bijv. 1.000).<\/P>2. Voer het bijgevoegde GP-hulpmiddel uit.<\/P>3. Configureer de pop-up om Afbeeldingen weer te geven<\/A>. Bijv:<\/P> <\/P><\/P> <\/P>De afbeelding wordt nu direct in de popup weergegeven. Bijv:<\/P> <\/P><\/P> <\/P>Opmerkingen: <\/STRONG><\/P>de time-out voor een ArcGIS Online feature service is ingesteld op maximaal 15 dagen.<\/LI>de time-out voor een ArcGIS Server-service is ingesteld op de standaard 'Lifespan of long lived token'. De standaard is 1 dag. Dit kan worden gewijzigd via Server Manager > Security > Settings. Nadat het long lived token is bijgewerkt, kunt u de vervaldatumparameter op regel 33 aanpassen.<\/LI>Aangezien het token verloopt, kunt u de parameters in het script aanpassen zodat dit kan worden uitgevoerd met Windows Task Scheduler<\/A>. Hier is een voorbeeld van hoe u de parameters configureert:<\/LI><\/UL><\/P> <\/P>Een video van de workflow vindt u hieronder:<\/P>https:\/\/www.youtube.com\/watch?v=WpLJBZ9gnuw<\/A><\/P>
De afbeelding wordt nu direct in de popup weergegeven. Bijv:<\/P>
Opmerkingen: <\/STRONG><\/P>de time-out voor een ArcGIS Online feature service is ingesteld op maximaal 15 dagen.<\/LI>de time-out voor een ArcGIS Server-service is ingesteld op de standaard 'Lifespan of long lived token'. De standaard is 1 dag. Dit kan worden gewijzigd via Server Manager > Security > Settings. Nadat het long lived token is bijgewerkt, kunt u de vervaldatumparameter op regel 33 aanpassen.<\/LI>Aangezien het token verloopt, kunt u de parameters in het script aanpassen zodat dit kan worden uitgevoerd met
Een video van de workflow vindt u hieronder:<\/P>
Jake,
Thanks for your help. This worked.
Cheers,
Mike
Michael K. Harte
Senior Spatial Information Analyst
Spatial Services
QPWS
Department of Environment and Science
Michael Harte I believe the issue is your username. In certain scenarios it is case sensitive. You are specifying michael.hart_qgsp, but upon viewing your username in AGOL it's Michael.Harte_qgsp. Here is a screen shot of how I had the tool setup in ArcMap:
This completed successfully:
I created a new feature service (brooyar_withAttachments) and a new web map (http://arcg.is/1f04bm) both shared with the Group you invited me to. The web map shows an example of the pop-up:
Thanks for getting back so quickly.
I’ve added”/0” to the end of the URL for the feature service as advised (using ArcMap 10.5.1 - Advanced):
Result I get is (same for three attempts to make certain login details correct):
“Executing: AttachmentstoPopup2 true false false # michael.harte_qgsp ***** https://services1.arcgis.com/HrMiNYsSqqPpLTDE/arcgis/rest/services/Brooyar_TEST/FeatureServer/0 http://qgsp.maps.arcgis.com Picture
Start Time: Fri Mar 09 09:11:26 2018
Running script AttachmentstoPopup2...
Error: Line 36 -- "token = data['token']": 'token'
Completed script AttachmentstoPopup2...
Failed to execute (AttachmentstoPopup2).
Failed at Fri Mar 09 09:11:28 2018 (Elapsed Time: 1.23 seconds)”
Tried same on ArcGIS pro. Same error.
Thanks for your help.
Michael Harte you will need to specify the layer in the service by adding a /0 at the end of the URL. Ex:
https://services1.arcgis.com/HrMiNYsSqqPpLTDE/arcgis/rest/services/Brooyar_TEST/FeatureServer/0
Thanks for the quick reply. Here is a screen shot of the argument entry form for ArcMap 10.5.1:
I have created a group named “Attachments to Popup” and invited you (jskinner_CountySandbox). I have shared the feature service “Brooyar_TEST” with this group. Sync is enabled and all edit options are enabled.
Here is the error message I got in the tool dialogue details:
“Executing: AttachmentstoPopup2 true false false # michael.harte_qgsp ***** https://services1.arcgis.com/HrMiNYsSqqPpLTDE/arcgis/rest/services/Brooyar_TEST/FeatureServer http://qgsp.maps.arcgis.com Picture
Start Time: Thu Mar 08 16:36:34 2018
Error: Line 34 -- "response = urllib2.urlopen(req)": <urlopen error A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>
Failed at Thu Mar 08 16:38:41 2018 (Elapsed Time: 2 minutes 7 seconds)”
Thanks for your help with this.
Michael Harte
Spatial Services | Tech Ops
Queensland Parks and Wildlife Service
Michael Hart can you send a screen shot of how you have the tool setup?
Also, could you enable Sync on the service and share it to a Group in AGOL? You can then invite my user account (jskinner_CountySandbox) to this Group so I can take a look.
I am trying to populate an empty field in an AGOL feature service with the AGOL addresses of the photos attached to the service. I want the ability to have the photos appear in a popup. I have followed the instructions offered above and run the associated tool from ArcMap 10.4, ArcMap 10.5 and ArcGIS Pro 2.1. The initial error messages I received were like, "Executing: AttachmentstoPopup2x, Error: line 36 Token..." (even when using ArcGIS Pro when the initial script should have been calling AttachmentstoPopoup3x). As recommended in one post from "jskinner-esristaff", I expanded the size of the field for the attachment addressess to 1024. No luck. Last week error messages changed to "Error: Line 34 -- "response = urllib2.urlopen(req)": <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>". Any assistance would be appreciated.
Andrew, you can share the service to an ArcGIS Online group and invite my user account (jskinner_CountySandbox) to it and I can take a look.
I am running this processing tool in ArcGIS PRO to get the images to work in my hosted services, but i keep getting this error.
I am sorry my coding is not the best, but I looked in the Json for tokens and could not find them.
Start Time: Wednesday, February 21, 2018 12:32:18 PMRunning script AttachmentstoPopup2...Generating Token Error: Line 36 -- "token = d['token']": 'token'Completed script Attachments to Popup... Failed to execute (AttachmentstoPopup2).
I am using ArcGIS Pro to run the tool, but ArcGIS Advanced 10.3 to publish the services, as i could not get eh tool or scripts to run in 10.3. I am hosting on AGOL, and not using server or portal.
thanks in advance for any and all help.
Thanks jskinner-esristaff,
I will re-run it and let you know if there are any problems!
Troy
troy.wirth looks like I didn't set the token expiration for 3.x version of this tool. It is now set to the maximum (15 days). Redownload the tool and execute it. The pop-ups should remain for 15 days.
Hi Jake Skinner,
I haven't tried to run it from desktop. I can give that a shot. It is a hosted feature layer. I suspect Raymond Wang is correct that it is a token issue, but not sure how to solve it. Looks like I don't have the adequate privileges to invite you to the group but you should get an invite to the "GIS Survey Pledge" group. Thanks for your help!
must be expiring token on ArcGIS server
Raymond Wang, PE, GISP
Director, Geographic Information Systems
Development Programming
GEODESIGN + RESEARCH + ANALYTICS
550 Newport Center Drive | Newport Beach, California | 92660-7011
Phone 949.720.2333 | Cell 949.636.6406
rwang@irvinecompany.com
troy.wirth
Hello jskinner-esristaff,
I am using your script with ArcGIS Pro and a hosted feature service. Everything works fine for a few hours and then the links are broken. If I run it again it, the problem will be fixed for a few hours again. Not sure what the problem is. Any ideas?
Thanks,
@Aaron_Dorsey, no having GlobalIDs should not cause this error. I cannot say for sure why you are receiving this error. If you want to share the service to a Group and invite my user account (jskinner_CountySandbox) I can take a look at it.
Another question for you Jake Skinner:
Will having GlobalIDs create a problem when using UpdateFeatures via REST?
I get the error below in the response after it sends the UpdateFeatures request (when looping through the OIDs looking for attachments in AttachmentsToPopup2x.py):
{u'error': {u'message': u'Unable to complete operation.', u'code': 500, u'details': [u'Unable to perform updateFeatures operation.']}}
I was getting an SSL cert error when sending the json, but I disabled it though urllib2 context:
ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE response = urllib2.urlopen(req, context=ctx)
Note that the other requests (e.g. getting OID fieldname, checking for hasAttachments) work fine with the SSL workaround, so I don't think that's the problem.
rnrwang the password will be retained, but it will only show 4 * symbols so others will not know the length of your password. Can you private message me with the feature service URL and a username/password I can use?
Hello, here are my screenshots with errors in both ArcMap & ArcGISpro. I'm thinking it's not picking up my user & password for my arcgis service? the password is longer than 5 characters but it seems to default to ***** after I leave the entry cell. Please advise.
yheta42 usernames are case sensitive when run through GP tools. You are specifying 'eva_tan', but looking at the owner of the user group you shared with me, your username is 'Eva_Tan'. Try this username and see if you get it work.
annehulsey for the feature service make sure you specify the layer within the service. For example, at the end of the URL add a '/0'. Take a look at my screen shot I sent a couple comments up.
jskinner-esristaff Thank you for the tip about 1000 characters for the field. Unfortunately, I still get the same result. I have added a .jpg of the error message to the group I shared with you.
Thanks for the help -- I don't know what I'm doing wrong, but I'm getting the same problem as before, Error: Line 36 -- "token = data['token']": 'token'. This is when setting up the tool the same way you did. Is there something I need to change with the token?
Evangeline Tai I downloaded the service using the following tool. I then re-uploaded as a new service to my ArcGIS Online org and was able to successfully run the Attachments to Popup tool. Here is how I had the tool setup:
You can take a look at the web map here.
Sorry about that! Sync should be enabled now.
yheta42 can you enable 'Sync' on the service (Settings tab > Enable Sync). I would like to download the service and then re-upload to my Organization.
annehulsey your field Popup_URL is not big enought:
Try increasing this to a length of 1,000.
Hi Jake, I've sent an invite to you for the group. Tried executing the tool again, and this time got a different error:
annehulsey and @E_T if you can share the service you are having issues with to a group in ArcGIS Online. You can then invite my user account (jskinner_CountySandbox) to this Group. I can take a look to see what's going on.
Hi Jake, first of all, thank you for putting this script up. Sorry if this is a rather basic question. I've tried using your GP tool a couple of times but keep ending up with this error
I'm not sure what's going on, would you be able to advise?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.