Skip to content

[Question] A sample how to build clustering expressions  #70

@mitikov

Description

@mitikov

Hey folks, could you please provide an example on how to build complex AzureMapsControl.Components.Atlas.Expression during clustering.

I'm doing a POC for migrating from pure JS to Blazor, and I've stumbled upon the task of converting datasource expressions.

The things I do in JS:

  1. Different valueGetter based on isCluster: ['case', isCluster, ['get', 'cluster_hits'], ['get', 'hits']];
  2. Is cluster: isCluster = ['has', 'point_count'];
  3. Specify aggregation, f.e. sum: ['+', valueGetter]
  4. Convert to 'boss' view, leaving only 2 digits for fraction

The JS constructs look quite readable; at the same time I could not build anything close using Blazor wrapper.
The docs show straightforward value getter as of now.

Thanks,
Nik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions