Hi,
Why is my HTML invalid? I know it doesn't validate - but this is only
a dev version ;)
I think I've taken on board most of what you said - but doing:
marker_array[marker_count] = marker; /* save to an array, so
we can access it later... */
map.addOverlay(marker);
..never seems to actually populate marker_array
alert(marker_array[1]);
..just tells me its undefined.
http://ultradev.com.nmsrv.com/test_map_andy.htm
Am I missing something?
I *really* appreciate you taking the time with this - I'm new to all
this JS/google map stuff, so its a sharp learing curve.
TIA
Andy
On Mar 17, 3:47 pm, Andrew Leach <[email protected]>
wrote:
> On Mar 17, 3:18 pm, youradds <[email protected]> wrote:
>
> > Hi,
>
> > Ok, I've setup a temp copy here:
>
> >http://ultradev.com.nmsrv.com/test_map_andy.htm
>
> > It will only work in that area - but should give you an idea as to how
> > I've got it working :)
>
> Your HTML is hopelessly invalid, I'm afraid. You seem to have spliced
> at least two pages together, possibly more.
>
> The "popup thing" is called an infoWindow. It helps to use the right
> names as per the documentation because then everyone knows they're
> talking about the right thing.
>
> I would suggest: give each marker a unique identifier. You can define
> a custom property for a marker.
> marker.myIdentifier = 1; // or whatever
>
> Create a global array for your markers, and as you add a marker to the
> map, enter it into the array using that identifier as the index of the
> array. That means that the marker with .myIdentifier = 1 is at
> markers[1].
>
> When you open the infoWindow, set a global variable to the
> myIdentifier value so you know which marker has the infoWindow open.
> openInfoWindowID = marker.myIdentifier;
>
> When **the user** closes the infoWindow, unset openInfoWindowID.
>
> When you reload data, check to see if openInfoWindowID is set. If it
> is, then the infoWindow should be open on that marker. Click the
> relevant marker to open the infoWindow:
> GEvent.trigger(markers[openInfoWindowID],"click")
--
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.