Comments (9)
Hey man, yeah I'm pretty sure it is possible to do. Didn't do it before as the flare graphics may also represent multiple points and the graphics are temporary. They get fully destroyed when the cluster is deactivated.
I'm doing some work on this again to make it work with v4.12, so I'll take a look at implementing this while I'm in there. Can't give a time frame though sorry.
from flareclusterlayer.
Finally got around to looking at this. The pointer events are only disabled over the text svg elements, so a click event on the flares works fine.
I added an event emitter to the layer that will emit an event with a Flare object as the argument. Subscribe to the event on the layer like this -
clusterLayer.on("flare-clicked", function (flare) {
console.log('flare clicked', flare);
});
Any time you click a flare this will then get hit get. All of the data you need to make a popup appear should be in the Flare object that's passed in. If it's a flare representing only one point, then the Flare object will contain a property called singleData
. This is your data object. You can use the existence of this property to test if you want to create a popup or not.
It's a bit of a cop out not creating the popup within the layer (certainly is easier), but this is bit more flexible so you can anything you want on any flare click.
from flareclusterlayer.
Hi @apaleja, no worries - added a cluster-clicked event as well. Use it the same way as the flare-clicked event.
clusterLayer.on("cluster-clicked", function (cluster) {
console.log('cluster clicked', cluster);
});
from flareclusterlayer.
@nickcam thank you for updating to the latest version...
If I make an interesting online system, I will share it with you first.
from flareclusterlayer.
Other mouse-events like mouse-scrolling (probably for the same reason) also don't work. You can reproduce this by opening the https://flareclusterlayer.azurewebsites.net/index_v4.html
sample, zooming in a bit on Melbourne, Australia so that lots of screen space if occupied by the bubbles/circles and then try to zoom in/out on the map using mouse scrolling.
from flareclusterlayer.
Yeah from memory all mouse (pointer) events are disabled over the cluster graphics. There was a good reason for this but I can't remember what is was right now. Will have to take a look when I get a chance.
from flareclusterlayer.
@nickcam +1 for this. I also would like to show popup similar to ArcGIS 3.x Implementation Can you give some pointers, how to do that ? I will see if I can make required changes.
from flareclusterlayer.
Hi @nickcam Thank you very much for quick change implementation. I believe this change allows to capture click on Flare of Cluster. I am looking for a solution when displayFlares: false
and user click on cluster icon.
Is it possible to emit similar event for cluster click as well ?
from flareclusterlayer.
@nickcam Thank very much for for quick turn around.
from flareclusterlayer.
Related Issues (20)
- recreating the clusters in v4.11 is not showing graphics HOT 2
- Getting node_module error while running application HOT 1
- Print Cluster Layer with the Esri 4.x Api Print Widget HOT 1
- FlareClusterLayer.js 用javascript引用时 js里面的define 报错define is not defined HOT 1
- There is something wrong with the 4.12 API HOT 1
- use vueJS to finish aggregation analysis HOT 1
- What clustering algorithm do you use? HOT 1
- Zoom on cluster when clicked HOT 1
- Can support the ArcGIS API for JavaScript version 4.13? HOT 3
- How to use it in { "wkid": 2381 }? HOT 5
- classBreaksRenderer problem HOT 12
- Can I use FlareClusterLayer in a Gauss Kruger projection environment HOT 2
- unable to compile with Angular 8.3 HOT 1
- Show Popup on Cluster Click HOT 3
- Unable to load package with ArcGIS Webpack Plugin HOT 4
- onhover opens wrong flareCluster when map is not full body HOT 2
- On mouse hover icon is getting streched and icons flickering HOT 4
- Upgrading to ArcGis 4.19, cluster text occasionally does not show up on cluster symbol HOT 6
- how to use in vue3+vite? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flareclusterlayer.