Select to view content in your preferred language

[Solved] weird issue with measure widget

615
3
04-18-2012 06:40 AM
JatinPatel
Regular Contributor
I have added a measurement widget on my webapp. the functionality works flawless, but for some reason when you click on Area Tool and select 1st point, the blue line joining the point and cursor does not appear. But when you click the second point, the blue line is present between 1st and 2nd point, but again the new blue line connecting 2nd point and the cursor is missing. So on and so forth. And eventually when you double-click to complete the polygon, the there is not line between the last and first point.

[ATTACH=CONFIG]13630[/ATTACH]
0 Kudos
3 Replies
derekswingley1
Deactivated User
Can you post code to reproduce this?
0 Kudos
JatinPatel
Regular Contributor
measurement = new esri.dijit.Measurement({
            map: _map,
            onClick: disableIdentify
        }, dojo.byId('measurementDiv'));


disableIdentify basically disables the identify function i have.

    function disableIdentify() {
        identifyBtn.attr('class', "btn_up");
        identifyBtn.toggleMode = 0;
        dojo.disconnect(dojoIdentify);
        _map.graphics.clear();
        _map.infoWindow.hide();
    }
0 Kudos
JatinPatel
Regular Contributor
I found the bug.
_map.graphics.clear();
is what was killing it.
I was under the assumption that it was getting fired only one time, but it is actually getting fired everytime i click on the map while using the tool.
0 Kudos