location

Multi-value spatial search with Solr 4.x and Drupal 7

For some time, Solr 3.x and Drupal 7 have been able to do geospatial search (using the location module, geofield, or other modules that stored latitude and longitude coordinates in Drupal that could be indexed by Apache Solr). Life was good—as long as you only had one location per node!

Sometimes, you may have a node (say a product, or a personality) affiliated with multiple locations. Perhaps you have a hammer that's available in three of your company's stores, or a speaker who is available to speak in two locations. When solr 3.x and Drupal 7 encountered this situation, you would either use a single location value in the index (so the second, third, etc. fields weren't indexed or searched), or if you put multiple values into solr's search index using the LatLonType, solr could throw out unexpected results (sometimes combining the closest latitude and closest longitude to a given point, meaning you get strange search results).

Declustering Markers in Google Maps with Drupal?

Location MarkerI recently received a question from a friend who's setting up a new site in Drupal 7, and is using the GMap Module, Location, and Views, to set up a map of upcoming events for his website.

My response (posted below) basically gives some pointers for what other people (often creating custom implementations of Google Maps on their sites) are doing to avoid the problem of 'decluttering' or 'declustering' multiple points at the same location (same coordinates). My question is: how do you handle declustering on your Drupal site? Are there any perferred techniques? Luckily for me, this is a problem I have yet to encounter, as I've only had to map locations of stores, parishes, etc., that are already spread out evenly over some area of a map :-)

My response to his question follows: