Select to view content in your preferred language

Zoom to feature

653
0
07-27-2012 02:10 AM
PramodHarithsa1
Frequent Contributor
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.?
0 Kudos
0 Replies