AnsweredAssumed Answered

View's graphics layer not displaying Polylines

Question asked by Eletrosul on May 5, 2017
Latest reply on May 5, 2017 by TSolow-esristaff

I have two SubLayers (from a MapImageLayer), one is a Point and the other a Polyline.

 

I'm querying them for their geometry and adding as graphics to the View's graphics layers (view.graphics) as needed.

 

The problem is that, only the Point feature is being displayed, the Polylines aren't.

 

Things checked :

1) The query is indeed returning the features asked with geometry

2) The features(graphics) are indeed added to the View's graphics collection, just not displayed

 

var symbol_trecho = new SimpleLineSymbol({
    width: 10,
    color: [255, 0, 0, 1]
});

var query = new Query();
query.where = response.where;
query.outFields = ['OBJECTID', 'COD'];
query.returnGeometry = true;
lyr_polylines.queryFeatures(query).then(function(results){
    var features = results.features;
    features.forEach(function(feature,i){
        feature.symbol = symbol_polyline;
        view.graphics.add(feature);
    });;
})

 

Thing is, I add both the Points and the Polylines to the View's graphics (Points always added first), can it only display one type of geometry? I tried adding to another GraphicsLayer too but it didn't work, so I'm not sure of anything

I can't track this issue, it's driving me insane...

 

(The mismatching names of the symbols was just a typo and couldn't fix it)

Outcomes