isInitialized property
What is the point of the isInitialized property? I understand it shows whether a class is initialised but when should I be initialising classes? So far, i've been able to achieve what I need with most classes showing isInitialized = false. Under what conditions do I need to explicitly initialise MapService and Layer objects?
Additionally, the behaviour I see is that initialising the Site object doesn't initialise all mapService and Layer objects. Is this correct?
Thanks, David
-
You need to initialize a class when you need access to information that would not be available otherwise. Information such as Properties and Extensions. The reason that you don’t need to initialize a class most of the time is because we do get most of the information when initializing collections (such as MapServices collection). When initializing the Site, layers and map services are not set to “initialized” for the reasons mentioned above.
As of 3.3 of Geocortex Essentials it is now possible to request a “deep initialization” of a site, which returns absolutely everything in one REST request instead of a minimum of 5.
The Silverlight API 2.3 has a new DeepInitialize property for the Site that if set to true (in xaml or in code) will use the one request method. It is set to false by default for backwards compatibility, but setting it to true will improve performance. The Silverlight Viewer sets it to true by default.
Note that when using deep initialize, all objects in the site will return true when querying the IsInitalized property.
The upcoming Flex API 2.3 will also support deep initialization.
Cheers,
Christian.
0 -
Thanks for your explanation Christian, it's really helpful. 0
Please sign in to leave a comment.
Comments
2 comments