AnsweredAssumed Answered

Add graphic point after query

Question asked by rhyck.m on May 21, 2015
Latest reply on May 22, 2015 by tsellste

I am not sure what I am missing in this code. I am querying a point service and get a result. and then trying to convert the result to graphic to add it on the map... but no luck.

var querystreetIntersect = new Query();
                querystreetIntersect.where = where;
                querystreetIntersect.returnGeometry = true;
                streetLayer.selectFeatures(querystreetIntersect, FeatureLayer.SELECTION_NEW, function (features) {
                    


                    var lat = features[0].attributes["Lat"];
                    var lon = features[0].attributes["Long"];


                    //var point = new Point(lon, lat, new SpatialReference({ wkid: 102100 }));
                    var simpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 12, new SimpleLineSymbol().setStyle(SimpleLineSymbol.STYLE_SOLID).setColor(new Color([100, 100, 100])), new Color([0, 0, 0, 0]));
                    var graphic = features[0];
                    graphic.setSymbol(symbol);
                    
                    console.log(features[0]);
                    map.graphics.add(graphic);
                    map.centerAndZoom([lon, lat], 19);
                   
                });

 

 

 

here is the result object from the console:

graphicPoint.PNG

Outcomes