pramodharithsa

Zoom to feature

Discussion created by pramodharithsa on Jul 27, 2012
On search i load a data grid and on click of data grid i zoom the map to the extent of object selected in grid.

I am using a function,
function onRowClickHandler(evt) {
            var ClickedId = grid.getItem(evt.rowIndex).OBJECTID;
            var selectedId;

            dojo.forEach(map.graphics.graphics, function (graphic) {
                if ((graphic.attributes) && graphic.attributes.OBJECTID === ClickedId) {
                    selectedId = graphic;
                    return;
                }
            });
            var selectedExtent = selectedId.geometry.getExtent();
            map.setExtent(selectedExtent);
        }

and i also have a zoom to button on a popup which appears on click of a map component.

The Zoom factors of these two differ.
I prefer the pop one.(which is inbuilt). So how do i alter my function to get the result desired.?

Outcomes