Hi All - I'm developing a custom application, where in user loads from standard boundraies (city/neighbourhood ) to get geometry, I execute a query to get results and during the query success, I call show results as seen below which populates the dgrid and outlines the geometry on the map. The grid is getting populated, but I don't the see the geometry being drawn on the map. Please advise what could be the problem. I'm totally lost. Could it be possible the Graphicslayer has to be moved to the top??, given that , there are other layers which is hiding them. (We call the Java middle tier to make the rest call, we don't make REST api calls from the client side)
_showResults: function(token, map,bndryType,featureSet) {
var layer = map.getLayer("drawLayer");
layer.clear();
var items = array.map(featureSet, function(feature) {
var drawByGraphic = new Graphic(feature );
var json = { };
json.bndryName = feature.attributes[token];
json.col1 = feature.attributes['OBJECTID'];
json.geometry = feature.geometry;
json.bndryType = bndryType;
json.isSelected = false;
var sfs = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([232,104,80]), 2),new Color([255,255,0,0.25])
);
layer.add(drawByGraphic);
return json;
});
if(items) {
items.sort(this._sortByName);
var memStore = new Memory({
data: items,
idProperty: 'col1'
});
this._bndryGrid.set("collection", memStore);
this._bndryGrid.set("selectionMode",'none');
}
else
this._bndryGrid.set("collection",null);
},
In the postcreate method , I init the GraphicLayers as below:
this.drawLayer = new GraphicsLayer(layerArgs);
this.bndryFillLayer = new GraphicsLayer(layerArgs1);
Also, I listen for the map loaded event and add these graphic layers to the map
this.map.addLayer(this.drawLayer);
this.map.addLayer(this.bndryFillLayer);
Solved! Go to Solution.
I figured the problem, it was the problem with the alpha value. It has to be a value from 0-255, rather we have set the value similar in Flex btwn 0 and 1.
Found an example here, which helped set the right symbology json literal for the Graphics object.
Hi Priya,
Have you tried to take a look about this sample DataGrid with zoom button | ArcGIS API for JavaScript
I figured the problem, it was the problem with the alpha value. It has to be a value from 0-255, rather we have set the value similar in Flex btwn 0 and 1.
Found an example here, which helped set the right symbology json literal for the Graphics object.