At time of writing, there is no GDownloadURL method in API 3.

This is already in the issue tracker as a feature request:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=1364

You will need to write your own code to fetch the xml.php file you are
using.

Perhaps this code (as pointed out by Pamela in the issue tracker)
http://photomunchers.appspot.com/js/util.js

Thanks
Pete


On Feb 24, 8:47 am, ersan6 <[email protected]> wrote:
> Hi,
>
> I am trying to read some data from database via php and then read
> data from client via javascript. I get object expected error. Any
> help
> would be appreciated.
>
> function initialize() {
>   var istanbul = new google.maps.LatLng(41.0906, 29.0476);
>   var myOptions = {
>     zoom: 12,
>     center: istanbul,
>     mapTypeId: google.maps.MapTypeId.ROADMAP
>   };
>
>   map = new google.maps.Map(document.getElementById("map_canvas"),
> myOptions);
>
>   // We create pathCoordinates as an MVCArray so we can
>   // manipulate it using the insertAt() method
>   pathCoordinates = new google.maps.MVCArray();
>
>   var polyOptions = {
>     path: pathCoordinates,
>     strokeColor: '#000000',
>     strokeOpacity: 1.0,
>     strokeWeight: 3
>   }
>   poly = new google.maps.Polyline(polyOptions);
>   var path = poly.getPath();
>
>  // alert("welcome");
>   GDownloadURL("xml.php", function(data, responseCode) {
>           if(responseCode == 200) {
>                   var xml = GXml.parse(data);
>                   var complex_features =
> xml.documentElement.getElementsByTagName("complex_feature");
>             for (var i = 0; i < complex_features.length; i++) {
>                 var ID = complex_features[i].getAttribute("ID");
>                         var feature_name =
> complex_features[i].getAttribute("feature_name");
>                         var fr_point = new
> google.maps.LatLng(parseFloat(complex_features[i].getAttribute("fr_lat")),
>
> parseFloat(complex_features[i].getAttribute("fr_lng")));
>                         var to_point = new
> google.maps.LatLng(parseFloat(complex_features[i].getAttribute("to_lat")),
>
> parseFloat(complex_features[i].getAttribute("to_lng")));
>
>                         var speed =
> parseFloat(complex_features[i].getAttribute("speed"));
>                 var path = poly.getPath();
>                 path.insertAt(i, fr_point);
>
>                  }
>              } else if(responseCode == -1) {
>                         alert("Data request timed out. Please try
> later.");
>             } else {
>                         alert("Request resulted in error. Check XML
> file is
> retrievable.");
>          }
>
>   });
>   var Glatlng1 = new google.maps.LatLng(41.0908,29.0525);
>   var marker1 = new google.maps.Marker({
>                position:  Glatlng1,
>                map: map
>                          });
>   map.addOverlay(marker1);
>   poly.setMap(map);
>
> }
>
>

-- 
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