Visually represent the output from the Distance Finder API, in order to show customers where their nearest stores are.
Please note that we are unable to serve map data for China.
The Map Tile API takes an input of your Loqate key and returns a Signed URL, which is valid for one hour and can be used to provide secure access our tile server. Whilst the Signed URL is active you can make as many requests using that URL as needed.
Our tile server provides access to basemap data, tiles and styling for a map. This can then be used with a map rendering library, such as MapLibre or Leaflet, to add an interactive map to your application.
Other functionality required for your map, such as pins for locations, can then be added afterwards via the map renderer.
There are several key concepts that are important to understand when implementing a map using this API:
Signed URLs can be used to request individual map tiles if required, however for more complex applications you're likely to use a map renderer.
The following diagram represents how an application could be designed to work with our API and a map renderer:
Here are the steps this flow takes:
This method will consume credit each time a signed URL is generated.
https://api.addressy.com/LocationServices/Mapping/GetUrl/v1.00/
Note: we don't support API connections using HTTP - all calls should use HTTPS.
https://api.addressy.com/LocationServices/Mapping/GetUrl/v1.00/json4.ws?
Note: A REST endpoint with a JSON payload is the only call style supported.
Each request to the web service requires a number of parameters, all of which are listed below. All requests require a key which can be generated in your account.
Note: where potentially sensitive data is used in these parameters, remember to make the request as secure as possible (see the API Security page for more information).
* = required field
Name | Type | Example values | Description |
---|---|---|---|
Key* | String | AA11-AA11-AA11-AA11 | The Loqate key used to authenticate with the service. |
The response from the web service is a table with the specification below. Where no items are found, the response will be empty (although all endpoints specify the columns). If an error occurs, the response will not follow this format. Instead the response will be an error table.
Name | Type | Example values | Description |
---|---|---|---|
RasterStyleURL | String | https://tiles.loqate.com/styles/OSMOpenMapTiles.json?URLPrefix=aHR0cHM6Ly90aWxlcy5sb3FhdGUuY29t&Expires=1695818398&KeyName=tileserver-key&Signature=_71Ql0cQ9cZWEL_DceW6ipRwSpk= | Signed URL to use when when wanting to render Raster tiles, valid for one hour after creation. This will give you no flexibility over styling options and can be slower to load but is generally less demanding on end user hardware. |
VectorStyleURL | String | https://tiles.loqate.com/styles/OSM%20OpenMapTiles/style.json?URLPrefix=aHR0cHM6Ly90aWxlcy1ucHJvZC5sb3FhdGUuY29t&Expires=1696057811&KeyName=tileserver-key&Signature=eX5W6ZQzZEqVtZz70jJKzQ9LPW0= | Signed URL to use when wanting to render Vector tiles, valid for one hour after creation. This URL contains all the information required by a map renderer to draw the layers of data for the final map. Vector tiles offer more flexibility with styling and improved performance when navigating the map but they can be more demanding on end user hardware. |
GeneratedOnUtc | Datetime | 2023-09-27T12:39:58.3341192Z | UTC Timestamp representing when the URLs were signed and generated. |
Below are the errors which are specific to this web service. If an error occurs, an error table like the one below will be returned. To check for an error response, test for a 4-column table with columns "Error", "Description", "Cause" and "Resolution" containing a single row.
For a list of errors applicable to all APIs, have a look at the list of common errors.
Number | Description | Cause | Resolution |
---|---|---|---|
1000 | InternalServerError | Something unexpected has happened on the server | Please contact support and quote the error number and this API endpoint |
1001 | InternalServerError | Something unexpected has happened on the server | Please contact support and quote the error number and this API endpoint |
1002 | InternalServerError | Something unexpected has happened on the server | Please contact support and quote the error number and this API endpoint |
The example below shows a request to the API and the corresponding response.
GET https://api.addressy.com/LocationServices/Mapping/GetUrl/v1.00/json4.ws?&key=AA11-AA11-AA11-AA11
Content-Type: application/json
{
"VectorStyleUrl": "https://tiles.loqate.com/styles/OSM OpenMapTiles/style.json?URLPrefix=aHR0cHM6Ly90aWxlcy5sb3FhdGUuY29t&Expires=1695818398&KeyName=tileserver-key&Signature=_71Ql0cQ9cZWEL_DceW6ipRwSpk=",
"RasterStyleUrl": "https://tiles.loqate.com/styles/OSM OpenMapTiles.json?URLPrefix=aHR0cHM6Ly90aWxlcy5sb3FhdGUuY29t&Expires=1695818398&KeyName=tileserver-key&Signature=_71Ql0cQ9cZWEL_DceW6ipRwSpk=",
"GeneratedOnUtc": "2023-09-27T12:39:58.3341192Z"
}
You must ensure attribution is visible when rendering a map as part of your application. Loqate uses map styling from OpenMapTiles and open data from OpenStreetMaps.
Attribution is provided by default as part of the map style configuration, however if you choose to create your own map styling you must still ensure that this attribution is visible. For further information on copyright notices please see the Loqate Terms and Conditions.