On Jul 12, 1:40 am, bratliff <[email protected]> wrote:
> Interesting.  Where are the KML / XML files hosted ?  Your server.
> Google's server.  What about cross domain access ?  Is a proxy
> required ?  Without a JSONP alternate format, it seems impractical to
> me.

this uses the Maps Data API, which gives programmatic access to the
"My Maps" hosted on maps.google.com.  The data is stored on google
servers, and the API handles the cross domain access with a callback.
The data is returned as a KML "feed", and the javascript must parse
it.  Here's a snippet of the code showing the callback:

// create query url
var url = stateBoundaryFeed + "?mq=[id:" + id + "]";

// request features
mapsDataService.getFeatureFeed(url, function(feedRoot) {
  var feed     = feedRoot.feed;
  var features = feed.getEntries();

  // convert KML to javascript objects
  placemarks = [];
  var bounds   = new google.maps.LatLngBounds();
  for (var i=0; i<features.length; i++) {
    placemarks[i]  =
parseKmlPolygon(features[i].getContent().getText());
    bounds = bounds.union(placemarks[i].bounds);
  }
  map.fitBounds(bounds);

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