Search code examples
here-api

H.clustering.Provider constructor error since today


var dataPoints = [
  new H.clustering.DataPoint(52, 1),
  new H.clustering.DataPoint(52.1, 1)
];

var clusteringProvider = new H.clustering.Provider(dataPoints, {
  clusteringOptions: {
   minWeight: 1,
   eps: 32
  }
});
// clustering should be used with ObjectLayer
var clusteringLayer = new H.map.layer.ObjectLayer(clusteringProvider);
map.addLayer(clusteringLayer);

This is the code from the example from https://developer.here.com/documentation/maps/topics_api/h-clustering-provider.html I am referencing provided Here Maps JS libraries (version 3.0).

The error I am getting from today is "TypeError: f.pb is not a function" at the initialization of H.clustering.Provider object. The same code worked on Friday. Not sure what is going on?


Solution

  • I stumbled over the same error. Apparently the old example had a link to the clustering code under https://js.api.here.com/v3/3.0/mapsjs-clustering.js

    The current example loads that code from https://js.cit.api.here.com/v3/3.0/mapsjs-clustering.js - the same sub-domain as the other scripts.

    I guess the two sub-domains are no longer in sync and mixing the minified scripts fails due to different field names.