Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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