AnsweredAssumed Answered

Move mapView using buttons

Question asked by mshah12 on May 21, 2018
Latest reply on May 22, 2018 by mshah12

Hello,

 

For my application, I have a mapView object (called view). I have to add navigation buttons to the application so that the users can click on the ">" button to move the view to the right. I know that a mapView can already be moved to the right, left, up, or down using the arrows on a keyboard (Moving, rotating, and ordering graphics—Help | ArcGIS for Desktop ). But I am trying to figure out a way to be able to being that functionality to the 4 navigation buttons I have added to the application. In order to move right, I tried (several versions of) the following code:

 

view.then(function(){
on(rightArrow, "click", function(event){
console.log("coming from view.then function");
var e = $.Event("keypress", {keyCode: 39, shiftKey: true});
console.log("e: ", e);
view.map.trigger(e);
})
})

 

But this code gives errors (like view.trigger is not a function or if I try view.map.trigger(e), I get the same error). If anyone has any ideas, it would be very helpful. 

 

Thanks!

Outcomes