Rossko is right: you have to move the definition of your function inside the
javascript tag.

The fragment:
_________________________________________
<?php
}

*function updateMarkers() {*
?>
<script language="Javascript" type="text/javascript">

       if(infowindow) {
     infowindow.close();
   }
_________________________________________

MUST BE

_________________________________________
<?php
}

?>
<script language="Javascript" type="text/javascript">
*function updateMarkers() {*

       if(infowindow) {
     infowindow.close();
   }
_________________________________________

and remember to close } before function bindInfoWindow.

Going back to your question about AJAX, you are already using AJAX paradigm,
this is what the ActiveXObject('Microsoft.XMLHTTP') does: the URL you load
do not load a new HTML page in your browser but calls a javascrpt handler
which updates the content of current page with the new data.
Finally, the markers you should keep track of in order to clean them up are
not the XML elements you receive in the response (var markers =
xml.documentElement.getElementsByTagName("marker");) but the new
google.maps.Marker you create and bind to map. You need a new global
container for them.

Hope it helps,
Davide Cremonesi


2010/5/29 Rossko <[email protected]>

> > <?php
> >
> > }
> >
> > function updateMarkers() {
> > ?>
>
> If you use 'view source' in your browser, is there a function
> updateMarkers() actually getting to the browser ?
>
> --
> 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
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://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 [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-js-api-v3?hl=en.

Reply via email to