Schnoerkel

Measure widget display lenght in Map

Discussion created by Schnoerkel on Jun 29, 2012
Latest reply on May 26, 2013 by igor.karuza-gdi-net-esridist
Hey I want to display the lenght from each squence of the measure in the map.

thats works all fine but when I display the first measure of area in the map i got only wrong values displayed.

That is my code i insertet in measurement.js ....

        var _17;
 if(this._map.snappingManager)
 {
  _17=this._map.snappingManager._snappingPoint;
 }
 var _18=_17||evt.mapPoint;
 
 //###############################
 var xmuss = _18.x - ((_18.x - this.inputPoints[0].x)/2);
 var ymuss = _18.y - ((_18.y - this.inputPoints[0].y)/2);
 var winkelmuss = (Math.atan2((this.inputPoints[0].y - _18.y), (this.inputPoints[0].x - _18.x))*180)/Math.PI;
                                         
 var pt = new esri.geometry.Point(xmuss, ymuss, this._map.spatialReference);

 var textSymbol = new esri.symbol.TextSymbol();
 textSymbol.setColor(new dojo.Color([0,0,0])).setFont(new esri.symbol.Font("12pt").setWeight(esri.symbol.Font.WEIGHT_BOLD));  
 var gemessen = this._geodesicDistance(this.inputPoints[0],_18)*1609.34; 
 textSymbol.text = dojo.number.format(gemessen.toFixed(1), {pattern: this.numberPattern}) + "m";
 if(winkelmuss < 0 && winkelmuss > -90)
 {
  winkelmuss = winkelmuss*-1; 
  textSymbol.yoffset = -10;
         textSymbol.xoffset = -10;                                                     
 }else if(winkelmuss <= -90)
 {
  winkelmuss = (winkelmuss +180)*-1; 
  textSymbol.yoffset = 10;
 textSymbol.xoffset = 10;                                                            
 }else if(winkelmuss > 0 && winkelmuss < 90)
 {
  winkelmuss = winkelmuss*-1;
  textSymbol.yoffset = -10;
 textSymbol.xoffset = -10;
                                                               
 }else if(winkelmuss >= 90)
 {
  winkelmuss = (winkelmuss - 180)*-1; 
  textSymbol.yoffset = 10;
 textSymbol.xoffset = 10;                                                            
 }
 
 textSymbol.angle = winkelmuss;
 
 
 this.textGraphic=new esri.Graphic();
 this.textGraphic.setSymbol(textSymbol);
 this.textGraphic.setGeometry(pt);
 this._map.graphics.add(this.textGraphic);
 this.measureGraphics.push(this.textGraphic);


Hope anyone can help me

Outcomes