This page is dedicated to providing simple tips and solutions to common issues and needs in developing with MDNS.
1. Embedding a MapTOC into a page with automatic scrollbars for overflow
Often it is the case that a MapTOC can expand in size as zoom scale changes or layers are added dynamically. In this situation, you may want to not have this HTML element expand and alter the layout of your page. One common solution is to have the extra content available with scrollbars. Below is some sample HTML which shows how this can be done.
<td valign="top" style="width: 200px">
<div style="overflow: auto; position: relative; width: 200px; height: 300px;">
<isccmp:maptoc id="MapTOC1" runat="server" ... ></isccmp:maptoc>
</div>
</td>
Notes:
- Setting overflow to auto creates the scrollbars
- Setting position to relative is necessary for containing a MapTOC and scrolling
- The width and height must be set in order for scrollbars to appear according to HTML specifications
- All of this can be set in an external stylesheet
2. Add a progress image
MDNS utilizes AJAX for flexible and dynamic web applications. A common need with AJAX-based applications is providing notification to the user when loading is occurring. MDNS has built in support for displaying a progress image. Simply set the ProgressImageID property on your MapControlBridge to the ID of an HTML element that you want to be displayed during callbacks. This should point to a element that is by default hidden. For example:
<img id="progImage" src="Images/indicator_mozilla_blu.gif" style="float: right; visibility: hidden" />
In order to have it show up on your AJAX callbacks, you will need to call the ShowProgress function in your generated JavaScript in RegisterTemplateScript:
...
ShowProgressFunctionName + "(true);" +
"CallbackMethods.HandleDrillDownIdentify(x, y, zl, " + OnMapStateChangeCompleteCallbackName + ");" +
...
"ShowProgressFunctionName" is predefined and will make your progress image appear. The callback completion method "OnMapStateChangeCompleteCallbackName" will handle hiding it.