List of usage examples for com.google.gwt.gdata.client.maps FeatureEntry getSelfLink
public final native com.google.gwt.gdata.client.Link getSelfLink() ;
From source file:com.google.gwt.gdata.sample.hellogdata.client.MapsDeleteMapFeatureDemo.java
License:Apache License
/** * Retrieve the features feed for a given map using the * Maps service and the features feed uri. * In GData all get, insert, update and delete methods always * receive a callback defining success and failure handlers. * Here, the failure handler displays an error message while the * success handler obtains the first feature entry with a title * starting with "GWT-Maps-Client" and calls deleteFeature to * delete the feature./* w w w. j ava 2s .co m*/ * If no feature is found, a message is displayed. * * @param mapEntryUri The uri of the map entry for which to * retrieve the features feed */ private void getFeatures(String mapEntryUri) { String featuresFeedUri = mapEntryUri.replace("/feeds/maps/", "/feeds/features/") + "/full"; showStatus("Loading features feed...", false); service.getFeatureFeed(featuresFeedUri, new FeatureFeedCallback() { public void onFailure(CallErrorException caught) { showStatus("An error occurred while retrieving the features feed: " + caught.getMessage(), true); } public void onSuccess(FeatureFeed result) { FeatureEntry[] entries = result.getEntries(); FeatureEntry targetFeature = null; for (FeatureEntry entry : entries) { if (entry.getTitle().getText().startsWith("GWT-Maps-Client")) { targetFeature = entry; break; } } if (targetFeature == null) { showStatus("No map feature found that contains 'GWT-Maps-Client' " + "in the title.", false); } else { String featureEntryUri = targetFeature.getSelfLink().getHref(); deleteFeature(featureEntryUri); } } }); }