The Popup of ArcGIS JavaScript API has a 'Zoom To' link on it that zooms you 4 levels closer to the linked feature.

I'd like to fire another event after the default zoom to function executes.

Here is the link in the HTML.

<div class="actionsPane">
  <div class="actionList">
    <a class="action zoomTo" href="javascript:void(0);">Zoom to</a>

I'm able to add a function to the Zoom To click with jQuery like this:

$('.action.zoomTo').click(function() {alert('Clicked!');});

But the the function above occurs before the default function of 'Zoom To'. I wouldn't mind their click function executing, so long as it fires after mine does.

Any ideas?

1 Answer 1


You can disconnect the ESRI Zoom To function like this:


This assume your var map = esri.Map(). The the fifth element in the _eventConnections array is the zoom to event.

Then you can attach your own events to the Zoom To with jQuery or dojo:

// Add custom zoom To
$('.action.zoomTo').click(function () { alert('First!'); });
$('.action.zoomTo').click(function () { alert('Second!'); });

It appears that the new connection can only be made after the an InfoTemplate is instantiated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.