0
假設以下情況:
用戶從列表中選擇一個國家。點擊國家後,地圖應放大到所選國家。如何使用OSMDroid縮放到特定國家?
如何在OSMDroid中實現zoomToCountry如果我只知道列表中的國家名稱?
在PHP API 「谷歌地圖V3」 有像
function findAddress(address) {
var geocoder = null;
geocoder = new google.maps.Geocoder();
if (!address)
var address=document.getElementById("countryselect").value;
if ((address != '') && geocoder) {
geocoder.geocode({ 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
if (results && results[0] && results[0].geometry && results[0].geometry.viewport)
map.fitBounds(results[0].geometry.viewport);
} else {
alert("No results found");
}
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
}
的解決方案是否有OSMDroid或OSMBonuspack任何類似的?
Th錯誤符合:GeocoderNominatim coder = new GeocoderNominatim(context); ** **找不到。**帶有按鈕** Edit Source Lookup Path ... **抱歉,我是android新手。 Thx尋求幫助 – Sebastian
將gson-2.3.1,jar添加到構建路徑後工作正常! (http://mvnrepository.com/artifact/com.google.code.gson/gson/2.3.1) – Sebastian
安裝指南中提到了對GSON的需求。你的意思是說你根本沒有gson,或者你必須用gson-2.3.1.jar替換gson-2.2.4.jar? – MKer