Thursday, August 29, 2013

Enable GeoLocation in SharePoint 2013

Keywords: GeoLocation, Bing Maps, Map view, SharePoint 2013

GeoLocation is a new functionality in SharePoint 2013 that makes it possible to add a users physical coordinates to a SharePoint list. Let’s assume that you have a contact list and want to show your customers location on a map. With GeoLocation you can achieve this easily.

GeoLocation need to be enabled in SharePoint and is not there OOTB. To enable it you need first to browse to and obtain a trial key for 90 days! For commercial use you must obtain a key and pay the fee!


Sign in using your LiveID and obtain a valid Key. The key will be something like this:


Using SharePoint Management shell run the following line of PowerShell script:

Set-SPBingMapsKey –BingKey PutYourBingKeyHere

When done, you need to create a Site Column that can be used in a list. To do that, copy these lines into a file and call it CreateGeoLocation.ps1

$fieldXml = "<Field Type = 'Geolocation' DisplayName='Geo Location' Name='geolocation' Group='custom fields'/>"
#get spweb object
$web = Get-SPWeb "PutYourSite"

Run CreateGeoLocation.ps1 and make sure that the script run correctly without any error messages!

This will create a site Column under custom fields. See below:


Using GeoLocation

To use GeoLocation you need to add a contact list app!

When the app is added, from List setting choose to add a column from existing site columns!


When done, add a new post to the contact list as below:


At the bottom of the page you will find two links, one is called specify your location and the other is Use my location! If you use the former one you need to browse to Bing map and find the latitude and longitude of your location:


Latitude for Stockholm, Sweden: 59.332329
Longitude for Stockholm, Sweden: 18.062929

Add those value to your GeoLocation field as below:


Then you are done! If you want to use latter alternative (Use my location) you need to enable “let apps use my location” beneath the “privacy” option! 


Create a Map View

To create a map view, create a new view of the list and choose map view. Choose only desired field and save the view. The view will be something like this:




/Henrik A. Halmstrand

1 comment:

Abid Ali said...

I am trying to run the Set-SPBingMapsKey –BingKey with key but its giving me error
Set-SPBingMapsKey : The term 'Set-SPBingMapsKey' is not recognized as the name of a cmdlet,