| OL Blog's profileThe Microsoft Office Liv...BlogLists | Help |
|
January 19 The Microsoft Office Live Contact Map sample codeThe Microsoft Office Live Contact Map sample codeThe Microsoft Office Live team has created some sample code to show off just one way that you can use Microsoft Office Live Web services to create a mashup that extends the functionality of an Office Live business application. The first one we’re releasing is called Microsoft Office Live Contact Map. This mashup takes advantage of the Microsoft Virtual Earth platform, which is a next generation mapping and location service. Once you know how to combine the Virtual Earth mapping data with data from Office Live, the possibilities are endless. The Contact Map sample uses one of the business applications, Business Contact Manager, which is a light Customer Relations Manager tool. This application is available with any Office Live Premium or Office Live Essentials subscription. The Contact Map creates a map control that allows you to display the location of contacts from the Business Contact Manager Contacts list on a map provided by Virtual Earth. Look at the end resultThe best way to understand the functionality is to install it on an Office Live business application. The download is an executable file that includes everything you need, including a sample page containing a Web Part displaying the map, so that you can quickly see the results of the code. Here’s all you need to do to check it out. 1. To download the exe, go to the Microsoft Download Center. 2. Click the .exe file to install the Contact Map files to the following location: C:\Microsoft Office Live Developer Resources\Contact Map Sample 3. Upload the files to a document library in a business application. For example, you can put the files in the Business Documents library of Business Contact Manager. 4. In the documents library, click “samplepage.” This Sample Web page opens in the business application, with a Page Viewer Web Part displaying the Contact Map. The right side of this Web Part includes a check box for each of the contacts from Business Contact Manager that specify a business address. Select the check box beside each of the contacts that you want to appear on the map and a pushpin appears at that contact’s address. The Contact Map
How it worksThere are several functions in the maps JScript file that combine to make this mashup. Set up a map The getMap function initializes a Virtual Earth Map (VEMap) object. Get contacts to be added to the map The getContacts function uses the Microsoft Windows SharePoint Services version 3.0 Web service to get the list of contacts from the specified context. In this sample, the context is Office Live Business Contact Manager (WEBBCM). This is an important piece of code for you to examine. It is a reference you can use to model your own calls to the Windows SharePoint Services Web services hosted by Office Live. These services give you access to the lists in the various Office Live business applications, such as the Contacts list used in this example. You can read data from the list, insert, update and delete records, and much more. We’ve already done the work of putting JScript functions together to package up the SOAP requests you need to talk to Office Live Web services. You can use these same functions from the common JScript (olsharedlibv1.js) file to jump start your development work. Add and remove contacts on the map When the Contact Map page is first loaded, we retrieve the contacts that include address information by using Windows SharePoint Services Web services. We cache each contact as an object in the browser’s memory. When the addContactToMap function is called, we pass the address information from the contact object of the selected contact into the Virtual Earth API to add a pushpin on the map in the right location. We cache the Virtual Earth pushpin object into this contact object. When you cancel the selection of a contact, the removeContactFromWeb function simply calls back out to the Virtual Earth API and passes the object to remove the pushpin. Go to townThis is just a quick example of the type of services you can add to your client’s Office Live Premium or Office Live Essentials subscription. The Web services provided by Windows SharePoint Services and Virtual Earth combine to provide an impressive visual representation of the client’s data. The common JScript functions help you accomplish this with minimal effort. To learn more about the Web services offered by Windows SharePoint Services, download the Windows SharePoint Services 3.0 SDK. To learn more about which Windows SharePoint Services Web services are supported by Office Live, read the Office Live Developer’s Guide. To learn more about Microsoft Virtual Earth, read the Virtual Earth Interactive SDK. The Office Live Developer Platform team Comments (4)
OL Blog
has turned off comments on this page.
TrackbacksThe trackback URL for this entry is: http://officeliveblog.spaces.live.com/blog/cns!7A0018FE70A946FB!494.trak Weblogs that reference this entry
|
|
|