Geocoding
In this article
- Geocoding from an address
- Geocoding from the current position
- Saving information
- Manual position change
- Nearby search
Geocoding from an address
From the infowindow of a POS, the user can start geocoding by clicking on the icon then on the “Geocode” button. The component tries to locate the object from the existing address.
Three cases arise:
- The geocoding cannot find the address: the user is asked to correct the information
- The geocoding finds an address: the map is automatically positioned on the found address and the fields of the normalized address are filled
- Several addresses are found: they are displayed in a list of candidate addresses to let the user choose the one that suits him.
When a candidate address is chosen by the user, a marker is added to the map and the map is centered on that position. The values of the normalized address are then automatically filled in.
A text input allows the user to search for an address. If several addresses are candidates, they are displayed in a list to allow the user to choose the one that suits him.
The user can correct the position at any time by moving the marker on the map. A reverse geocoding then makes it possible to obtain the normalized address and thus to recover missing values (in this example, the street number is missing).
As before, once the address is chosen, the map is positioned at the coordinates of the address and the fields of the normalized address are filled.
Geocoding from the current position
Click on the icon to use the user’s current position (using GPS if from a mobile device) to find the address and automatically fill in the fields of the normalized address when they are available.
The current position of the user is represented by a small blue circle. The user can refine the location by moving the marker on the map.
Saving information
Depending on the rights he has on the Salesforce object and its fields, the user can choose to save the normalized address by checking the “Save the normalized address” box.
By clicking on the “Save” button the user validates the POS position. Geographic coordinates (latitude and longitude) are automatically taken into account. Only the choice to save the normalized address is left to the discretion of the user.
Once the information has been saved, the user can view the coordinates and the normalized address (in case it has been saved) by clicking on the “Location” menu.
Manual position change
When a user is in the layout page of a POS already located, the component uses the previously saved coordinates to center the map. It is possible to change the position of the POS by clicking on the “Geocoding” menu to display the interface and click on the “Correct” button.
In order to correct the position of the POS, the user can:
- Move the marker on the map. The normalized address information is then updated
- Manually enter an address as described previously
- Use his current position by clicking on the button
For each of these actions, the normalized address information is updated.
Nearby search
When a user is in the layout page of a POS and a current position is defined (either because the POS is already located, after an address search or by the user location), it is possible to search for POS from a specific distance. The user accesses the nearby search interface by clicking on the to display the interface.
The interface is composed of:
- An input for the search radius. A default value has been set.
- The distance unit shown as a list
- Two buttons: - Performs the search with the entered parameters - Cancels the search: empties the list of nearby items and removes them from the map
The result of neighbors search is displayed in a list and on the map. The user is informed of the number of elements in the neighborhood. A limit of the maximum number of elements to be returned in the result is set in the component.
The user can visualize and look for info on a neighbourg by clicking in a list or on the map. The user is informed of the number of elements in the neighbourhood. A limit of the maximum number of elements to be returned in the result is set in the component.
The only distance units supported by Salesforce are Kilometers (km) and Miles (mi).