2013-08-24 14 views
0

我想添加一個位置到我的OpenGraphObject(它從地方繼承)。 目前我有這樣的:OpenGraphObject與位置

OpenGraphObject store = OpenGraphObject.Factory.createForPost("testshoppingguide:store"); 
store.setTitle(this.store.getName()); 
store.setDescription(this.store.getName()); 
store.setProperty("location",) 

,但我應該怎麼定位之後添加?我只發現GraphLocation,但我不確定如何使用它。

回答

1

您想傳入一個GraphObject,其中「id」屬性是位置的標識。

嘗試這樣:

GraphLocation location = GraphObject.Factory.create(GraphLocation.class); 
location.setLatitude(...); 
location.setLongitude(...); 
store.setProperty("location", location);