The problem with this field is it is little complicated to set its value. Out of the box it allows you to specify its value by using your current location or by manually setting longitude and latitude, probably something you don't know. So to enable users to specify the location in a more friendly way you had to create a custom field that extends the geolocation field. This is not an option in SharePoint Online.
For start I will create a list for my geolocation field. It is a simple list with a Title, Description and a geolocation field I called Location. The list will be called "Wonders of the World", so you can probably guess what it will contain. If you need help for adding a geolocation field to the list be sure to check my Adding geolocation field to SharePoint Online post.
If you try to add a new item to this list you will get a form that looks like this:
So open your SP Online site in your SP Designer, navigate to Lists and Libraries and select the list with your location field. Now we will create a custom NewForm (in this post I will show you this customization on a NewForm , but this also applies on the EditForm).
At the Forms section in Designer select New and in the new list form wizard select New item form as a type of a form to create and check the box to set it as a default form.
Now when you go back to your list and try to add an item, your form will look like this:
We will need to find the id's for this input elements. You can do this by using Developer Tools in Internet Explorer, press F12 to start the developer tools and use the DOM explorer to examine those input elements, they will look something like this:
So once you locate the input elements write down their id values, we are going to need them later.
Now let's get back to our SharePoint Designer and in it examine our new CustomNewForm. Search in it for you location field, you should find it in a row that looks like this:
Under this row we will insert our own HTML code that we will need in our custom search for locations. So insert :
Save the change and look at your form from SharePoint, it should look like this
Save the page and you are ready to test it, go back to your list and start creating a new item. Enter a search term for your location and press the search button we created. If everything is OK you will get something like this:
You get a representation of your location on a Bing map and the longitude and latitude fields for your geolocation field are set, so when you save your item you will also save the location you see. Also the you can drag the pushpin (the DragHandler function in the script) so you can simply adjust the position.
I won't go into details of my code as it is pretty straightforward, but if there are any questions feel free to contact me.