从最后一天开始,我正在搜索如何在 os 5.0 的黑莓地图上绘制可点击的针脚。我在特定的纬度上绘制图像,但我想通过单击该图像进入另一个屏幕。
提前致谢。
我用谷歌地图做过这样的事情。
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>";
html=new StringBuffer();
html.append(initial);
point = "['"+name[i]+"',"+lat[i]+","+ lon[i]+","+i+"],";
html.append(point);
html.append(second);
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(), "");
HorizontalFieldManager horf=new HorizontalFieldManager(HORIZONTAL_SCROLL);
horf.add(myBrowserField);
add(horf);
当我单击图钉时,它将显示用户名。