AnsweredAssumed Answered

Cannot read property 'type' of undefined

Question asked by espuguh17 on Apr 8, 2019
Latest reply on Apr 8, 2019 by tmcgee

I have an undefined problem with geometry.type, where I use symbol points, polylines and polygons for drawings and then export them into shapefiles.

 

 

var symbol;
if ( evt.geometry.type === "point") {
symbol = new Graphic(evt.geometry);
this.pointGraphics.add(symbol);
symbol = this.markerSymbol;
} else if ( evt.geometry.type === "polyline") {
symbol = new Graphic(evt.geometry);
this.polylineGraphics.add(symbol);
symbol = this.lineSymbol;
} else if ( evt.geometry.type === "polygon") {
symbol = new Graphic(evt.geometry, null, {
ren: 1
});
this.polygonGraphics.add(symbol);
symbol = this.fillSymbol;
}

this.connectMapClick();
this.map.graphics.add(new Graphic(evt.geometry, symbol));

 

 

I use cmv.io and dojo.toolkit for the script.

Outcomes