SharePoint – Add Google Maps to your pages


Hello everyone. Some days ago I discovered that you can use Google Maps to visualize contact or address information on a map. Since I thought that this is pretty cool I wanted to share this information with you.

The first thing you need to do is to create a Document Library to store the Javascript file which will add Google Maps to your page. I called my Document Library “Script”. You can download the Google Maps Javascript file from here.

Before I uploaded the script I changed the following variables:

var useCoordinates = false;
var hideMapUntilClick = false;

I set those variables to false since I wanted to use address information instead of coordinates and I wanted the map to open up by default without having to enable it manually.

Now create a Contacts List. It has already all fields we need to test our Google Maps Script. I called my Contacts List “Addresses”.

sharepoint_create_contacts_list

Next step: Now add your Contacts List and a Content Editor Webpart to your SharePoint page.

sharepoint_add_webparts_googlemaps

Now you need to edit your Contacts List and choose the setting Show Toolbar. This is a necessary step for the Google Maps Javascript to make it work correctly.

sharepoint_contacts_list_show_toolbar

Now edit your Content Editor Webpart and add the Url of your Google Maps Javascript into the textbox.

sharepoint_add_link_content_editor_googlemaps_script

Now your SharePoint page will look like this: (Don´t worry, the map will load after you have at least created one entry in your Contacts List.)

sharepoint_googlemaps_webparts_ready

Now we will create our first entry. You need to fill out the following fields to make it work:

  • Address
  • City
  • State/Province
  • ZIP/Postal Code
  • Country/Region

I added the address of the Stephansdom (a famous building in Austria) and the Statue of Liberty in the USA to test the Script.

sharepoint_contacts_list_add_address

Now Google Maps will show on your SharePoint page and mark your entries on the map.

sharepoint_googlemaps_finished

That´s it. Pretty simple and cool, right? (By the way: You can download the Script I used for my example from here.)

Important note: I did not create this script. I just discovered it and wanted to share it. Please give the guy who created this script some credit for his awesome work. (For more information about this topic have a look at the sources.)

Sources:

http://www.youtube.com/watch?v=fVmsAFqqo5g

http://spgooglemapswpforspl.codeplex.com/

Advertisements
Tagged ,

One thought on “SharePoint – Add Google Maps to your pages

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

%d bloggers like this: