AnsweredAssumed Answered

Polygon isSelfIntersecting

Question asked by a.schaefer-esri-de-esridist on Dec 17, 2013
Latest reply on Dec 17, 2013 by a.schaefer-esri-de-esridist

I'm working on a redlining function, where I want to check if the polygon is selfIntersecting. I check the geometry, but it says that it's always self-intersecting, even if it isn't.

The code is really simple. Here are the snippets.

        initDraw: function() {             this._tb = new Draw(;              // I DRAW A POLYGON             this._tb.activate(Draw.POLYGON);              this._tb.on("draw-end", lang.hitch(this, this.addToMap));          },          addToMap: function(evt) {             // some stuff              this._tb.deactivate();              var symbol = new SimpleFillSymbol(config.geometryStyles.geofencePolygon);              // MY GEOMETRY == MY POLYGON             var geometry = evt.geometry;              var graphic = new Graphic(geometry, symbol);             this.geofenceGraphicsLayer.add(graphic);              // MY CHECK. Is always alerting, shouldn't do that. :(             if (geometry.isSelfIntersecting) {                 alert("Is Self Intersecting");             } else {                 // do something...             }         },

This is the polygon as JSON that I send to the console. It's a simple triangle.


What's wrong with the check? Why is "isSelfIntersecting" always true, even if I draw some simple polygon?

The geometry seems to be a Polygon. Firebug says:
- declaredClass: "esri.geometry.Polygon"
- type: "polygon"

Does the method not work on a drawn geometry? Am I missing something?

System: JS-API 3.7, Firefox 25.0 with Firebug.

I appreciate any help. Thanks in advance.