Capture Zoomto button's Click from map.infowindow

803
3
02-12-2014 08:47 AM
VikramS
Occasional Contributor
All,

Can anyone please show me how to capture the zoom-to click event which is available in the map.info window ?
0 Kudos
3 Replies
ManishkumarPatel
Occasional Contributor II
Hi Vikram,

You can disconnect the ESRI Zoom To function like this:

dojo.disconnect(map.infoWindow._eventConnections[4]);

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.


Best Regards,
Manish
0 Kudos
VikramS
Occasional Contributor
Thanks Manish . Also I had another question . Is it possible to capture the next feature on click and previous feature on click event in map.infoWindow .

IS it possible to capture it ?
0 Kudos
ManishkumarPatel
Occasional Contributor II
Thanks Manish . Also I had another question . Is it possible to capture the next feature on click and previous feature on click event in map.infoWindow .

IS it possible to capture it ?


You are welcome. Please help to mark this thread as answered if your issue has been resolved 🙂

Also regarding the next and previous feature. Do you mean to select the feature on the map which corresponds to the next record in the attribute.

I am sorry I didnt quite get what you mean.

Please help to provide some detailed scenario.

Thanks
0 Kudos