당신의 생성자 내에서 다음을 수행 그런
String initial = "<!DOCTYPE html>\r\n" +
"<html> \r\n" +
"<head> \r\n" +
" <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" /> \r\n" +
" <title>Google Maps Multiple Markers</title> \r\n" +
" <script src=\"http://maps.google.com/maps/api/js?sensor=false\" \r\n" +
" type=\"text/javascript\"></script>\r\n" +
"</head> \r\n" +
"<body>\r\n" +
" <div id=\"map\" style=\"width: 360px; height: 390px;\"></div>\r\n" +
"\r\n" +
" <script type=\"text/javascript\">\r\n" +
" var locations = [";
String second= " ];\r\n" +
"\r\n" +
" var map = new google.maps.Map(document.getElementById('map'), {\r\n" +
" zoom: 8,";
String centerPoint ="";
String finalpart = " mapTypeId: google.maps.MapTypeId.ROADMAP\r\n" +
" });\r\n" +
"\r\n" +
" var infowindow = new google.maps.InfoWindow();\r\n" +
"\r\n" +
" var marker, i;\r\n" +
"\r\n" +
" for (i = 0; i < locations.length; i++) { \r\n" +
" marker = new google.maps.Marker({\r\n" +
" position: new google.maps.LatLng(locations[i][1], locations[i][2]),\r\n" +
" map: map\r\n" +
" });\r\n" +
"\r\n" +
" google.maps.event.addListener(marker, 'click', (function(marker, i) {\r\n" +
" return function() {\r\n" +
" infowindow.setContent(locations[i][0]);\r\n" +
" infowindow.open(map, marker);\r\n" +
" }\r\n" +
" })(marker, i));\r\n" +
" }\r\n" +
" </script>\r\n" +
"</body>\r\n" +
"</html>";
"다음
String[] lt={x};
String[] lon={y};
String[] name={"CurrentLocation"};
StringBuffer html=new StringBuffer();
html.append(initial);
for(int i=0 ; i<lt.length; i++){
//LocationObj source = (LocationObj)waypoints.elementAt(i);
//String point = "['"+source.getLabel()+"',"+source.getLatitude()+","+ source.getLongitude()+","+i+"],";
String point = "['"+name[i]+"',"+lt[i]+","+ lon[i]+","+i+"],";
//System.out.println("Point is"+point);
html.append(point);
}
html.append(second);
centerPoint = " center: new google.maps.LatLng("+lt[0]+","+lon[0]+"),";
html.append(centerPoint);
html.append(finalpart);
//System.out.println("Plot is"+html.toString());
BrowserFieldConfig _bfConfig = new BrowserFieldConfig();
_bfConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
_bfConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
_bfConfig.setProperty(BrowserFieldConfig.USER_AGENT, "MyApplication 1.0");
BrowserField myBrowserField = new BrowserField(_bfConfig);
myBrowserField.displayContent(html.toString(), "");
은 VFM 또는 HFM 내부 myBrowserField 추가 화면에 표시 . X & y는 위도와 경도 값 (각각)이다. 희망이 도움이!
이
감사합니다. 하지만 안드로이드의 코드는 블랙 베리가 아니길 원해. 위 코드는 bb 용입니다. – xyz
당신이 질문에 썼습니다 : "문제는 내가 변환하려고 할 때"응용 프로그램이 블랙 베리에서 지원되지 않는 Google지도 라이브러리를 포함하고 있기 때문에 "배포하지 못했습니다."라는 오류가 발생합니다. " BlackBerry에 Google지도를 배포하려고하지 않습니까? BlackBerry에서 Google지도를 다운로드하려면 Google지도가 설치되어 있지 않은 상태에서 휴대 전화에 응용 프로그램이로드 될 때마다 사용자에게 다운로드를 요청하는 코드를 URL에 전달해야합니다. – Sarah
하지만 "BrowserFieldConfig"클래스는 BB 용이며 어떻게 안드로이드 코드에서 사용할 수 있습니까 ??? 그리고 .bar 파일로 변환 한 후 BB에 설치했을 때의 문제에 직면했습니다. – xyz