.NET ADF WebMap Problem Part 3
Well I knew I would get back into trying to tackle this problem again.
My previous postings can be found here:
Part 1 (http://se7en.co.nz/cms/scrappad/archive/2005/07/14/576.aspx)
Part 2 (http://se7en.co.nz/cms/scrappad/archive/2005/07/17/586.aspx)
I spent a little while today re-looking at the problem. Ive been told that this issue has been fixed in 9.1, and now that I have started a new project and we are building again, I thought I would try this out. Basically the problem is that the WebMap object doesnt manage the extent for you if create it using one of the constructors. Something that can be really annoying!
Check out the code to this:
c_mapwebMap = New WebMap(c_factory.m_getGeoServerConnection, c_factory.m_getMapServerobject)
c_mapwebMap.StateManager = New StateManager(Me.ctl_MapControl, Me.ViewState)
c_mapwebMap.AGSWebControl = Me.ctl_MapControl
c_mapwebMap.ImageDescriptor = New ImageDescriptor(WebImageFormat.PNG24, 600, 277)
c_mapwebMap.Refresh()
Just some simple code, that creates the WebMap object, using one of the constructors that take a ServerConnection and a MapServerObject. Also note the StateManager which is required otherwise the WebMap will throw an error. As mentioned before this isnt documentated?
And the ImageDescriptor which is required for resizing the image.
How does the problem occur?, well do a simple ZoomIn, and this works. Note, im not using the ZoomIn built in functionality that comes with ESRI.Server.WebControls. Even if you tryed to use it with this scenario, it will throw an error as it expects the MapControl properties to be populated. We then continue to do another ZoomIn, what happens this time is that you end up in a totally different place to where you expect to be. The reason for this is that its actually zooming in on the previous extent.
The StateManager should be managing this to ensure this doesnt happen, but it doesnt, which is why this error occurs.
Im not sure whether its a bug or not that if you create a WebMap using a constructor it doesnt manage the extent for you, and you will have start managing the extent in your ViewState. This is a painful task!
If you create the WebMap using the MapControl, it works fine!, it will manage the extent for you, the problem is that you end up hardcoding your properties, which is really bad software design.
Due to the new complex framework im working with now and the timeframe, its too much effort to manage the extent everytime you do something, but im going to hold off until I get some feedback from ESRI if im missing something here? anyone else have some feedback?
Will keep everyone posted
Currently Playing: The Killers – Mr. Brightside


Yeh, I am impressed. How do you find the time to do all this. You must be working all night.-<a href="http://tramadol.mortgage-inf.info/index.html">tramadol</a>
<a href="http://tramadol.mortgage-inf.info/buy-tramadol-online.html">buy tramadol online</a>
<a href="http://tramadol.mortgage-inf.info/tramadol.html">tramadol</a>