SharePoint24x7 It's all about SharePoint.

2Sep/140

Tips n Tricks – Enabling Geolocation field in SharePoint 2013

Posted by Joy

SharePoint 2013 introduced a new site column with a new data type called Geolocation which enables us to store Latitude and Longitude information. This enables us to use Bing Maps API and visualize information in a map within SharePoint.

When I started looking at using this new geolocation site column all sources directed me to standard exercise of adding a site column into a list using list settings page.

It turns out to be really frustrating that I couldn’t see any geolocation site column to add.

Add site column

Finally I found a PowerShell commandlet which adds a geolocation to a list and I managed to add a geolocation to my list. Following PowerShell commandlets adds a geolocation site column to a list:

$web = Get-SPWeb "http://intranet.team.com"

$list = $web.Lists["Contacts"]

$list.Fields.AddFieldAsXml("<Field Type='Geolocation' DisplayName='Location'/>", $true, [Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)