Future Properties, Methods, and Events in 4.0

2818
4
Jump to solution
10-09-2015 10:28 AM
MichaelLakey
New Contributor III

I was able to take some time over the last few weeks to investigate the new 4.0 beta.  While I realize that 4.0 is in the initial beta phase and has limited functionality, it is pretty obvious that the API has been substantially overhauled between 3.x and 4.0.  Some changes are largely syntactical, but others - especially those changes relating to Map and Layers - require a rethinking of how a mapping application is constructed.  Before my project starts to consider how to rearchitect its current application, I was hoping to get a good read on what constructs may be supported in future betas and the final release of 4.0.  What follows are several "groupings" of API functionality that I have heavily leveraged in the 3.x versions of the API, but do not appear to be supported in 4.0 Beta 1.

  1. Map navigation methods (pan, zoom, center, etc.) - Are we to expect that the 3.x map navigation functions will be performed by equivalent 4.0 properties, such as MapView.zoom and .center?
  2. Keyboard methods (ex: enable/disablePan, enable/disableClickRecenter) - I have used these methods to limit user input in some circumstances.  There appear to be no analogous methods to manage keyboard input in 4.0.
  3. Map events - Previous versions of the JS API were very event driven.  In 4.0, it appears that this event-like functionaltiy is done by watching properties.  Many of the 3.x events have similar properties in 4.0, and these can be used to perform the same function, but the ability to respond to mouse and keyboard actions seems very limited in 4.0.  Events do exist in Beta 1, but they are very limited in number and scope.  Are there plans to expand the number of events in future betas, or perhaps to add analogous properties to manage mouse/keyboard actions?

Any insignt from the Esri developers out there would be greatly appreciated

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
KristianEkenes
Esri Regular Contributor

Hi Mike,

These are some great questions. You are right, 4.0beta1 is very limited in functionality compared to 3.x versions of the API. 4.0 beta1 is primarily a developer preview to showcase the direction we're going in re-designing the API, which clearly affects the way it is consumed by developers and users. While these are substantial differences in many cases, the hope is that the code structure will be easier to work with and more developer friendly by the time of our final release. Now about your questions:

1. Many of the same map navigation properties exist in 4.0, but on the MapView or SceneView as you have noted. You can use MapView.zoom, .center, .scale, .extent to set the extent. As far as actual navigation methods go, you can use MapView.animateTo() to accomplish this. This sample shows an example of how animateTo() may be used to zoom to graphics, geometries, or a simple object with center and zoom properties.

2. This will be another major difference in the 4.0 API. Many of these navigation methods such as enabling/disabling map navigation will be handled with the GestureManager class. Keep in mind that this class is not complete and not yet fully functional. So keep an eye out for changes coming here that will communicate how to use GestureManager for these purposes.

3. This would also be handled in GestureManager.

Hopefully, this information is helpful. Again, each of the betas will feel limited compared to the 3.x versions, but by the time we release 4.0 final next year, solutions to these questions will all be answered. Thanks for your feedback and input.

View solution in original post

4 Replies
KristianEkenes
Esri Regular Contributor

Hi Mike,

These are some great questions. You are right, 4.0beta1 is very limited in functionality compared to 3.x versions of the API. 4.0 beta1 is primarily a developer preview to showcase the direction we're going in re-designing the API, which clearly affects the way it is consumed by developers and users. While these are substantial differences in many cases, the hope is that the code structure will be easier to work with and more developer friendly by the time of our final release. Now about your questions:

1. Many of the same map navigation properties exist in 4.0, but on the MapView or SceneView as you have noted. You can use MapView.zoom, .center, .scale, .extent to set the extent. As far as actual navigation methods go, you can use MapView.animateTo() to accomplish this. This sample shows an example of how animateTo() may be used to zoom to graphics, geometries, or a simple object with center and zoom properties.

2. This will be another major difference in the 4.0 API. Many of these navigation methods such as enabling/disabling map navigation will be handled with the GestureManager class. Keep in mind that this class is not complete and not yet fully functional. So keep an eye out for changes coming here that will communicate how to use GestureManager for these purposes.

3. This would also be handled in GestureManager.

Hopefully, this information is helpful. Again, each of the betas will feel limited compared to the 3.x versions, but by the time we release 4.0 final next year, solutions to these questions will all be answered. Thanks for your feedback and input.

MichaelVolz
Esteemed Contributor

So navigation methods such as enabling/disabling map navigation will be handled with the GestureManager class.  Does this mean that applications that use the current non-GestureManager class in 3.x API will need to be recoded in these areas?

0 Kudos
MichaelLakey
New Contributor III


Thanks, Kristian.  This is definitely helpful.

I thought the GestureManager might be the object to "replace" eventing.  I even tried to implement GestureManager, but without examples or additional documentation to help me, I didn't have any success.  It sounds like it is a work in progress anyway, so I will probably wait until a future beta to test its implementation.

0 Kudos
KristianEkenes
Esri Regular Contributor

You're right. It is still a work in progress. GestureManager was not ready in beta1, but it will be ready in a future release.