How to create PictureMarkerSymbol from specific URL

288
2
Jump to solution
06-07-2023 05:48 AM
GKmieliauskas
Esri Regular Contributor

Hi,

I have got symbol url from layer legend. It looks like:

"image://arcgisruntimeimageprovider/67f53ba9-10bd-4bc9-a602-3356b685c9f6/image"

It works if I use that URL for Image control source property in dialog.

I have tried to create PictureMarkerSymbol like in code below:

var pictureMarker = ArcGISRuntimeEnvironment.createObject("PictureMarkerSymbol", {
    width: 32,
    height: 32,
    offsetY: 16
});
pictureMarker.url = symbolUrl

var graphic = ArcGISRuntimeEnvironment.createObject("Graphic", {
geometry: currentLocation})
reportGraphicsOverlay.graphics.append(graphic)

If I use local url as "../images/pin.png" it works fine.

 

1 Solution

Accepted Solutions
JamesBallard1
Esri Regular Contributor

Hi @GKmieliauskas. Sorry for the delay.

The image:// scheme images used by the LegendInfoListModel are temporary, in-memory images that are designed to be displayed in UI controls. However, there is another way to do this.

Using the same LegendInfoListModel, you can access each LegendInfo, which all have their own symbol property you can use with a graphic directly.

https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-legendinfolistmodel.html#g...

https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-legendinfo.html#symbol-pro...

Let us know if that works for you.

View solution in original post

0 Kudos
2 Replies
JamesBallard1
Esri Regular Contributor

Hi @GKmieliauskas. Sorry for the delay.

The image:// scheme images used by the LegendInfoListModel are temporary, in-memory images that are designed to be displayed in UI controls. However, there is another way to do this.

Using the same LegendInfoListModel, you can access each LegendInfo, which all have their own symbol property you can use with a graphic directly.

https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-legendinfolistmodel.html#g...

https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-legendinfo.html#symbol-pro...

Let us know if that works for you.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Thank you. It works,