Surveying, Mapping and GIS

Exploring all aspects of mapping and geography, from field data collection, to mapping and analysis, to integration, applications development and enterprise architecture...

  • Geospatial Technology, End to End...

    Exploring all aspects of mapping and geography, from field data collection, to mapping and analysis, to integration, applications development, enterprise architecture and policy


Posted by Dave Smith On 11/05/2006 11:38:00 PM 2 comments

Though I have been playing with code for close to 30 of my 40 years, I have always considered myself far more of a hack than any kind of disciplined programmer with a formal background, as my focus has always been one of the science and engineering professional, oriented toward solving specific domain issues, such as surveying, hydrology, environmental issues, transportation, and the like - and most recently I have been thrust into Enterprise Architecture mainly due to my understanding of both the business and IT side of geobusiness - yet in terms of coding I have always managed to get some quick and often unique results in my forays into the programming world, and I am once again quite pleased tonight. One of the things I was ruminating on a few days ago is the possibility of using ASPMap as a web service, and calling the service via JavaScript and populating the view via AJAX. Better yet, extending ASPMap to serve WMS requests, but I am getting ahead of myself...

Yesterday I sat down and managed to build a web service around ASPMap (MS Visual Studio 2005 ASP.NET and .NET Framework 2.0), and as its primary functionality, it currently accepts bounding box and image size as parameters - layers and other settings will be forthcoming. Essentially the service renders the image and then dumps it out as a file - I used a milliseconds function in JavaScript to provide the unique identifier (no cookies, no viewstate or other serverside issues - all these are managed by JavaScript in the browser)

I then tried Matteo Cassati's Soap Client for JavaScript and then used the DOM to insert the image (with the known URL) into the view. I still want to better understand what I can and can't do with the return types, but that will come...

I then built some JavaScript functions to pan, zoom, et cetera, as well as a one to resize the image (with a new call) whenever the browser is resized (note the views here are full-screen, although with the banner blurred out to protect potential customer). The map view will be dynamic, trying to maximize screen real-estate. I also want to do some nice AJAX magic with collapsing/resizable map controls and query panels (the navigation/toolbar shown in the upper right is already enabled in this fashion)...

The next thought actually ties back to my original thought in a way... Having already built all the infrastructure, what would be involved in hitting an OGC WMS service and bringing in the image? Not much at all, just a little magic trying to navigate how JavaScript deals with ampersands in constructing strings. An hour and a half tonight, and my WMS client is also done - you see here a classic image from NASA JPL (MODIS Mosaic) - there is still much more tweaking and functionality to be developed, but for a mere weekend's work for a hack like me, I am quite pleased with the results.

Considering I managed to fit all of this in during a hectic weekend, in the midst of preparing for a move (with painting and carpeting the new house, boxing things up at the old house, et cetera) and driving 4 hours to Washington, DC tonight for meetings tomorrow, I am frankly amazed that I managed to get this done so quickly.

I am very much looking forward to what the next few months will bring. My intent is to build some very robust and reusable infrastructure. What I have started here will become universal throughout future applications, and the beauty of it is that I will be able to snap in whatever mapping infrastructure is available, whether ArcIMS or ArcGIS Server, ASPMap, WMS Servers, or anything else I can either build a Web Service wrapper around or convert to WMS outright.

2 Response for the " AJAX, ASPMap and WMS "

  1. Gopi says:

    Hi David:

    I am new to ASPMap and Ajax, could you please share the code? I am also looking for something like this.

  2. Hi David,

    I am new to the ASpMap. I also wanted to develop a javascript client to aspmap as server side technology. can you help me in developing that tool by providing some tips or can you share your code with me. I am also ready to share your work rather than your code.