Unfortunately, the new “Geolocation” column in SP2013 doesn’t come ‘turned on’ by default.
I was able to easily add it as a ‘site column’ – and then can add to any list.
- Open Visual Studio project
- Create a C# console app
- Add a reference to the following :
- Microsoft.SharePoint.Client
- Microsoft.SharePoint.Client.Runtime
- Include the following code :
ClientContext context = new ClientContext(“https//server/site”);
Web web = context.Web;
context.ExecuteQuery();
var newField = web.Fields.AddFieldAsXml(“<Field Type=’Geolocation’ DisplayName=’Map GeoLocation’/>”, false, AddFieldOptions.DefaultValue);
context.ExecuteQuery();
After executing the project, you should be able to go back to SharePoint – and do the following ;
Edit properties of a list, and click “add from existing site columns” :
And there it is :
That’s about it – too easy, eh !?
** The same code should work for Office 365 – I haven’t tried it yet though – will update soon…
Hi Chris!
It looks interesting, but what is the result, can You show screenshot please? What is this Geolocation Column in general and what is the profit of using it.
LikeLike