Just a quick note that if you've ever run into trouble keeping things positioned correctly in your browser app, take a look at dojo.coords. (ok, the doc is limited, but poke around with FireBug, and it's pretty easy to see what it does)
Basically this allows you to get the top, left, width, height, x and y for any element on your page. I was having issues with my Dojo slider control's positioning when added into the Virtual Earth control via map.AddControl. Basically the control loads just fine initially...
But when the browser window is re-sized, the control remains absolutely positioned on the page, rather than relative to the container (the VE control), as can be seen below.
Setting the CSS postition:relative, does not work at all, so the solution was to write a little code that would respond to the browser re-size event, and re-position the control. Hooking to the resize event is very easy with dojo.connect...
dojo.connect(window, 'onresize', positionZoomSlider);
Getting the correct position values in order to calculate the correct position was also easy when using dojo.coords... here's the function that positions my slider.
function positionZoomSlider() { //This is needed because the dojo slider seems to always be absolutely positioned. //so we attach this to the browser re-size so when things move around, the slider //is repositioned correctly. var control = $get('verticalZoomContainer'); control.style.top = dojo.coords(dojo.byId('contentContainer')).t + 30 + "px"; control.style.left = dojo.coords(dojo.byId('contentContainer')).l + 20 + "px"; }
I'm Dave and this is my blog. I'm usually writing about .NET Software Development, ArcGIS, or Agile Practices, but other stuff does creep in from time to time. I hope you find something of use, and feel free to contact me if you have any questions. You can also check out my profile on LinkedIn
dojo.DTSAgile.com is our technology preview / demo site. As I and my team cook up cool things we post them here.
ArcDeveloper.net is a site that hosts a set of open source projects related to ArcGIS. This includes Tile Cache for .NET (TC4N) and Feature Server for .NET (FS4N). Come over and check it out!
Assembla is a free service that provides Subversion source control, wikis and work Tracking. The ArcDeveloper project is run from here. It rocks. Check them out today.
Agilistas is a LinkedIn group focused on discussing and promoting Agile practices. Everyone is welcome to join in the conversation as we evolve the process of creating software to make it more enjoyable for all involved.