Map Widget

Map Widget

The Map Widget allows you to visualize the location variables of your device on a map, as well as customize the visualization in many ways. By default, the map widget uses OpenStreetMap as provider; however, you can integrate your preferred map provider like Mapbox, Google Maps, or Here to fit your needs.

Additionally, the widget allows you to customize the visualization by adding icons, pins, images, links, geofences, filters, and much more!



The variable data should look like the following payload. Note that the 'lat' and 'lng' values should be added inside the 'location' field as shown below:

{
  "variable": "location",
  "value": "My Address",
  "location": {
    "lat": 42.2974279,
    "lng": -85.628292
  }
}

This widget also accepts features like metadata and series, that can be set in your variable data.


Creating your own

To add it to your dashboard, choose the Map widget from the list and customize it to your preference. You can edit it by using the options located on the right side of the widget.

This widget works for both dashboards, Normal and Blueprint.


1. 'Data From' Field

This field allows you to set the device and variable that will be used in this widget.

Click on the cog icon to edit specific options for this variable, such as: pin icon, formulas, and more. Click on the close icon to remove this variable from the widget's data.

This field is dependent on the type of dashboard you are using; the difference is explained below.

1.1 'Data From' for Normal Dashboards

From the option 'Data From' on the right menu, select one device from your list of devices and the variable that contains the location data.

1.2 'Data From' for Blueprint Dashboards

From the option 'Data From' on the right menu, add the Blueprint device and input the name of the variable that contains the location information.

When using a Blueprint dashboard, the field Variable will not list variables to be picked because it doesn't know the devices linked to your Blueprint Device.


2. Tile Provider

This option allows you to define which map provider will be used on your widget to display the map. This is great if you need to have customized maps to fit your specific use case. By default, the map tile provider is OpenStreetMap, which is free to use; however, you can go with other providers like MapboxHere Maps, or Google Maps.

Info
Each map provider has its own customization options for the tiles and pricing tiers, which often may be free up to a certain amount of tile requests. You should consult the providers to make an informed decision.
2.1 How to configure a map title provider on TagoIO
To use one of the alternative map tile providers, you will simply need to have an API Key from your provider and a username in some cases. The API key can be found by accessing the console of your map provider. We suggest consulting the documentation of your provider if you have trouble getting the key.

Once the key is at hand, you will have to store the API key value inside a Secret on TagoIO. Go to your Admin, then the Secrets page, and create a new secret with the name of your map provider. In the Secret Value, paste the API Key and save.



Once you have a Secret with your API key created, you can go to your Map widget, then the Title Provider option, select your map provider, and now in API Key, select the secret where the API key of your map provider is stored. Once you save the widget, the map will start displaying your provider's map and not the default.




2.2 How to configure Google Maps as map provider
For instance, using Google Maps as a provider is quite simple. All you need to do is have a Google account and set up an API Key. Read the full tutorial here: How to Set Up Google Maps in Your Map Widget


3. Infobox

Present more information with an infobox that'll automatically be associated with the pins, and customize it with icons, images, external links, street views, formulas, routes by GoogleMaps, and much more.

In the widget edit screen, you can customize the following options for the variables:

  • Image options: Choose how the image will appear by selecting by top or side view and the perfect aspect ratio (portrait or landscape).
  • Allow users to get directions: Create a button with another variable location data, so that once the button is pressed a new route is made by Google Maps and you are redirected to it.

Also, you can customize an image and a link that could be set through the edit screen or by metadata. In this widget, metadata always has priority over options set by the edit screen.

In addition, the map widget supports series, so you can group your variables' data in the same infobox. 

If a group of variables has more than one external link or location data, only one will be considered based on the Data From field's order. This does not apply to images, as more than one image will produce a slide show inside the infobox.


4. Filter

The filter makes your data easier to visualize by allowing users to filter for results.

You can filter pins by device, variable, value, and time. Filters also provide a table to list each pin that's being displayed, and you can click on a row to center it.

Learn more about Map filters.


5. Geofence

Draw colored geographic boundaries to make it easy to see your devices' trajectory through a zone.

You can draw polygon or circle figures and associate them with events, and build an analysis to receive notifications when the device enters or leaves the zone.

Learn more about Geofence in map widgets.


6. Layer GIS

Customize your Map with GeoJSON or Shapefiles layers. Display boundaries, areas, roads, pipelines, and more. Learn more about Map Layer GIS.


    • Related Articles

    • Heat Map Widget

      With the Heat Map widget, you can build a colorful layer with bubbles representing the intensity of the variables on top of your image. The higher the value of the variable, the more red the bubble will be, and you can also add a heat scale to this ...
    • Map filters

      You can filter the results being displayed in a map in order to minimize the amount of information shown, allowing you to find exactly what you are looking for.  1. Filter using pins' data In the widget's configuration, in Filter options, you can ...
    • Map Layer GIS

      Display geometries, boundaries, areas, roads, pipelines, and more with the Map widget layer GIS. Each layer is defined by GeoJSON files (.geojson, .json, .zip), which you can upload and manage, either statically or dynamically. Shapefiles are also ...
    • Geofences in map widgets

      Geofences allow developers to color parts of the map and determine events in specific areas. To create a geofence, go to Geofence options in your widget's configuration. Then, set the option Allow users to edit geofence to yes. You can choose to ...
    • Widget Cache system

      The caching system optimizes the performance of your dashboards by storing widget data and any computations performed using Data Analytics. This allows future requests to be served faster by utilizing results from earlier requests, thereby speeding ...