Sorry, you need to enable JavaScript to visit this website.

Geofences Creator

Overview

The Geofences Creator is an application that will help you to create geofences using the TomTom Geofencing API.

This application allows you to easily create and edit fences that are stored in the Geofencing API service. It supports the following shape types:

  • circle
  • rectangle
  • corridor
  • polygon

 

Also, you can search for POI (Points of Interest) or geometry (that is handled by the Search API service) and receive its shape boundaries.

Prerequisites

  • Download the application from here: GitHub. Clone this repository with git or download the zip file.
  • API Key

    Create your API Key

    To create a new API Key you need to first register on the TomTom Developer Portal. Once you are logged in, there are only two steps to take:

    1. Create a new application in your Dashboard:

    2. Choose all the APIs:

    All set up. You can now click on your newly created app and copy your API Key:

  • Admin Key

    Create your Admin Key

    With Postman (or cURL if you prefer) send a POST query with the URL:

    https://api.tomtom.com/geofencing/1/register?key=yourapikey

    and body:

    		{
    		"secret": "your_secret"
    		}
    	

    Where yourapikey should be replaced by your API Key and your_secret by a secret which you have chosen.

    The Response should contain your Admin Key.

  • Project ID

    Create a new project

    Send a POST query with the URL:

    https://api.tomtom.com/geofencing/1/projects/project?key=yourapikey&adminKey=youradminkey

    and body:

    		{
    		"name": "a_project_name"
    		}
    	

    Replace yourapikey and youradminkey and a_project_name with valid values.

    The Response should contain the name and the ID of your newly created project.

  • Place your API Keys, Admin Key and Project ID in the config.js file.
  • Run the index.html file in your browser.

Creating a fence

If you allow your browser to know your location, the map will be centered on your location.

Create a circle shaped fence

  • Move the map where you want to put your fence.
  • On the top-right side of the page, there is a widget from which you can select an action to perform. Select the circle icon.
  • Click on a location where you want to put the center of a circle.
  • Move your pointer away from the center to pick a desired radius.
  • Click a second time to end the drawing. A popup opens. Provide a name for the fence and optionally, any additional JSON properties.

Your newly created fence is now stored at the Geofencing API service.

Click on the fence. In the popup you can see its ID that you can refer to in your device application. It also contains a Delete button to delete the selected fence.

Drawing a fence can be canceled anytime by pressing the Escape button.

Create a corridor

  • Click on the corridor icon in the widget.
  • Click on a point where you want to start drawing.
  • Move/slide your pointer and then click to add a point.
  • Double click to end the drawing.

Create a fence based on a search result

  • Click on the search icon in the widget.
  • In the following form, type in a POI (Points of Interest) or city name that you want to search.
  • Click on the execute button.

See it in action:

Summary

The TomTom Geofences Creator allows you to easily create geofences that can be used and referenced later. Check our SDK for Android example application to see how to use the Geofencing API with the SDK for Android.

In case of any questions feel free to reach out to us via Contact Us page.

You are here