My code is basically doing this, but it's not easy to pull out the
parts you need. I can give you an overview of what you'll need.
1. Call map.getBounds(). I actually use map.getBounds().toUrlValue()
to get all the values in one call rather than calling
getNorthEast().lng(), etc.
2. Set up a MySQL table indexed on latitude and then create another
index for longitude. Or swap those if your data is more spread out
west/east.
3. Query for points using the bounds values: select * from points
where lat > bound_south and lat < bound_north and lng > bound_west and
lng < bound_east.

More recent versions of MySQL have geospatial extensions (http://
dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html), which might
make your life easier. I'm not personally using them as I switched to
PostgreSQL/PostGIS a while back. However, you should be able to store
a lat/long value in one field and query on them much easier using a
bounding box.

Dave


On May 21, 4:25 pm, Beach Bum <asutto...@gmail.com> wrote:
> Hi. I am wondering if anyone has any code to limit the number of
> points read from a MySQL db by only selecting points that fall within
> the current map boundary (shown on screen). I can imagine how this
> might be done using the getBounds() , getNorthEast() and
> getSouthWest() but thought I would look for code rather than take this
> one on as I am new to programming. Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-maps-js-api...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-maps-js-api-v3+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.

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

Reply via email to