Control Zoom extent on onRowClickHandler(evt)

533
1
04-27-2010 10:58 AM
TonyBoehm
New Contributor
My function works fine but I need the final zoom extent to be further out.
My current code is:

      //Zoom to the parcel when the user clicks a row
        function onRowClickHandler(evt) {
            var clickedTaxLotId = grid.getItem(evt.rowIndex).OBJECTID;
            var selectedTaxLot;
            for (var i=0, il=map.graphics.graphics.length; i<il; i++) {
                var currentGraphic = map.graphics.graphics;
                if ((currentGraphic.attributes) && currentGraphic.attributes.OBJECTID == clickedTaxLotId) {
                    selectedTaxLot = currentGraphic;
                    break;
                }
            }

Any ideas would be greatly appreciated.
Thanks!!
0 Kudos
1 Reply
RobinWoodsong
New Contributor
//Zoom to the extent of the parcel - expand it a bit so we aren't zoomed in too close.
          var stateExtent = selectedState.geometry.getExtent().expand(5.0);
          map.setExtent(stateExtent);
0 Kudos