AnsweredAssumed Answered

Measurement widget location

Question asked by rhyck.m on Nov 14, 2015
Latest reply on Nov 16, 2015 by rhyck.m

I am trying to change the location behavior within the measure widget. my goal is to continue appending the locations each time the user clicks on the map and also not clearing the location graphics on the map. These locations will be then sent in an email. I could create a different container to perform this task but I thought since I already have the measurement widget I may just use it.

   var measurement = new Measurement({
        map: map
    }, dom.byId("measurementDiv"));
    measurement.startup();


    measurement.on("measure-end", getmeasure);
    function getmeasure(evt) {
        //console.log(evt);
        switch (evt.toolName) {
            case "location":
                console.log("Lat: " + evt.values[0] + " Lng: " + evt.values[1]);
                var tbl = $(".esriMeasurementResultTable tbody");
                tbl.append("<tr>"+
                    "<td><img src='images/esriGreenPin16x26.png' style='vertical-align:middle'></td>" +
                    "<td class='esriMeasurementTableCell'>" + evt.values[0] + "</td><td class='esriMeasurementTableCell'>" + evt.values[1] + "</td>");
                break;
            default:


                break;
        }


    }

measure.PNG  

 

Is there a different way of doing this?

Outcomes