Map opens to specific location based on URL?
Good Afternoon!
We have this website on our counties Environmental Health webpage that lists closed restaraunt facilities...
http://psbweb.co.kern.ca.us/EH_Framed_Webpages/EH_Enforcement_ClosedFoodFacility.aspx
When you click on one of the facilities, it links you to the web map I created that lists the restaurants inspections, allows you to run a report, and submit a complaint.
What I am wondering is if anyone has any ideas on how to have the map open to the restaurant that was clicked? So for example, if I click on Arbys in the list, the map opens up to Arbys, or opens the report for Arbys opens, or Arby's is already populated in the Search box? Ideas?
0
-
Lisa create your urls with unique ID, like below. Create a workflow that takes that input parameter and zooms to it. The below link is an example. It runs the FindFacility workflow with a facid = SDWF = SWDF-20160519054059. https://maperture.digitaldataservices.com/gvh/?viewer=cswdif&run=FindFacility&facid=SWDF-201605190540590 -
Hi Tom...Any chance you could post your workflow as an example? 0 -
Thanks! I'm sure I'll have more questions soon...Stay tuned! 0 -
Hi Tom! So I think I'm on the right track...I"ve created my workflow "URLWorkflow" which finds and zooms to a facility based on the input argument, but I get this error... 
And I believe my URL is correct?
https://phweb.co.kern.ca.us/Html5Viewer/index.html?viewer=safe_diner_viewer&run=URLWorkflow&recordID=FA0010448
I always seem to have problems with my query task in my workflows...Any ideas?0 -
Top of the workflow, there is a GenerateToken task. You will need to change the URL and enter the username and password for your server. 0 -
Are you suplying a token to the query?
Is it a secure service that you are doing the query against?
Regards
Ralph Price0 -
I have the GenerateToken task, and I believe I have to filled out correctly. Lets say my map service has a username of "ABC" and a password of "123"...Would it look like this with the username and password in quotes? 
I think there's something wrong with how I have my service secured because when I try to access it from here...
https://phweb.co.kern.ca.us/arcgis/rest/services/EH/Safe_Diner_01/MapServer
I enter the username and password and I get redirected to 'This page can't be displayed'
Thank you guys so much for your help! Tom...you are becoming a very dear friend of mine!0 -
Lisa. At the top of the workflow there is a task "GenerateToken". You need to change the Token Service URL to "https://phweb.co.kern.ca.us/arcgis/tokens/generateToken". Put in the "Username" and "Password". This will generate a token and store it in the agsToken variable. Make sure that your QueryTask is using the agsToken (see highlighted below)
https://dl.dropboxusercontent.com/u/695670/Capture.PNG0 -
Had to put this project on hold for a few weeks, but now I"m back and still struggling. So I got the Generate Token activity working, now I'm getting an error in the Buffer Task activity 

And my geometry URL is "https://phweb.co.kern.ca.us/arcgis/rest/services/Utilities/Geometry/GeometryServer"
What am I missing?0 -
Hi Lisa,
Have you tried putting the token variable into the Token field of the Buffer Task? Assuming the Geometry service is on the same server as your map service, you should be able to use the same token as the one you are using in your query task.
I hope this helps!
Thanks,
Danny0 -
Hi Danny, I'm still getting the Buffer Task error whether the token is there or not...
0 -
Hi Lisa,
Typically when you see an error about a required parameter being null or empty, it means that one of your variables is not defined. I would try putting the variables into alert boxes, and checking their contents (just before the Buffer Task). I would start with the urlGeometryService variable, and work down from there.
If you find that it's coming up blank, work backwards from that activity and find out where it's being defined from. From there, you can determine why it's blank.
I hope this helps!
Thanks,
Danny0 -
Check if fsFacility.Features.Any returns True (then the featureset contains features).
You can also inspect it with fsFacility.ToJson.
https://phweb.co.kern.ca.us/arcgis/rest/services/Utilities/Geometry/GeometryServer is not a secured service, so it is not necessary to use a token here.0 -
Thank you Nico, I'm a bit of a newbie still so I apologize for the question I'm able to ask...
When you say 'Check if fsFacility.Features.Any returns True' How do I go about checking that?0 -
Use the following in the Text property of an Alert activity. fsFacility.Features.Any.ToStringPlace the Alert between Query Task and Buffer Task.0 -
And another way to find out about what features you have is:
fsFacility.Features.Count.ToString
to find out how many features (aka Esri.ArcGIS.Client.Graphic(s)) you have in the FeatureSet
Regards
Ralph0 -
Thank you so much to everyone that commented on this thread! Much appreciated! Thanks to Nico, I realized my features weren't being passed, also needed to set a spatial reference in my Buffer task. Works perfect! THANK YOU AGAIN! 0
Please sign in to leave a comment.
Comments
17 comments