У меня реальная проблема с получением функций карты из ленты функций через новый Java API для Android.
Хотя я могу получить featrureFeed, содержащий идентификатор и заголовок (из определенного MapFeed), как только я добавляю FeatureContent к запросу (для получения сведений о метке), FeatureFeed.executeGet () возвращает ошибку «400 неверных запросов».
Я делаю что-то не так, или на самом деле есть ошибка с этим в данный момент?
Ниже приводится часть моего кода - любая информация будет принята с благодарностью, так как я бьюсь головой об этом в течение 3 дней! (я пробовал «кмл: метка», «атом: метка» и «метка» в классе FeatureContent)
public class FeatureFeed {
@Key("atom:id")
public String id;
@Key("atom:title")
public String title;
@Key("atom:entry")
public List features; </p>
<pre><code>public List<FeatureEntry> maps = new ArrayList<FeatureEntry>();
public static FeatureFeed executeGet( HttpTransport transport,
BuildMapsUrl url) throws IOException {
url.fields = GData.getFieldsFor(FeatureFeed.class);
AtomParser parser = new AtomParser();
parser.namespaceDictionary = Namespace.FEED_NAMESPACE_DICTIONARY;
transport.addParser(parser);
HttpRequest request = transport.buildGetRequest();
request.url = url;
return (FeatureFeed) RedirectHandler.
execute(request).parseAs(FeatureFeed.class);
}
}
открытый класс FeatureEntry реализует Cloneable {
@Key ( "Атом: идентификатор")
публичный идентификатор строки;
@Key ( "Атом: название")
публичный строковый заголовок;
@Key ( "Атом: содержание")
общедоступный контент FeatureContent;
public FeatureEntry () {
// требуется
}
public FeatureEntry (заголовок строки, контент FeatureContent) {
this.title = title;
this.content = content;
}
}
открытый класс FeatureContent реализует Cloneable {
@ Key ( "@ тип")
public String contentType = "application / vnd.google-earth.kml + xml";
@ Key ("kml: Placemark") // добавление этого всегда происходит с ошибочным запросом
общедоступная метка FeaturePlaceMark; // добавление этого всегда происходит с ошибочным запросом
public FeatureContent () {
//требуется
}
публичный FeatureContent (метка FeaturePlaceMark) {
this.placemark = метка;
}
}
FEED_NAMESPACE_DICTIONARY.namespaceAliasToUriMap;
feedMap.put ("", "http://www.w3.org/2005/Atom");
feedMap.put ("кмл", "http://www.opengis.net/kml/2.2");
feedMap.put ("atom", "http://www.w3.org/2005/Atom");
feedMap.put ("exif", "http://schemas.google.com/photos/exif/2007");
feedMap.put ("gd", "http://schemas.google.com/g/2005");
feedMap.put ("гм", "http://schemas.google.com/g/2008#mapfeature");
feedMap.put ("geo", "http://www.w3.org/2003/01/geo/wgs84_pos#");
feedMap.put ("georss", "http://www.georss.org/georss");
feedMap.put ("gml", "http://www.opengis.net/gml");
feedMap.put ("gphoto", "http://schemas.google.com/photos/2007");
feedMap.put ("media", "http://search.yahoo.com/mrss/");
feedMap.put ("openSearch", "http://a9.com/-/spec/opensearch/1.1/");
feedMap.put ("xml", "http://www.w3.org/XML/1998/namespace");