use multiple fields to symbolize features

1246
8
05-24-2023 04:34 AM
by Anonymous User
Not applicable

I published a layer of pavement marking lines to AGOL using the Share as Web Layer option in ArcGIS Pro. Since publishing the layer several weeks ago, I have started to configure a few field maps apps using the dataset. One of the apps requires that I create a custom pop-up in map viewer classic. I received a warning when I first opened the map that some of the layer symbology was created in map viewer and is incompatible with map viewer classic. I created a custom link to Survey123 and saved the layer - not realizing that the original symbology was overwritten and all of my linework is now stored at thin grey lines. Is there a way to recover my original symbology? I would also be willing to re-create all of the symbols manually but when I try to configure it in ArcGIS Online I am only able to add 1 text field attribute when I need to symbolize using 3 (Type, Use, Colour). i.e. as soon as I select one of the fields and click the +Filed button again I can only choose to add the created date, edited data or shape length fields.

SHartholt_0-1684927846873.png

SHartholt_1-1684927876720.png

 

0 Kudos
8 Replies
RussRoberts
Esri Notable Contributor

Multifield support using multiple fields to uniquely style (types style) a layer is not fully supported in Map Viewer or Map Viewer Classic. Both apps support viewing them but cannot configure the symbol styling further. This is on our roadmap to add support for this configuration in Map Viewer.

When sharing from Pro you need to check the option to Use symbols compatible with apps if you are planning to use them in Map Viewer Classic or Web AppBuilder.

You cannot recover the past symbology bc the symbology was overwritten when the Save Layer was applied. Map Viewer Classic will overwrite the symbology at the service level while Map Viewer we will only apply saved styles the the layer item level to preserve the original symbology of the published layer at the service level. You could bring the layer back into Pro and author the symbology that way.

0 Kudos
by Anonymous User
Not applicable

If I were to delete and then re-publish the layer, would it be possible to save my custom pop-up configuration in Map Viewer Classic without overwriting the symbology created in Pro? I was considering doing this but when I go to Disable Sync in the layer settings before I delete it I can see that multiple copies of the data are being used within my organization therefore I don't want to do it this way unless absolutely necessary.

0 Kudos
RussRoberts
Esri Notable Contributor

Deleting the layer you will lose the popup configuration.  Currently Pro does not have a Save layer but is on their roadmap to support similar to Map Viewer.

Why do you need to use MVC to create the popup configuration?  Can you create this configuration when you are publishing the layer  or use Map Viewer to author it? 

0 Kudos
by Anonymous User
Not applicable

I learned to configure links to other apps using the Custom Attribute Display in MVC. In the Field Maps app I want the user to click on a feature and use a Launch Inspection link to open a Survey in Survey123. I don't know if this is possible in Map Viewer (in the pop-up configuration tab there is a note Pop-ups authored in Map Viewer are not compatible with all apps).

SHartholt_1-1684933916699.png

 

SHartholt_1-1684933673512.png

 

 

0 Kudos
RussRoberts
Esri Notable Contributor

That popup should work in most apps bc its a single popup element it looks like. If you were to author more elements then apps like MVC or WAB would only support the top most element because they are built on the 3.x JSAPI. Field Maps, Instant Apps, Experience Builder, Dashboards for instance would support these popups.  Field Maps would also support the popups authored in Map Viewer or Pro using the Text element. 

0 Kudos
by Anonymous User
Not applicable

Thanks for your help! I didn't realize that I could enable custom links in Map Viewer. Just came across this article that explains how to do exactly what I'm looking for: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/url-parameters-pop-ups/

In regards to my original symbology issue, I think I will delete and re-publish the layer from ArcGIS Pro.

0 Kudos
owlnutcracker
New Contributor II

Regarding the first symbology problem, I plan to unpublish the layer from ArcGIS Pro and then publish it again.

 

papa's freezeria

0 Kudos
RoanokeDave
New Contributor II

Try doing this - and it'll be a bit cumbersome with the number of values you're dealing with but might work.

Create a custom expression for the symbology and use the When() statement to build a symbol code for each type. You can make the Type code in a range from 100 and up (by 100s); the Use code in a range from 10 to 90 (by tens); and the Color code in a range from 1 to 9. Then add the codes together to get a unique code for each combination of Type/Use/Colour. Of course you'd have to individually symbolize each code, and you have a lot. The code would look something like this:

// the first digit represent type

var typeCode = When($feature.TypeCode == 'Broken',100, $feature.TypeCode == 'Crosswalk',200 ...and etc..)

// the second digit represent use

var useCode = When($feature.UseCode == 'Bike Lane',10, $feature.UseCode == 'Parking',20, and etc ...)

// the third digit represent color

var colorCode = When($feature.ColorCode == 'Red',1, $feature.Color.Code == 'Green',2, and etc ...)

return typeCode + useCode + colorCode

Then use the unique value that is returned as the style attribute. That's how we used to do it in ArcInfo before the multiple attribute symbology was invented. If any of the categories have more than 9 possible values, then go to a 6 digit code and have 2 digits for each possible value.

I'm using this now for combining two codes that range from 1 to 3 for a total of 9 possible combinations.

0 Kudos