sg

Perşembe, Aralık 08, 2005

Re: newb - how do you count the # of markers in a diameter - and how to create a circle


AFAIK The API provides no function for it, you would have to do it
yourself.

I can't think of a simple way - mainly because it is a circle not a
square.

Two ways I can think of:
1) when loading your markers, put them in an array.
then cycle through, examining the coords of each and decide whether
they are in the circle using maths.

2) If you have your points in an SQL database...
Use geospatial extensions
see
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/54dfe34ec466cc2a/a37a8bf33443a7b4#a37a8bf33443a7b4
for a bit of stuff about them - what I say to him about SELECT ...
WITHIN would apply to you - I dunno if SQL would support a perfect
circle as the poly, but a circular polygon with enough points should
be accurate enough.

Also, using method (1) what I said in that post about crossing date
lines may apply too (unless you coded to compensate) but that probably
wont be an issue if you are only dealing with points in the US

I am no expert though so don't take my word as gospel, I could be wrong.

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık