any feature to categorize markers at different region-levels which unfold on drill-down

156 views
Skip to first unread message

PoojaC

unread,
Jun 9, 2011, 5:06:37 AM6/9/11
to google-map...@googlegroups.com
Hi,

I have a result-set containing thousands of lat/long coordinates which i want to show on the map, but in an aggregated manner. I want to group my results based on region levels(i.e., country,state,city,street). So, first i want to place a marker at the country-level points, clicking on each will show the markers at different states(present in result) in the country, and so on.

Does google map js v3 api has any such feature where we can pass an entire set of lat/long coordinates and it groups them by city etc? If not, then is there any simple way to meet my requirement?

PoojaC

unread,
Jun 9, 2011, 6:29:45 AM6/9/11
to google-map...@googlegroups.com
It seems MarkerClusterer could be of some help.

Chris Broadfoot

unread,
Jun 9, 2011, 7:01:35 AM6/9/11
to google-map...@googlegroups.com
Yep, check out MarkerClusterer and MarkerManager

On Thu, Jun 9, 2011 at 8:29 PM, PoojaC <poojac...@gmail.com> wrote:
It seems MarkerClusterer could be of some help.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/ndj5tw8s4kkJ.

To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.



--
http://twitter.com/broady

PoojaC

unread,
Jun 9, 2011, 10:17:01 AM6/9/11
to google-map...@googlegroups.com
I checked out MarkerClusterer. It is a good clustering technique. However, I doubt if it can serve my purpose, as it creates clusters based on the grid size(which we can control), but not based on geographical boundries,i.e.,country/city/state level.
Is any customization possible to provide me the required output?

Rossko

unread,
Jun 9, 2011, 12:12:52 PM6/9/11
to Google Maps JavaScript API v3
> Is any customization possible to provide me the required output?

Sure, modify the clusterer script to cluster on your chosen criteria
instead of on-screen distance; I guess that would be zoom level and
some property/properties of markers that you assign or find out -
"country" etc.

PoojaC

unread,
Jun 9, 2011, 12:38:32 PM6/9/11
to google-map...@googlegroups.com
Hi Rossko,

In my knowledge, there is no way to find out the city under which a lat/long falls, without using geocoder service (which is not possible to use in my case). So, customization must be possible, but not in the way you mentioned.
Any other suggestions?

geoco...@gmail.com

unread,
Jun 9, 2011, 12:59:55 PM6/9/11
to Google Maps JavaScript API v3
How did you generate the lat/lng coordinates in the first place? Do
_you_ know what city they are in at some point in your process? How
are you storing the points (in a database, a xml file, etc...)?

-- Larry

PoojaC

unread,
Jun 9, 2011, 1:18:07 PM6/9/11
to google-map...@googlegroups.com
I have all the data(lat/long along with postal address) stored in the database. I want to cluster the locations based on region level and provide a marker drill down feature.

geoco...@gmail.com

unread,
Jun 9, 2011, 1:30:38 PM6/9/11
to Google Maps JavaScript API v3
Use the city from the postal address (you may need to break it out as
a separate column in your database if it isn't one already). If you
want to cluster the markers based on some property, you need to
provide it to the markerclusterer (and probably modify the
markerclusterer to use it).

You could also investigate server side clustering solutions (will be
required if you have a lot of markers), search the group.

-- Larry

PoojaC

unread,
Jun 10, 2011, 7:06:46 AM6/10/11
to google-map...@googlegroups.com
Hi Larry,

Thanks for your suggestions. I do have this city attribute for all the addresses with me. I could have run a loop on my the result-set and group the results based on city, and use a custom numbered marker. However, as the result size is very big, i wanted to go for some clustering technique provided by the google api. From your(and others) reply it seems that i have to go for customization of MarkerClusterer; or make clusters manually,on my own.
Reply all
Reply to author
Forward
0 new messages