creating a legend in Finder app

3110
12
05-15-2014 11:53 AM
by Anonymous User
Not applicable
I have started creating some Finder application maps (Parcel, Planning Filings) and my co-workers have enjoyed being able to search data on a larger scale than just addresses. What I was curious about is the ability to add a legend to the map. I'm not seeing anyway to configure one or any code on GitHub to add one. It would be nice to show what the various symbols mean. Any help would be greatly appreciated.
Tags (2)
0 Kudos
12 Replies
PaulStephenson
Occasional Contributor III
I've run into the same thing, and I'm sure many others have as well. In a couple of cases I have added the legend as an image to the Help section as a work around. Here's an example: http://morton-il.maps.arcgis.com/apps/Solutions/s2.html?appid=552d82542e634540a89dff8b88ba7fd5

Paul
0 Kudos
by Anonymous User
Not applicable
Paul,

Thank you very much for that suggestion. It works wonderfully. Great work-around. Took me a moment to figure out how to embed the image but got it done. Thank you again.

Tom
0 Kudos
JuneAcosta
Occasional Contributor III

Hi Tom,

Where are you adding this img tag to show it on the help screen? Are you adding tag to the Finder.json file in the section where you are able to modify the text for the help?

0 Kudos
JohnFalkowski
New Contributor
How did you embed the image?  I'm assuming you loaded the legend jpg into a website and then referenced it, but details would help.

John Falkowski
0 Kudos
PaulStephenson
Occasional Contributor III
John,

That's exactly it. The legend is saved as an image, and hosted on a server. It is then referenced with an HTML img tag.

Paul
0 Kudos
by Anonymous User
Not applicable
John,

here is the code I found online

<br><img src="http://media.greenwood.in.gov/files/cds/StormSystemLegend.png"<br>

where you would insert your own url location image. Hope this helps.

Tom
0 Kudos
ShawnaErnst
Occasional Contributor

I followed this guide:  Additional configuration - Get Started | ArcGIS for State Government

It works like a charm and makes a dynamic legend so if you update your map, you don't have to update the Legend graphic.

I can't figure out how to get a Legend Icon made, though.  I'm getting a red X where the icon should be.

0 Kudos
ShawnaErnst
Occasional Contributor

I ended up figuring out how to write a legend icon- here's the code (you can use this in conjunction with the Guide from my original post).

"iconJson": "[{'shape':{'type':'rect','x':2,'y':2,'width':4,'height':4,'r':0},'stroke':{'type':'stroke','color':{'r':0,'g':0,'b':0,'a':1},'style':'solid','width':2,'cap':'butt','join':4}},{'shape':{'type':'rect','x':2,'y':13,'width':4,'height':4,'r':0},'stroke':{'type':'stroke','color':{'r':0,'g':0,'b':0,'a':1},'style':'solid','width':2,'cap':'butt','join':4}},{'shape':{'type':'rect','x':2,'y':24,'width':4,'height':4,'r':0},'stroke':{'type':'stroke','color':{'r':0,'g':0,'b':0,'a':1},'style':'solid','width':2,'cap':'butt','join':4}},{'shape':{'type':'rect','x':12,'y':2,'width':16,'height':4,'r':0},'stroke':{'type':'stroke','color':{'r':0,'g':0,'b':0,'a':1},'style':'solid','width':2,'cap':'butt','join':4}},{'shape':{'type':'rect','x':12,'y':13,'width':16,'height':4,'r':0},'stroke':{'type':'stroke','color':{'r':0,'g':0,'b':0,'a':1},'style':'solid','width':2,'cap':'butt','join':4}},{'shape':{'type':'rect','x':12,'y':24,'width':16,'height':4,'r':0},'stroke':{'type':'stroke','color':{'r':0,'g':0,'b':0,'a':1},'style':'solid','width':2,'cap':'butt','join':4}},]",

0 Kudos
JuneAcosta
Occasional Contributor III

In my case I need to embed an image on the Help screen likeTom. Adding the Legend widget does not work for my app since the layers I need for the legend are from a tiled service. I just cant figure out where to put the <src > tag to embed the image.

0 Kudos