How to avoid two titles for each legend item in web maps.

3822
7
Jump to solution
03-01-2016 07:32 AM
AnnVanSlembrouck
Occasional Contributor

More often than not, my web maps have two titles for each legend entry. How do I avoid or remove these?

Does any one else experience this?

Here is an example:

Capture.PNG

0 Kudos
1 Solution

Accepted Solutions
KellyGerrow
Esri Frequent Contributor

Hi Ann,

Your application is referring to both the map service and the feature layer in your legend. When building a web map from a map service, try adding the feature layer directly to the web map:

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/MapServer/0

Resulting Application:

http://www.arcgis.com/apps/ImpactSummary/index.html?appid=c3f5040b368844af90302d54d3f5f042

instead of

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/MapServer

Resulting Application

http://www.arcgis.com/apps/ImpactSummary/index.html?appid=c3f5040b368844af90302d54d3f5f042

View solution in original post

7 Replies
KellyGerrow
Esri Frequent Contributor

Hi Ann,

Your application is referring to both the map service and the feature layer in your legend. When building a web map from a map service, try adding the feature layer directly to the web map:

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/MapServer/0

Resulting Application:

http://www.arcgis.com/apps/ImpactSummary/index.html?appid=c3f5040b368844af90302d54d3f5f042

instead of

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/MapServer

Resulting Application

http://www.arcgis.com/apps/ImpactSummary/index.html?appid=c3f5040b368844af90302d54d3f5f042

AnnVanSlembrouck
Occasional Contributor

Thanks Kelly, this is exactly what I needed!

0 Kudos
C_EHoward
Occasional Contributor III

good tip but will not work if you have complex symbology as it 'dumbs it down' to draw.

if you publish with the 'per request modification' for layer order and symbology, you can delete the sublayers you do not want. But you still end up with a double legend

and sometimes you can keep the legend title blank, but it does not work for all legend types

0 Kudos
AnnVanSlembrouck
Occasional Contributor

That doesn't work when using a cached map service. Adding the layer within the service is not an option, with large datasets that need to be cached. Are there other options? Thanks!

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hi Ann,

There isn't a way to work around this with a cached map service as you need to add this type of service with as a Map Service. Is the cached service layer being used as a basemap or an operational layer? Is it possible to share the web map?

Cheers,

Kelly

0 Kudos
AnnVanSlembrouck
Occasional Contributor

Hi Kelly, thanks for your interest in my question.

Here is one that we are currently developing.

My goal is to clean up the legend, as it is move complicated than it needs to be.

maps.semcog.org/agricultural

Ann

0 Kudos
by Anonymous User
Not applicable

Kelly Gerrow

On-prem Feature layers are too slow in my testing. The double layer name listing is still an issue for me.

Adding sublayers ie  layerpath/0  always adds it as a featureLayer. This appears to be a limitation of either the webmap or REST API.  Most of my layers are too heavy to work as feature layers. I've tried webGL, scale dependency etc. And feature service tiling on-premise still seems not to be in Server 10.7.1.  I can't store data on the Esri cloud as feature layers, as it has no grouping. Only way for me to use layers which load fast and have grouping is map image layers. 

I would settle if there is an elegant programmatic way in WAB Dev Ed to remove the top-level service name. From the Layer List, but hopefully also Query, Print and Legend or anywhere else. But the main area to remove them for me would be LayerList.  Thoughts??  I am thinking the only thing I could do now is make the name blank at the service level in the webmap although I don't think it will allow spaces, though I could use a character.

0 Kudos