Steven JW Kennedy

My Blog

Plotting SharePoint List Data on a Google Map – Part 1

Posted by Steven Kennedy on April 11, 2011


At the beginning of March I attended a Google Technology User Group meeting where the presentation was about the use of Google Maps and Fusion Tables. I have a short post Fusion Tables and Google Maps about the meeting and a quick example that I cobbled together.

The use of Fusion Tables got me thinking about something that I’d played with a year or so ago. Using a SharePoint List to provide data to a Google Map. I did some work at the time to see if I could make this happen, borrowing greatly from the Internet as I’m not a JavaScript developer. I had some limited success but then as they say ‘stuff happened’ and I wasn’t able to pursue it. The meeting on Fusion Tables got be thinking about it again so off I went to the Internet to see what’s out their. This time for SharePoint 2010.

I came across a good posting called Plotting Your SharePoint 2010 List Data on a Google Map by Kyle Schaeffer. This posting gives pretty good instructions on who to use the Google Maps v2 API and jQuery to generate markers on a Google Map based on SharePoint List data.

However, I did run in to a number of issues in trying to follow Kyle’s instructions, based mainly I believe on the fact that he’s writing for experienced developers, which I’m not.

So, a few of the things that I ran in to;

  • SharePoint List Data – In Kyle’s example the address data is held in a multi-line field. In mine it wasn’t. Kyle explains how to reference the data from his example but not for a general case. I had to work that out. He also talks about how to change the class name but again doesn’t say how. I still haven’t figured this bit out.
  • Google Map in relation to the SharePoint List data. I found out the hard way, a couple of hours of it not working, that you need to ensure that you’re SharePoint List appears on the page ABOVE the Google Map
  • GeoCoder – this is the function of taking an address and getting the corresponding Latitude/Longitude that can be used by Google Maps. What isn’t mentioned in Kyle’s post is that there are limits to the number of Geocodes you can do per day, and the speed at which it’ll respond. There’s also no error checking. I found this out the hard way when I tried to plot just under 200 points. Not all of them where being displayed. It turned out to be a combination of inaccurate addresses and the speed at which I was calling the geocode function. I did try putting in a time delay but that didn’t seem to help.

So what did I take away from Kyle’s post. Well the two most important elements to making it work, that of making the SharePoint List available and most importantly how to cycle through each entry in the list in order to obtain the relevant data to put a marker on the map.

In Plotting SharePoint List Data on a Google Map – Part 2 I’ll start to detail how I took Kyle’s instructions as a basis for producing a Google Map with clickable custom markers based on data from a SharePoint List.

The picture below depicts what I ended up with in Plotting SharePoint List Data on a Google Map – A series of company sites with custom icons used to indicate the number of employees on site. The icons are clickable and display the address information, number of employees at the site as well as a link to step zoom to the location. The location depicted below is an old address of mine when I lived in Los Angeles many years ago.

image

About these ads

One Response to “Plotting SharePoint List Data on a Google Map – Part 1”

  1. [...] Plotting SharePoint List Data on a Google Map – Part 1 [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: