Friday, June 26, 2009

Resolution of ESRI ArcGIS 9.3 Web ADF Map control base map display

My team has developed an ASP.NET Web ADF application where we are dynamically initializing the MapResourceManager, and setting one of the layers based on user role.  See my Part 1 post for more details.  Our map contains a blend of a dynamic “Projects” layer, several cached layers from an in-house server, and several cached base layers from ArcGIS online.

We were having a problem where our base map, an ArcGIS online service, was displaying as solid gray after the user logged in.  The display would be fine when the user initially browsed to our site, but would be a solid gray after login and postback.

It turns out the problem was that we were setting the PrimaryMapResource property on our Map control to be our dynamic “Projects” layer.  The resolution is simple:  either set the PrimaryMapResource to be one of the ArcGIS online cached layers, or don’t set the PrimaryMapResource at all, in which case the default becomes the last layer added to the MapResourceManager, which in our case is one of the ArcGIS online cached layers.

See this EDN article for more details on the role of the PrimaryMapResource property.  I suspect our problem was caused by having the default tiling scheme set by a dynamic map layer and then applied to a collection of cached map layers.

As a side benefit, our site performance has improved noticeably with this code change.

No comments:

Post a Comment