Those of you trying to use Map Suite Web in an MVC app may find this helpful. I'd appreciate hearing from anyone who has found other/better ways to do this.
We've been able to use Map Suite Web in an MVC2 application to a limited extent. Basically, we can accept input from the user and refresh the map based on that input plus we can handle a map click event, as follows:
1. Use an aspx page with code-behind as the MVC view page. Create the map in Page_Load as you would in a webforms application.
2. Add an html base tag in the page head block with the full url to the apparent view folder (needed to correct relative references for some of the map api calls). For example:
/Map/Views/" /> (where Map = controller name and Views = MVC root Views folder)
3. Add the following to the httpHandler nodes (handlers node for IIS7) of the web.config files in the MVC Views root folder and in the application root (for latter config file you may need to use path="/map/*_GeoResource.axd", where 'map' in this case is for the controller 'MapController').
<add verb="*" path="*_GeoResource.axd" type="ThinkGeo.MapSuite.WebEdition.GeoResourceFactory" />
5. For updating map based on a query, show a form to obtain the user's query criteria and then post it back using ajax to a controller action that (1) stores the criteria in session and (2) returns a script to force the page to refresh. The criteria in session are used by the map page when it reloads.
4. For click handling, add a script to the page to handle a click event on the map, as follows:
var OnMapClick = function (e) {
var lonlat = this.getLonLatFromViewPortPx(e.xy);
var params = "x=" + lonlat.lon + "&y=" + lonlat.lat;
CallActionWithParams("Map", "MapClick", params); // this is a function we use to call the MapController's MapClick action using AJAX post with params supplied
}
3. Set the OnClientClick event handler on an overlay (we used a HighlightOverlay):
Map1.HighlightOverlay.OnClientClick = "OnMapClick";
4. Create an action on the controller that takes parameters x and y as double, does the processing you want, and sends a script back to refresh or redirect the page via javascript.
It's a bit of hack, but it's working...