On Mar 17, 1:41 pm, JGarrido <[email protected]> wrote:
> Let me give you use case to better explain what I'm trying to do.
> Let's say I'm attempting to plot out all of the Starbucks locations
> throughout the country. Instead of having the clusters created
> organically (ala MarkerClusterer), I'd like to have them clustered by
> state - but I don't want to have to worry about manually adding them
> individually based on the state they are in (forgetting for a moment
> how simple this would be to do in the US - it's just an example).
>
> I'm assuming I would first have to create the individual polygons
> somehow using a list of lat/long coords to define each "state" (the
> way you would create an image map in HTML, for example). How could I
> easily have the marker be assigned to a state, based on its own lat/
> long coords?
> I can use GLatLngBounds to have it associated with a
> rectangular boundary, but how about a polygon?


Use Mike Williams' epoly extension:
http://econym.org.uk/gmap/epoly.htm

if (statePolygon.Contains(marker.getGLatLng())) { marker.myState =
stateName; }

  -- Larry

>
>  - JG
>
> On Mar 17, 4:13 pm, "[email protected]" <[email protected]>
> wrote:
>
>
>
> > On Mar 17, 12:09 pm, JGarrido <[email protected]> wrote:
>
> > > I've looked at libraries like MarkerClusterer (http://gmaps-utility-
> > > library-dev.googlecode.com/svn/tags/markerclusterer/), and it would
> > > work great to have clusters created organically, but what I'm
> > > currently attempting to do is create clusters based on specific
> > > geographic areas (think states, countries, provinces, etc.).
>
> > > Is anyone aware of a library that has the option to accomodate this?
> > > If not, any ideas on how to enable a marker to 'be aware' of a
> > > geographic region without having to manually assign it to one?
>
> > You could "manually" do the clustering with the marker manager.  Put
> > markers for the regions at low zoom levels, then once you reach the
> > "local" zoom level, have it show the "local" markers.
>
> > Like googles "office" 
> > example:http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/r...
>
> > I modified a version of it to work the way I would want it to 
> > work:http://www.geocodezip.com/google_northamerica_officesJ.asphttp://www....
>
> >   -- Larry- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to