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 :
- Include the following code :
ClientContext context = new ClientContext(“https//server/site”);
Web web = context.Web;
var newField = web.Fields.AddFieldAsXml(“<Field Type=’Geolocation’ DisplayName=’Map GeoLocation’/>”, false, AddFieldOptions.DefaultValue);
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…