who wants it? can we have it?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chriscalip’s picture

Hey Josef,

Serverside Geocluster and Clientside Geoclustering -- possible with geocluster, leaflet_geojson, and some custom code. I am wondering if this something that interest you..

Screencast coming.

chriscalip’s picture

Title: Serverside Geocluster and Clientside Geoclustering » Serverside Geocluster and Clientside Geoclustering, progressive enhancement approach.
chriscalip’s picture

Video Cast and demo on serverside and clientside geoclustering.

http://www.youtube.com/watch?v=pRYKNlaTbKk

chriscalip’s picture

Attach are the js for both serverside and transition (both serverside and clientside) geoclustering.

chriscalip’s picture

The code still has remnants of trying to make use of the bounded box information from the serverside. Currently I am making use of the the featureData geocluster ids to limit what entity_id(s) "nid(s) in this case" the clientside geojson call would get.

dasjo’s picture

Title: Serverside Geocluster and Clientside Geoclustering, progressive enhancement approach. » Progressively enhance server-side with client-side clustering
Project: Leaflet GeoJSON » Geocluster

hi chris,

thanks a lot for this effort - the screencast explains very well the approach that you are proposing!

as you state, doing the heavy-clustering server-side with ajax callbacks makes sense only until a certain level of detail is reached. from a conceptual standpoint it therefore makes a lot of sense to fully transfer smaller sets of data and shift to client-side clustering for the visualization.

on the implementation side of things, first i have renamed the issue and moved it to the geocluster queue - i hope that title makes sense, as i wanted it to be a bit more compact :)

now i really like the idea, but i think i'm not sure how to best "close the gap between server- and client-side clustering". i'm looking at what happens when you click on a cluster that has number of items below the threshold and therefore triggers the switch to client-side clustering: http://www.youtube.com/watch?feature=player_detailpage&v=pRYKNlaTbKk#t=202s it seems like in the current implementation, the map zooms out and then offers you a leaflet markercluster to interact with. i think we should get rid of this manual interaction that does the zoom-out & reloads the cluster. ideally, this would happen automatically.

i'm just thinking out loud here:

a possible approach could determine clusters below the threshold automatically on the client-side when adding clusters to the map. it then issues a separate ajax request to get the contents of all clustered item ids and automatically injects the information to convert the clusters into client-side clusters on-the-fly.

i'm still unsure how we can separate the "global server-side clustering" that is triggered whenever the viewport bounding-box changes from the client-side clustering that affects just a particular region. what is your take on switching back from client-side to server-side clustering at the moment?

thanks again for the screencast, this is a great way of discussing ideas. i'm working towards finishing my thesis by the end of the month which means i have to focus on writing instead of coding, but i'm very happy to discuss and see how we can move foward from here :)

dasjo’s picture

i have posted about this idea in the leaflet markercluster library queue: https://github.com/Leaflet/Leaflet.markercluster/issues/151

mpgeek’s picture

Issue summary: View changes

I am considering taking this up on a client project. One of the key challenges is keeping the animation consistent between server side and client side clustering. This makes me think that geocluster should somehow make use of the Leaflet.MarkerCluster library when clustering server side. Also, another key challenge is figuring out the threshold for server vs. client, as pointed out in #6. I'm wondering if there are any new ideas here?

dasjo’s picture

Hey that's great to hear! I'm not aware of anything new but you might wanna check back what's out there in the leaflet world

robertwb’s picture

@chriscallip - OK - great demo video. Now, is the question how to get this all integrated in such a way as to make it easy to select and configure/tweak this approach in Drupal? Thus, do we need to know how the structure of Leaflet modules and supporting javascript can adapt to this? we can carry this on over at the roadmap thread.

dasjo’s picture

I think this is mainly a leaflet.marker cluster related question. See #7

robertwb’s picture

Yeah I read #7 and checked out the github post - I am NOT thinking that it's necessarily a geocluster issue, I was saying that given the talk about refactoring leaflet that it's linked to that architectural discussion.