More on Virtual Earth and PPS
Posted by Alan on June 9, 2008
Over the last few months we have been building some demo scenarios of PerformancePoint Server for Microsoft Canada. These are to help highlight to Microsoft employees how PerformancePoint can be used in different industries. In order to do this we developed a series of high-level models and dashboards that were industry specific. One of the things we did were some integrations of Virtual Earth maps with PPS. Basically linking maps to different Scorecards. We just didn’t use generic maps but we populated them with custom pushpin icons and line of business data. Everyone really liked what they saw, so I thought I would provide detailed information on how to do accomplish this. This is long, so to save space on the main page, follow the link at the bottom of this post for the rest of the instructions and screen shots and sample code.
Before we start there are some things you need to remember!
- Virtual Earth is not free to use in a commercial environment. It does carry a cost. There is a minimum yearly payment that translates to roughly about $0.02 per use. However there are different pricing variables (as there always are with Microsoft licensing) including what counts as a use. So you have to contact your Microsoft rep for specific pricing information. I did get verification that you can use it free in a demonstration/mock-up environment however.
- The integration of Virtual Earth and PPS is not out-of-the-box functionality. And unfortunately PPS does not actually create Virtual Earth maps for you. We are talking custom code her people!
- To do this correctly you will need to have HTML/ASPX and XML skills and be able to take data from your data source and put it into the correct XML file format for Virtual Earth to consume. In a mock-up or demo situation you can probably hack away and get this to work but for production be prepared to rely upon developer type skill sets.
- The on-line SDK for Virtual Earth is good, but as I learned through trial and errors, sometimes the sample code it generates for you is a little “off”. These little errors ended up costing me many hours of work. That being said, I am not a programmer by trade and my development skills are questionable at best. A true developer might have caught these right off the bat.
- The 3D mode of Virtual Earth does not work inside a Virtual PC or Virtual Server environment (i.e., you are running the map from the browser inside the image). This is because the simulated graphics card of VPC/VS does not support hardware acceleration which is required for 3D in Virtual Earth. To view maps in 3D you will have to hit the image from a normal desktop machine to test. As above, this one little item alone cost me a couple hours of work before I figured it out.
- Believe it or not, one of my most daunting tasks was actually trying to find the right type of icons for my map to give it the look and feel that I wanted. There are not that many free icons out there that are relevant and look good. The ones I chose are fine for now as they allow non-commercial use, but to put this into production I would have to either buy them or find different ones. For this reason, I have not included them in my post.
- When creating maps of this type, remember that Virtual Earth does not use physical addresses to determine locations but longitude and latitude. To do this in a production environment you will either need to manually look up each location’s longitude and latitude or utilize a service that converts street addresses for you. Do a web search for “geocode” and you will find different free and pay services that can do this conversion for you.
So what do you need to do to make this work? Here is a summary of the steps involved:
- Create a folder within IIS to host the map file.
- Create your Virtual Earth map (HTML or ASPX file).
- Create your Virtual Earth GeoRSS data source or sources (XML file).
- Test your map to make sure it presents the data you want.
- Within the Dashboard Designer create a new report and select the type “Web Page” and add your map URL.
- Associate this report with a Scorcard and pull it into SharePoint using the PerformancePoint Web Parts.
I am going to walk through steps #1 to #4 above. I will assume that you know enough about the Dashboard Designer to handle steps #5 and #6. The example I will use will display sales related information. Here we go:
Step #1: Create the directory structure and IIS website:
- If you don’t know how to do this or this confuses you, then you should probably stop reading now. This is the easiest step of #1 to #4. Using Windows Explorer, navigate to “\\InetPub\wwwroot\” and create a folder called “VirtualEarthMaps”. Underneath that create a sub-folder called “VEMaps” and within it create 2 additional sub-folders called “Sales” and “Icons”. In actuality you can put this directory anywhere you please and call it whatever you like, just make sure to adjust all the following steps for your deployment.
- Open Internet Information Services Manager and click on “Web Sites” and right-mouse click and select “New -> Web Site”.
- Follow the wizard to walk you though the process. I called my web site “Virtual Earth Maps” and chose TCP port “99” to run the website on. Finally for the path chose the folder (e.g., VirtualEarthMaps) you created above.
Step #2: Create your Virtual Earth Map
This was part of the big learning curve for me. I utilized a lot of cut and paste from the interactive SDK, postings in various forums and from other code samples I found on the web. A lot of people helped me out with this, whether they realize it or not.
- Attached is a file entitled “VE_Sales_Data_Map.doc”. Download this file and change the extension from .doc to .html (WordPress does not allow the uploading of .html or .txt files directly). Open it with Notepad. When ready to use, copy it to your “Sales” folder we discussed earlier. . Virtual Earth Sales Data Map Example
- Not included in this post are the icon filed for use as pushpins on the map. They go in the “Icons” folder. You can use a ton of different file formats and you can experiment with the size to find one that is right for you.
- The following are screen shots of the above mentioned code. In each of the images I have made notations about various lines of code that I think are important to note. Look at the screenshots and play with the sample file I have provided.
Step #3: Create your XML Data Source File (s)
The data source is what is known as a GeoRSS file. Basically it is an RSS feed in an XML document that provides geographic information for Virtual Earth to read. The information in this file is displayed on the map as one of the layers. In a real life deployment you will need development skills to take data out of your host system and put it into the correct XML file in the correct format.
- Attached is a file entitled “VE_Customer_Sales_Data.doc”. Download this file and change the extension from .doc to .XML (WordPress does not allow the uploading of .XML files directly). Open it with Notepad. When ready to use, copy it to your “Sales” folder we discussed earlier. Virtual Earth Customer Sales Data Example
- In order for the sample map I have provide to work, you also need a file called “VE_Store_Sales_Data.xml” to be in the “Sales” folder. This way you can show both Customer Purchases and Store Sales on the same map. If you don’t want to do that you can adjust the map file to remove those references. This file would be structured identically to the “VE_Customer_Sales_Data.xml” file mentioned above but with different data.
- The following is a screen shot of the above mentioned code. In the image I have made notations about various lines of code that I think are important to note. Look at the screenshot and play with the sample file I have provided.
Step #4: Test Your Map
And now for the moment of truth. Go ahead and browse to “http://SERVERNAME:PORTNUMBER/VEMaps/Sales/VE_Sales_Data_Map.html” and what you should see something that looks like the screenshot I below:
After this you would work with this map as a Web Page report type within PerformancePoint Server and do with it whatever you wish.
I hope this helps those of you trying to work with Virtual Earth and PerformancePoint. It is not easy but if you can get it working the results are spectacular! Good luck with it.