Mapxtreme tile handler – Pitney Bowes MapXtreme User Manual

Page 94

Advertising
background image

Chapter 5: Web Applications, Controls, and Tools

MapXtreme Tile Handler

MapXtreme v7.1

94

Developer Guide

<add verb="GET,HEAD" path="ScriptResource.axd" . . .
<add verb="*" path="MapController.ashx" . . .

<add verb="*" path="LayerController.ashx" . . .

</httpHandlers>
If any of those first four httpHandlers entries are missing from your Web.config file, copy the
missing entries from the AJAXDemo Web.config file, and paste them into your Web.config file. (It
is not necessary to copy the LayerController.ashx entry; if you place the LayerControl on your
page in Designer mode, the LayerController.ashx entry will be generated automatically.)

7. Locate the httpModules section of your Web.config file. The httpModules section probably

already contains one entry, for MapInfo.Engine.WebSessionActivator. Copy the "ScriptModule"
entry from the AJAXDemo Web.config file, so that your httpModules section resembles this:
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule. . .
<add type="MapInfo.Engine.WebSessionActivator. . .
</httpModules>
If the controls in your UpdatePanel affect the map in some way, you will need to add JavaScript
to the page to force the map image to update. The AJAXDemo sample application contains
sample JavaScript that demonstrates how you can update the map image whenever the
designated UpdatePanels cause a page update.

8. Open the AJAXDemo application's MapForm.aspx page in Source mode. Copy the <script>

block and paste it into your aspx page. NOTE: You must paste the <script> block after the
ScriptManager tag, because the script makes use of objects provided by the ScriptManager.

9.

In the <script> block, delete the DisplayEventInfo function and any calls to it. The

DisplayEventInfo function is a debugging tool for the AJAXDemo application; it is not needed in
other applications.

10. If you renamed your UpdatePanel, edit the <script> block to use the new UpdatePanel name.

(The UpdatePanel name is passed as the second parameter to the TargetPanelWasUpdated
function; the default name is "UpdatePanel1".)

11. If you use more than one UpdatePanel in your application, but you do not want all of the

UpdatePanels to affect the map, then you should set each UpdatePanel's UpdateMode property
to Conditional. For details, see the ReadMe file provided with the AJAXDemo sample
application.

For additional details about the Web.config settings required by ASP.NET AJAX extensions, please
consult Microsoft's ASP.NET AJAX documentation.

MapXtreme Tile Handler

MapXtreme provides a REST-based tile handler and public URLs that are used to request map tiles
and information. With a REST-based handler, you can embed all the arguments of your map request
in a single URL.

Map tiles are becoming essential today in web mapping as they can be pre-rendered and stored,
awaiting requests from a user. You can design a tile server that stores base maps as static images
since these do not need to be updated during the user’s session. For dynamically changing data that

Advertising