On May 5, 12:19 pm, Shawn <[email protected]> wrote:
> I was hoping someone could take a look at my code and explain
> something for me.
>
> In the head of my page i have a [script] where i create a map and
> place markers onto it. The markers are added with a function called
> addPoints(). This works fine if i call that function before [/script].
> However, I have another [script] in the body, if i try to call
> addPoints() from there  the markers do not appear.

You are calling the geocoder from your inline code.  The geocoder is
asynchronous, by the time the results come back, the map exists, but
the addPoints routine has already run, so although the points are
added to the desiredPoints or familyPoints arrays, they are never put
on the map...

  -- Larry


>
> After some testing i have found the map.addOverlay line to break my
> script:                 map.addOverlay(new 
> GMarker(myPoints[i],markerOptions));
>
> Again it is only a problem if i call the function within a different
> set  of [script] [/script]
>
> I believe i have created the map and arrays needed as global variables
> but i may be missing something.
>
> The source for this can be found 
> here:http://venturepax.mindboxstudios.com/map.php
>
> Thanks in advance for any help
--~--~---------~--~----~------------~-------~--~----~
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