AnsweredAssumed Answered

Point moves on map after featureLayer.applyEdits

Question asked by lteasley on Mar 20, 2017
Latest reply on Mar 24, 2017 by rscheitlin

I'm trying to add a point to a featureLayer. The user clicks on a point on the map, it is added to the featureLayer. It works but when the point is displayed it is shifted down and to the left of where the point was originally put on the map. When I step through the code I can see that the point going into newGraphic is the same as where the pointer is on the map, but when it is then redisplayed on the map it is shifted down and to the left. The pointer is an arrow and the point that is added ends up on the lower left portion of the head of the arrow instead of at the tip. I have compared my code to every piece I can find that works correctly but cannot find a setting or something that I may have missed.


drawToolbar.on("draw-end", function(evt) {
                    var scale = scaleUtils.getScale(map);
                        alert("Please zoom in. Editing is not allowed at Map Scales less than 1:24,000.");
                        var newAttributes = lang.mixin({}, selectedTemplate.template.prototype.attributes);
                        newAttributes.BUSINESSID = document.gisStartForm.businessId.value;
                        newAttributes.GIS_LOC_ID = document.gisStartForm.gisLocationId.value;
                        newAttributes.CREATEDBY = document.gisStartForm.userId.value;
                        newAttributes.DATECREATE =  getTime();
                        var newGraphic = new Graphic(evt.geometry, null, newAttributes);
                        selectedTemplate.featureLayer.applyEdits([newGraphic], null, null
                                , function(addResults){
                                    result = addResults[0];
                                        sketchExists = true;
                                        pointExists = true;
                                        pointModified = false;
                                        pointFeature = newGraphic;
                                        document.gisStartForm.systemMessages.value = "null";
                                    } else {
                                , defaultErrorHandler);                    
                    //determine if point is within state boundaries