Showing different attributes from geo objects on map

Hello, maps add-on works great so far.
What I would like to implement is a selection feature for the user to show different values (attributes of the geo object) within the clusters (default is count of geo objects per cluster).
Found no way so far. Is there a possibility, and if so, how does it work?

Thx for answers.

Hi, @willi

Clustering can also be performed using not the points count, but using points summed up weight. The weight of each point is defined by the corresponding geo-object property, which you can specify in weightProperty attribute in xml. If this is not exactly what you are interested in, could you please describe your case in more detail?

Regards,
Gleb

Hello Gleb,

that’s the direction I think.
The idea is: let’s say having a geo object/entity with some (persistent/transient) entity attr. e.g. weight, price, etc., so I would like to give the user the opportunity to switch on the map (via radiobutton) between those attr. and show the appropriate numbers within the bubbles.

I know, I have to convert the numbers to int (deviation isn’t a problem) to show them (how can that be done? may I specify a getter which converts the attribute?)

As a result I wouldn’t show a simple ‘count’, but the cumulative result of a certain attr. of the geo objects.

Hope that’s clearer now.

You can have a persistent/transient entity attribute with numeric value corresponding to a “weight” of this geo-object (point on a map). Then you need to specify this entity attribute in the weightProperty parameter of clustering options, for example:

<maps:vector id="locations" dataContainer="locationsDc" >
  <maps:cluster weightProperty="price"/>
</maps:vector>

It is a little bit trickier because clusters are initialized only once, as the page is loaded. After that you can either change the weightProperty programmatically and refresh the layer (which may be costly if you have a large set of data), or you can create another layer with the same data beforehand and show only one of the layer at the same time. Visibility of the layers can be controlled by a radio button.

Regards,
Gleb