A maps view is used to display records from your database on a map.
Knack uses HERE Maps to display maps and geocode Address field values. You can also use Google as your provider by adding your own API key. This setting can be found on the App Settings > Map Provider page. To learn more about using HERE maps, Google maps, and the differences between them, see our article App Settings: Map Provider.
- The map view is currently only available on the Pro plan and above.
- Maps can only display objects that have an Address field. This address field will be geolocated and will determine which records the map will display.
- When using the latitude/longitude coordinates option for an address field, that location will display as the nearest street address on a map view, rather than the exact coordinates.
- Map views will automatically generate direction links that, when clicked, will open a new window for Google Maps where the user can get directions.
- Address fields used in Map views where the “Address Autocomplete” functionality is enabled will allow this autocomplete functionality in the search input.
What do maps look like in the Live App?
Maps display multiple records from one of the objects in your database in a graphical HERE map:
On the search results display, a “reset” link will appear. Clicking this will reset all search criteria to easily search again with new criteria.
You can also choose to use Google maps by entering your own API key. See the section above for more details on this. Google maps look like this:
You can add a map to display records on any page by selecting the Map option from the top of the page:
Select the object you want to display records from, and click the "Add map" button:
Note: only objects that have at least one Address field will give you the option to display records in a map.
Select any additional links to view or edit each table record in a new page and then click the "Add view" button:
You can add links to edit each record with a form or view more details about each record.
You'll also have options to display any connected records if the calendar object has any connections to other records.
New maps will use the first address field to display records in the map, as well as the first short text field as a label when displaying address details.
Click directly on a map in your pages to edit it:
The map will open in "edit" mode where you can use the menu on the left to edit different aspects of the map.
The Data Source section is used to control the records the calendar will display. A filter icon to the right of the Data Source title indicates if filters to restrict the data being displayed on your view have been applied:
Data: the table will display all the object's records by default. Use the data section to add rules to limit which records will be displayed,
Sort: control the default sort order of which records will be displayed first.
Limit: show all the available records or limit to a specific number.
Note: Currently map views can only show 1000 records at a time.
The Map Settings section is used to control how the map works with your object to display addresses:
Title & Description: optional copy you can display above the map to add any necessary instructions or explanation.
Address Field: select a field that the map will use as the address to place each location on the map. This field must be the Address type.
Title Field: select a field the map will use to display for an address point. Choose a title, name, or other field that can easily identify the whole record.
Map Size: the dimensions of the map in pixels. Use these to control how big you want the map to be.
List Width: the width of the list that displays to the right of the map and contains the record details (see below). If the map and list width combined won't fit on the screen, then the list will bump below the map and be the same width as the map.
Units: select which unit of measuring distance will be used on the map: Miles or Kilometers.
Starting Range: the distance of the range to search by based on the selected unit (above). A record address must be within this distance of the searched address.
Starting Point: Blank, Specific Address, or User's Current Location. If Blank, then no records will show until the user initiates a search. If an address is provided then the map will start with records closest to that address. When using the User's Current Location, the browser will ask the user's permission to locate them and use that location.
Pagination: pagination determines how many records will show at one time. If the total number of records exceeds the pagination number, then links will be added to the table to navigate all the pages. Options here include:
- Set how many records to show at a time
- Let the user set how many records to view per page
- Show pagination controls at bottom of view
Pin Colors: add custom rules to display different pin colors based on criteria you define.
Record Filters: filters give the user tools to further refine which records the calendar will show. You can add filters as options for the user to add, or as a menu.
User Filters: enabling user filters presents options for a user to add any filters they'd like to the map. This will then display an "add filter" link above the map. The map will update as soon as a filter is added. Multiple filters can be added as needed.
You can determine if the fields available to filter are limited to the map details or all the object's fields. You can add preset filters that will initially filter the records.
Filter Menu: enabling a filter menu will present links above the map the user can click that will filter the records based on the rules you create.
The List Details section controls the list that displays to the right of the map with additional details about each record:
This follows the same model as the Details view.
Searching a Map
Knack uses HERE Maps to display maps and geocode Address field values.
HERE Maps supports the below searches:
- street address + city
- street address + state
- street address + city + state
- city + state
- state (resolves to the state capital)
Unsupported searches include:
- street address only
- city only
- ZIP code only
- county only
Note: In Knack we calculate the shortest distance between two points based on their longitude and latitude coordinates. However when viewing maps such as HERE maps or Google maps outside of Knack they calculate the shortest "route" or mileage between the two locations accounting for driving between two points.
There are several How-To Guides that involve using map views and our location features for capturing and displaying records: