(submitted by Jonathan Fisk, GIS Solutions Engineer, ESRI Charlotte)
Part of my job is to discover Web based content and services, mash them up, and then show these to others. Many of them don’t realize how easy these are to mashup in this Web 2.0 world. ArcGIS Explorer is a great platform for doing these kinds of things, and I have assembled collections of real time feeds, map views of organizational resources and emergency plans, and tasks that answer timely and relevant questions using Explorer. And sharing is as easy as exporting a result or saving a map.
I’ve recently discovered that ArcGIS Explorer’s result popups can bring more than just an HTML page to life on your map. Below is an example where I call Microsoft Virtual Earth’s API from the popup window when I click on the map to create a yellow map note. The popup window displays the Bird’s Eye view of the location.
Why does this excite me? Well, just like the next person, I love to see my house in high resolution from 4 directions (that’s not my house above!). But this content can also be used to visually add to more practical applications, and can be combined with other content and tasks in ArcGIS Explorer. By authoring this as a custom task I can create results that can be shared with others or included as part of my map, and I can also enable others to use the Bird’s Eye view popup easily. Here’s what my task UI looks like currently – just click on the map to create a VE result, then click the result to open its popup window to see the Bird’s Eye view.
The first time I tried this I used the brute force method – I went to Microsoft’s Virtual Earth API documentation and tried to make their example Birds Eye view of the Seattle Space Needle pop up in a browser.
Next, I created a note result using the Create Note task and then pasted the Virtual Earth API sample into the result popup content, which I accessed via the result property sheet. This consisted of HTML and JavaScript that would run when the popup was opened. The neat thing is it worked! But each time I wanted to do this I would have to create a new map note, paste the JavaScript code into the result popup content, and then manually replace the latitude and longitude values with new coordinates. This was tedious, and the natural solution was to make it a custom task that would automate the whole process.
So I set out to create my very first custom task. Fortunately there is a nice collection of samples included in the ArcGIS Explorer SDK, and one of them did almost exactly what I wanted my task to do. I jump-started my effort using a sample called TrackShapesCS. This sample creates a new map note when the user clicks the map, and automatically populates the popup content window with its latitude and longitude. All I had to do was tweak the custom task in Visual Studio to append my working VE JavaScript sample, and then insert the new coordinates where the Virtual Earth API expects them. I was relieved to find that this was easy, and worked without major surgery to the sample task.
Here’s what the code looks like in the popup window properties for an already placed VE result. The lat/long coordinates of for VELatLong() are always obtained from where you click the mouse:

I now have a custom task that I use quite frequently to spruce up a map with Virtual Earth content. And best of all my map content rides along with the NMF document and I can e-mail or post it for others to use.
I have shared my custom task on ArcScripts – Enjoy!
