ngx-openlayers icon indicating copy to clipboard operation
ngx-openlayers copied to clipboard

Clustered Features

Open bagasprakarso opened this issue 8 years ago • 12 comments

Hi Quentin,

Is Clustered Features like http://openlayers.org/en/latest/examples/cluster.html not include in this library?

cause when i'm implementing it using this code

<aol-layer-vector> <aol-source-cluster>

i've got

Error: Template parse errors: 'aol-source-cluster' is not a known element:

Thanks

bagasprakarso avatar Apr 11 '17 11:04 bagasprakarso

Only a subset of OL4 is implemented. It's usually trivial to add things, just create a component and map all properties.

achimha avatar Apr 12 '17 08:04 achimha

If no one else is already working on adding clusters, I will do it.

Happy with the new project name too, fits great.

greggguru avatar Aug 23 '17 04:08 greggguru

@greggguru AFAIK, no one is publicly working on this right now. Would be greatly appreciated though!

quentin-ol avatar Aug 23 '17 10:08 quentin-ol

Ack, best intention to get this done quickly has failed. I'm sorry. I still would like to implement this feature. Let's see what this weekend will allow me to complete.

greggguru avatar Sep 16 '17 12:09 greggguru

@greggguru are you working on it currently? Would be extremely grateful if you complete implementation of that feature. I highly need that to my Angular 4 app but unfortunately I am not capable of creating that feature on my own. Keep my fingers crossed. Best regards, Mikołaj

MSkraburski avatar Nov 12 '17 14:11 MSkraburski

Hi yall. I want to help with implementing this.

I had something in mind like the following

<aol-layer-vector>
   <aol-source-cluster>
      <aol-source-vector>
          <aol-feature> ...

That ok ?

codeMonkeysBe avatar Mar 06 '18 07:03 codeMonkeysBe

Was this implemented by anyone? I see that <aol-source-cluster> exists in the code, but I couldn't understand how to use it...

HarelM avatar Sep 26 '18 17:09 HarelM

You can find an example here => https://quentin-ol.github.io/ngx-openlayers/examples/cluster The source code is here

davinkevin avatar Sep 26 '18 19:09 davinkevin

Link is dead, I found the following code in the example to show how cluster works:

<aol-layer-vector>
    <aol-source-cluster [distance]="distance">
      <aol-source-vector>
        <aol-feature *ngFor="let p of points">
          <aol-geometry-point>
            <aol-coordinate [x]="p.x" [y]="p.y" [srid]="'EPSG:4326'"></aol-coordinate>
          </aol-geometry-point>
        </aol-feature>
      </aol-source-vector>

      <aol-style>
        <aol-style-circle [radius]="10">
          <aol-style-stroke [color]="'#fff'"></aol-style-stroke>
          <aol-style-fill [color]="'#3399CC'"></aol-style-fill>
        </aol-style-circle>
        <aol-style-text [text]="'1'">
          <aol-style-fill [color]="'#fff'"></aol-style-fill>
        </aol-style-text>
      </aol-style>

    </aol-source-cluster>
  </aol-layer-vector>

But I can't figure out how to get the feature instance of the cluster in order to set the text for the style. In the cluster documentation the style is set with a function that receives a feature, how does one implement this using this library?

HarelM avatar Sep 26 '18 19:09 HarelM

P.S thanks for the quick response!

HarelM avatar Sep 26 '18 19:09 HarelM

I now see that what I'm looking for is discussed here: #186, I'll move my question there.

HarelM avatar Sep 26 '18 19:09 HarelM

I'm guessing this is implemented and can be closed, right? (So that future developers wouldn't think this is still not implemented since it is open).

HarelM avatar Sep 26 '18 19:09 HarelM