Data Lens Developer's Guide

Object Layer

H.datalens.ObjectLayer presents data points as markers or spatial map objects with data-driven styles and client-side clustering. The source of the data can be either tiled or non-tiled. Styles for map objects can be parameterized with data rows and zoom level. ObjectLayer creates data-driven icons for markers, such as donuts or bars.

To render a simple marker for each row of Data Lens query data you must define provider and the rowToMapObject callback:

var layer = new H.datalens.ObjectLayer(
  provider,
  {
    rowToMapObject: function(row) {
      return new H.map.Marker(
        {lat: row.latitude, lng: row.longitude}
      );
    }
  }
);

And you must add the layer to the map:

map.addLayer(layer);

Several options define the rendering of data on the map with ObjectLayer:

  • dataToRows defines how the input data is split by rows. You can specify this callback to define client-side aggregation and filtering. By default it represents each row as an object where property names correspond to data column names.
  • clustering.rowToDataPoint callback defines H.clustering.DataPoint from rows. When provided, rows returned from dataToRows go to the rowToDataPoint callback to be transformed to data points. Then, the data points are clustered to produce clusters and noise points. Clusters and noise points are presented as map objects with the rowToMapObject callback and can be styled with the rowToStyle callback.
  • clustering.options defines clustering options as a function of the zoom level.
  • rowToMapObject defines how each row, cluster or noise point is presented on the map (for example: with a marker or a polygon).
  • rowToStyle defines map object style and icon according to the data row and zoom level (data-driven styling).

Non-clustering data flow:

Figure 1. Data flow without clustering

Clustering data flow:

Figure 2. Data flow with clustering

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.