Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Implementation Marker Cluster #407

Open
rafaelmacedox opened this issue Jul 18, 2018 · 3 comments
Open

Plugin Implementation Marker Cluster #407

rafaelmacedox opened this issue Jul 18, 2018 · 3 comments
Labels

Comments

@rafaelmacedox
Copy link

Hello everyone, I have a angular project using yaga leaflet, I need to implement the markercluster plugin, I am using the yaga-feature-group and yaga-marker directives. I saw that there is an issue already open, but I still could not implement what I need, could anyone help me?

@atd-schubert
Copy link
Member

Do you have specific questions? I can try to help you.

Maybe I will find some time to implement a MarkerCluster Plugin next months.

@rafaelmacedox
Copy link
Author

I'm using directives to create layers

<yaga-marker *ngFor="let alarm of allVehicles" [(lat)]="alarm.latitude" [(lng)]="alarm.longitude" [display]="alarm.display">
              <yaga-icon
                [iconUrl]="'assets/true_truckk.png'"
                [iconSize]="[40,45]"
                [iconAnchor]="[23,44]"
                [popupAnchor]="[-5,-42]">
              </yaga-icon>
</yaga-marker>

To use the Marker Cluster I must do

var markers = new L.MarkerClusterGroup();
markers.addLayer(L.marker([175.3107, -37.7784]));
map.addLayer(markers);

So in yagajs/leaflet I should do:

@ViewChild(MapComponent) private mapComponent: MapComponent;

let markers = (L as any).MarkerClusterGroup();
markers.addLayer( ??????????? );
mapComponent.addLayer(markers);

In this part I do not know how to proceed, how should I recover all my makers and after that where I add them.

@bpatrik
Copy link

bpatrik commented Jul 20, 2019

Hi @rafaelmacedox,

Could you figure out a easy/ proper way of doing clustering?
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants