Geomap and sharepoint services 3.0

115 views
Skip to first unread message

chanley

unread,
Aug 20, 2009, 11:13:53 AM8/20/09
to Google Visualization API
I placed a geomap into a content editor web part on our sharepoint
site with the following code: (pretty much straight from the examples)
<html>
<head>
<!-- required only for markers, and only when not specifying lat/
long values --> <script
src='http://maps.google.com/maps?file=api&v=2&key=xxxxx'
type='text/javascript'></script>
<script type='text/javascript' src='http://www.google.com/jsapi'></
script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages': ['geomap']});
google.setOnLoadCallback(drawMap);

function drawMap() {
var data = new google.visualization.DataTable();
data.addRows(11);
data.addColumn('string', 'City');
data.addColumn('number', 'Visits');
data.setValue(0, 0, 'Austin');
data.setValue(0, 1, 5);
data.setValue(1, 0, 'Chicago');
data.setValue(1, 1, 10);
data.setValue(2, 0, 'Houston');
data.setValue(2, 1, 3);
data.setValue(3, 0, 'Los Angeles');
data.setValue(3, 1, 17);
data.setValue(4, 0, 'Nashville');
data.setValue(4, 1, 4);
data.setValue(5, 0, 'New York');
data.setValue(5, 1, 26);
data.setValue(6, 0, 'Philadelphia');
data.setValue(6, 1, 8);
data.setValue(7, 0, 'San Antonio');
data.setValue(7, 1, 5);
data.setValue(8, 0, 'San Francisco');
data.setValue(8, 1, 6);
data.setValue(9, 0, 'Washington D.C');
data.setValue(9, 1, 14);
data.setValue(10, 0, 'Toronto, Ontario');
data.setValue(10, 1, 11);


var options = {};
options['region'] = 'US';
options['colors'] = [0xFF8747, 0xFFB581, 0xc06000]; //orange
colors



options['dataMode'] = 'markers';

var container = document.getElementById('map_canvas');
var geomap = new google.visualization.GeoMap(container);
geomap.draw(data, options);
};

</script>
</head>

<body>
<div id='map_canvas' align='center'></div>
</body>

</html>

I was hoping to get some help on how to figure out the best way to get
it to read the data from a sharepoint list? Has anyone done anything
like this? I am new to this and am working my way through it. Any
suggestions would be greatly appreciated!

ChartMan

unread,
Aug 24, 2009, 4:34:16 AM8/24/09
to google-visua...@googlegroups.com
What is a share point list ?

ChartMan

chanley

unread,
Aug 24, 2009, 10:13:46 AM8/24/09
to Google Visualization API
Sharepoint is collaboration platform produced by Microsoft. It can be
used as an intranet/extranet. From a code perspective, this link
probably describes the idea of what I am trying to do much better than
I could.
http://weblogs.asp.net/jan/archive/2009/05/06/querying-sharepoint-list-items-using-jquery.aspx

I can retrieve the values from the list using that example, but I need
some help formatting the results into a dataset that the geomap
visualization can use.

Is there another group that might be better for this type of question?

ChartMan

unread,
Aug 24, 2009, 10:49:18 AM8/24/09
to google-visua...@googlegroups.com
So there is no support in this api for a share point list. However, it is straight forward to traverse a data structure and create the table object the geomap is expecting. 
What kind of problem are you facing ?

ChartMan

chanley

unread,
Aug 24, 2009, 11:00:47 AM8/24/09
to Google Visualization API
I am trying to figure out the best way to get the "list" data,
(similar to a table), into a format that the geomap code can read. I
am new to this and was hoping to find someone who may have done
something similar.

I don't know how to traverse the data and create the table. Could you
recommend any resources?

Albert

unread,
Aug 28, 2009, 10:30:56 AM8/28/09
to google-visua...@googlegroups.com
Best way is to format the data with jquery into json format.

You can get more information abotu the data formats the library could get here


Hope it helps you.

ChartMan

unread,
Aug 29, 2009, 8:25:06 AM8/29/09
to google-visua...@googlegroups.com
Can you please provide a concrete example of your input "list" ?

Thanks

ChartMan

Kate

unread,
Sep 10, 2012, 10:16:12 PM9/10/12
to google-visua...@googlegroups.com
Chanley, did you know how to make it work that way. I want the same but I have no idea as I don't know about writing script :D
Do you have any suggestions for making this idea possible on SharePoint site?
Reply all
Reply to author
Forward
0 new messages