Esri / elevation-profile-template

Elevation Profile is a configurable application template used to display the elevation profile for a selected feature or a measured line along with a web map.
Apache License 2.0
29 stars 27 forks source link

red cross shows on the previous location until create a new elevation profile #9

Open chen7012 opened 9 years ago

chen7012 commented 9 years ago

Steps to reproduce: 1.click on the measure button 2.click one point, and double click on the map to set the end point for the measure.

  1. waiting for the elevation profile to be created, then hover on the profile. 4, the red cross will show on the map.
  2. single click on the map again to start the new measure, but the red cross is still showing on the previous location.

Is there a way to clear it?

hli123 commented 9 years ago

I resolved the issue by adding a handler for "measure-stat" event. Here is the detail:

  1. added the line of code to _initMeasureTool: function () in Widget.js in the templete:

       this.onMeasureStart=this.measureTool.on("measure-start", lang.hitch(this, this._onMeasureStart));
  2. added the function _onMeasureStart in Wedget.js:

_onMeasureStart: function () { this._displayChartLocation(-1);
},