Toggle menu

Find My Nearest

The Find My Nearest template displays geospatial data on a map. Users can search for a postcode and property or browse an area to return nearby results.

The template displays data and layers set up using the Geospatial Data Manager. It operates in two "modes" controlled by the template's article extras.

Default Mode
 

Page Title and Content

An article using the Find My Nearest template displays its title, introductory and body text, and related content in the same way as the Default template.

Default Mode

In this mode users search for a property using its postcode and set a radius for their search. The results can include information about the property itself, and data from layers within the chosen radius. Results can be viewed in a list or on a map.

Postcode Search

The postcode search uses the default postcode provider of the platform's Postcode Worker. You need to enter a full valid postcode.

Postcode Search
 

Pick an address from the list to load results. You can change location by performing another search. 

Property Information

The first section of the results displays information about the chosen property. In the screenshot at the top of this page, the Find My Nearest article has been set up to show bin collection information. For data to appear here it must be created as a "Property" layer in the Geospatial Data Manager, and that layer must be selected in the Find My Nearest article extras. If there are no property layers, this section is hidden.

Multiple property layers can be shown and users can toggle layers on and off using the "Refine your results" controls.

List Results

In this view spatial results are displayed in a series of panels.

List Result
 

Each panel contains results from a different data layer (ie one panel for hospitals, one panel for streetlights etc). As with the property information, these layers must be set up in the data manager and selected in the article extras.

The title of each panel is taken from the description of the data layer. The three results nearest to the address are displayed as a series of cards. The content of these cards is built by a Handlebars template configured in the data layer manager.

Each card also contains a link to "View on map" which will open the map view centred on the chosen result.

Map Results

The map view displays the results of the list on a map. This means there will be a maximum of three results per layer.

Map Results
 

Results from the list are plotted on the map as points, polygons or lines. The layer configuration determines whether polygons and lines should lie entirely within the search radius, or just intersect it, to appear. For example, this search shows national parks within one mile of the GOSS Interactive offices. Because Dartmoor intersects the one mile radius, the whole park is shown.

Dartmoor
 

As the zoom level of the map changes, markers are clustered or shown individually. This behaviour is map provider specific and can't be changed within the Find My Nearest product.

Each marker on the map displays a pop-up when clicked. These pop-ups contain the same information as the card views in the list of results and are built using the same Handlebars templates.

Derriford
 

The colours of the map markers are set in the configuration of that data layer.

Refining Your Results

You can refine your results in either the list or map view, the changes made in one view are reflected in the other. To hide or show data layers, tick or clear the appropriate box in the "Refine your results" control panel.

In the article extras the "All layers selected by default" checkbox controls the default behaviour when a search is first performed. If the box is unchecked no results are displayed and in List view the "No layers selected" text is displayed until the user starts to choose the layers they'd like to see.

Layers can be grouped using the controls in the article extras. The title of the options panel can also be set. For example, this article has been set up to show NHS and Environment data:

Options Panel
 

In the article extras the title of the panel and the titles of the two groups have been set. Available layers are listed in the left hand column.

Options Extras
 

To add a new group press "Add group". Enter a name and drag layers into the new column. You can change which group a layer appears in, or change the ordering of layers, by dragging the layer to a new position. To remove a layer, drag it back into the "Available" column.

Browse Mode

In browse mode the map is loaded before you perform a search. The map uses the centre point and default zoom level, and will display data from the selected layers, all set in the article extras.

Browse Mode
 

As you move around the map you'll be prompted to "Search this area". This performs a new search, loading results inside the current map container and removing the results of the previous search.

Not all data layers are available at every zoom level. As you zoom in and out certain layers will be disabled, which prevents them from returning in search results. This is designed to limit the data requested in a search. For example, loading streetlight locations when viewing the whole of the UK would not be appropriate, but loading national parks could be. The minimum and maximum zoom levels that layers are available at are set in the layer configuration.

Browse mode also includes a postcode search. The search itself works in a similar way to the Default mode, however when an address is selected, it becomes the centre of the map container, which resets the map to the default zoom level and performs a search for the configured layers as appropriate.

Browse mode will not show property layers, even if they are selected in the article extras.

Map Providers

Find My Nearest supports two map providers, Google Maps and Open Street Maps. You can pick the provider you'd like to use in the article extras of your Find My Nearest page. Open Street Map is freely available, Google Maps requires you to have an appropriate API key set in your subsite configuration.

Article Extras

Field NameTypeDescription
LAYERSCHECKEDBYDEFAULTCheckboxCheck this box to have all configured layers load with the search results
SPATIALLAYERSTITLETEXTText InputThe title of the spatial layers "Refine your results" panel
SPATIALLAYERSNOSELECTIONTEXTText InputThe text to display in List View if no layers are selected
SPATIALLAYERVIEWHTMLCreate groups and choose the layers that go in them. Layers are configured in the Geospatial Data Manager and will automatically appear as options here as they are created
PROPERTYLAYERSTITLETEXTText InputThe title of the property layers "Refine your results" panel
PROPERTYLAYERSNOSELECTIONTEXTtext InputThe text to display in List View if no layers are selected
PROPERTYLAYERVIEWHTMLCreate groups and choose the layers that go in them. Layers are configured in the Geospatial Data Manager and will automatically appear as options here as they are created
MAPBROWSEMODECheckboxCheck this box to enable Browse mode
MAPCENTRELocation PickerIf you've enabled Browse mode, use this location picker to set the default map centre point (in Default mode the centre point is set by the user's postcode search)
MAPPROVIDERDrop-down ListPick the map provider you'd like to use, either Google or Leaflet (Open Street Map). If you pick Google you'll need to have the appropriate API keys set in your subsite configuration and may require billing to be set up
LEAFLETTILELAYERDrop-down ListIf you are using Leaflet, pick the base map you'd like to use. Either Default or CartoDB Voyager (for non-commercial use)
LEAFLETDEFAULTZOOMNumber InputThe default Leaflet zoom level
GOOGLEDEFAULTZOOMNumber InputThe default Google zoom level
Last modified on 20 January 2022

Share this page

Facebook icon Twitter icon email icon

Print

print icon