I'm seeing an issue with the GData JavaScript API in creating maps.
The success callback is invoked, but no map is created. I've tried
different approaches, below is some code to reproduce this behavior.
This seems to be in both versions 1.10 and 2.0. In the past there was
a similar issue where maps were created but not visible in the feed
(were being created in an invalid state), in this case the maps don't
show up in Google Maps either.
I know this API is still in the lab - just to make sure this gets
looked at. Let me know if you'd like me to add to the issue tracker.
<html>
<body>
<img src="./logo-small.png" width="100px" />
<script type="text/javascript" src="
http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load("gdata", "2.0");
function doLogin() {
if (google.accounts.user.getStatus('
http://maps.google.com/
maps/feeds')){
alert('Logged in.');
return;
}
var token = google.accounts.user.login('
http://maps.google.com/
maps/feeds');
}
function addMap() {
var mapFeedUrl = '
http://maps.google.com/maps/feeds/maps/default/
owned';
var service = new google.gdata.maps.MapsService('maps-
example');
service.getMapFeed(
mapFeedUrl,
function(feedRoot){
alert('Got feed with ' + feedRoot.feed.getEntries().length +
' entries');
var newMap = new google.gdata.maps.MapEntry();
var newMapTitle = new google.gdata.atom.Text();
newMapTitle.setText('Roadtrip 2009');
newMap.setTitle(newMapTitle);
feedRoot.feed.insertEntry(
newMap,
function() {window.alert("Succeeded creating map"); },
function() {window.alert("Failed creating map."); }
);
},
function() {window.alert("Failed retrieving feed."); }
);
}
</script>
<input type="button" value="Login" onclick="doLogin();" />
<input type="button" value="Create Map" onclick="addMap();" />
</body>
</html>