Select to view content in your preferred language

Adding custom SVG icons with changeable backgrounds.

143
7
Thursday
MatějKotyza
Emerging Contributor

We have a problem with adding our own icons in SVG format so that ArcGIS Online sees the icon as stylable. We need both the circle and the icon symbol to be stylable from the icon. Unfortunately, we are unable to make the SVG so that Map Viewer recognizes the icon as multiple layers and therefore styles both the circle and the symbol. It always recognizes the icon as single-layer and the symbol changes based on the change of the circle, unless the symbol is black.

Here is an example of how we currently have the SVG set up so that the circle changes, but the symbol remains unchanged. This is a PNG of the symbol, which is encapsulated in the SVG.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="256" height="256" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Stylovatelný kruh -->
<circle cx="128" cy="128" r="128" style="fill:#3182bd;" fill="currentColor" />

<!-- PNG symbol -->
<image x="0" y="0" width="256" height="256"
xlink:href="data&colon;image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAIRQTFRFAAAA/38A/wAAzDMAqgAAAAAA//////8A/z8A/wAAfwAAvz8Avz8//wAAvwAA/39//wAA/1UA/1VV/////z8/qlVVzDMzzGYz/wAAqlUA/7+/AAAA/5+f/////7+/qgBVfwAA/9SqAP///wBV/6qq/////wA//2Yz5eX/f39/f38A/6rUWl7dEgAAACx0Uk5TAAIDBQMBAwEEAQIEBAIEAgQDAwEEAwUFBQME/wgECAMEBgEDAwIEBQoCAgY7dYN+AAAK4ElEQVR4nO2d+XPbRBTHtY5de+04IXEpZFKgUwbK8f//KQxDBwoDE47Si7a56iQm8inJe7xrpZWi7y9QR3q776M93l6SSsJLpZqm/3fvA/im/nX3qnceLE9rqcD2hxf6lHH76HxwJpYXo0IC0DszjvMrjc77AUtCMABjdXYlZqw7nL0TM5ZXGABjNZV+aLoXhkEAAPvqMkyR1f3Zf+JGpQHoy1GowppqfCrd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R2h8WlkpECh/IpukKponGN0I7F8Q2iVWAQIR9wW3yR1dljpAEHJfdJ9gWePkx8+SvanY5h3RjZLDbilT57t9xkuPihLeKaovZyHPnn7/QzLuyVY1+a2yQXtFsaq/Voi9wvpyFKQ1OEgu5PftBdosPVQdYQbdwTTIcb5wu8WHnY5Yk9gZhvE+CbxdXusrfn81VjP/Th+6gp8X2O+cK3L+h+r8CWibA12lHJjQg96rHWQZ1tPuFXGaD6X/AaqIHPhSCI98AAAAAElFTkSuQmCC" />
</svg>

Is there any way to make ArcGIS recognize the symbol as stylable?

When we convert it to a vector, ArcGIS Online still cannot recognize it as another layer.

7 Replies
RussRoberts
Esri Notable Contributor

Currently when you upload an SVG we use the symbolserver which converts that SVG to a CIM/Vector symbol which is the same as taking the image and using the SVG in a shapemarker symbol in Pro. The one thing we don't expose yet are the different elements inside a symbol layer which Pro does where you can customize certain elements but you cannot set color locking on these elements so if you use a color ramp on the symbol all elements would pickup the same color. If you want individual symbol layer customizing I would recommend building the symbol out in Pro with a symbol layer for the core and then a secondary one for the background.  This blog can help walk you through this https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/use-published-2d-symbols-in-arcgis-o... 

0 Kudos
MatějKotyza
Emerging Contributor

Thank you for the answer, we will definitely try the procedure via ArcGIS Pro.

0 Kudos
LadislavJeník
Occasional Contributor

If I understand correctly, ESRI does not support correct import of a style if the SVG contains multiple elements. It does not store them in a way that the individual style layers (images) are independent of each other. Why is this so?
I would also like to know how ESRI creates styles for ArcGIS Online, where individual styles can contain different independent style elements (images). And it is possible to set them correctly independently for this reason.

0 Kudos
RussRoberts
Esri Notable Contributor

They get converted to a CIM vector symbol by the symbol server on the portal/online and this is the output does not have those same elements like in Pro locally as of yet. We also don't have immediate plans for diving into the individual elements of a single symbol layer but are focusing on the primary individual symbol layers and the effects that can be applied to a symbol layer and exposing those properties like animations, hatch and marker fill properties and more.

 

When creating this multi layer vector symbols in Pro we will add them as individual symbol layers and set the color locking (helpful when applying color ramps to a symbol), additional symbol styling like default color, size, rotation + effects we want present. Then sharing that symbol as a web style if we want to use it as a symbol gallery inside the symbol styler or it can be shared in a map or layer and just be stored for that item being authored. 

 

Blog posts that can help out

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/use-published-2d-symbols-in-arcgis-o...

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/a-new-way-to-add-web-styles-in-map-v...

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/do-more-with-symbols-in-map-viewer-b...

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/use-animated-symbols-in-map-viewer

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/upload-images-to-style-point-symbols...

 

 

 

 

 

0 Kudos
LadislavJeník
Occasional Contributor

@RussRoberts 
Thank you for the comprehensive information and links.
I really appreciate your effort to help and I appreciate your time and effort.
However, I still don't really understand that ESRI technology does not fully and correctly support the structure and capabilities of the SVG format within styles. At least from the perspective of a lay user, or a graphic designer.
It would be great if everything were simpler and more understandable for ArcGIS Online users. Not everyone has the ability to use ArcGIS Pro software.

0 Kudos
RussRoberts
Esri Notable Contributor

When the symbol is uploaded it is converted to a CIM based symbol and is not a stored SVG. This is how we store vector symbols in Online and Pro. What types of actions are you trying to do on an SVG you are uploading? 

0 Kudos
LadislavJeník
Occasional Contributor

@RussRoberts 
I understand that the SVG format is just a "portable" style format for you, which is stored in another form (data model - CIM).
We need ArcGIS Online to support importing multi-element style from SVG to CIM. So that the style background and foreground can be styled independently. Which are made up of an independent element in the SVG style format. This is how it is created in the SVG file.

0 Kudos