create polygon through ArcGISRuntimeEnvironment.createObject

575
4
Jump to solution
08-14-2020 02:58 AM
rsharma
Occasional Contributor III

This code have some error

kindly help: it do not plot outline with the fill symbol

function zmarkerSymbol(){
        var houtline={"style":Enums.SimpleLineSymbolStyleSolid, "color":"red","width":1.0};
    return ArcGISRuntimeEnvironment.createObject("SimpleFillSymbol",{"style":Enums.SimpleFillSymbolStyleSolid, "color":Qt.rgba(2, 2, 0, 0.4),"SimpleLineSymbol":{simpleLineSymbol:houtline}});
    }
0 Kudos
1 Solution

Accepted Solutions
LukeSmallwood
Esri Contributor

I think the whole command should look something like this:

const houtline = ArcGISRuntimeEnvironment.createObject("SimpleLineSymbol", {style:Enums.SimpleLineSymbolStyleSolid, color:"red",width:1.0});
const sym = ArcGISRuntimeEnvironment.createObject("SimpleFillSymbol", {style:Enums.SimpleFillSymbolStyleSolid, color:Qt.rgba(2, 2, 0, 0.4), outline:houtline});

					
				
			
			
				
			
			
				
			
			
				

View solution in original post

4 Replies
LukeSmallwood
Esri Contributor

Hi rajni sharma‌ 

I think the problem is that you have quotes around the properties you are using in the create function (e.g. styls, color, width). Take a look at the example in the API ref here

Does this work:

return ArcGISRuntimeEnvironment.createObject("SimpleFillSymbol",{style:Enums.SimpleFillSymbolStyleSolid, color:Qt.rgba(2, 2, 0, 0.4),"SimpleLineSymbol":{simpleLineSymbol:houtline}});

I also think you would need to call ArcGISRuntimeEnvironment.createObject for the "houtline" symbol you are creating.

rsharma
Occasional Contributor III

No it does not work, it just show filled symbol but it doesnot show outline. I tried this also, it shows only fillsymbol with no outline

var houtline = ArcGISRuntimeEnvironment.createObject("SimpleLineSymbol",{"style":Enums.SimpleLineSymbolStyleSolid, "color":"#FF0000","width":2.0});
   return ArcGISRuntimeEnvironment.createObject("SimpleFillSymbol",{style:Enums.SimpleFillSymbolStyleSolid, color:Qt.rgba(2, 2, 0, 0.4),simpleLineSymbol:houtline});
    }
0 Kudos
LukeSmallwood
Esri Contributor

I think the whole command should look something like this:

const houtline = ArcGISRuntimeEnvironment.createObject("SimpleLineSymbol", {style:Enums.SimpleLineSymbolStyleSolid, color:"red",width:1.0});
const sym = ArcGISRuntimeEnvironment.createObject("SimpleFillSymbol", {style:Enums.SimpleFillSymbolStyleSolid, color:Qt.rgba(2, 2, 0, 0.4), outline:houtline});

					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
rsharma
Occasional Contributor III

thanks luke, well if simply created it does not use outline. where was the problem actually

    // *** create simple boundary symbol ***//
     SimpleFillSymbol {
         id: fillSymbol
         style: Enums.SimpleFillSymbolStyleSolid
         color: Qt.rgba(1, 1, 0, 0.0)
         SimpleLineSymbol {
             style: Enums.SimpleLineSymbolStyleSolid
             color:"#ff7919"
             width: 2.0
         }
     }

					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
0 Kudos