Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps 如何在Blackberry应用程序中添加google地图?_Google Maps_Blackberry - Fatal编程技术网

Google maps 如何在Blackberry应用程序中添加google地图?

Google maps 如何在Blackberry应用程序中添加google地图?,google-maps,blackberry,Google Maps,Blackberry,如何在Blackberry应用程序中添加google地图 我正在做一个基于位置的项目,在官方网站上他们给出了你不能使用谷歌API。有没有其他方法可以代替下载地图并这样做?我可以把它重定向到谷歌地图吗 您只需将纬度和经度传递给以下代码 StringBuffer html; String initial = "<!DOCTYPE html>\r\n" + "<html> \r\n" + "<head> \r\n" + "

如何在Blackberry应用程序中添加google地图


我正在做一个基于位置的项目,在官方网站上他们给出了你不能使用谷歌API。有没有其他方法可以代替下载地图并这样做?我可以把它重定向到谷歌地图吗

您只需将纬度和经度传递给以下代码

    StringBuffer html;
    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=true\" \r\n" +
    "          type=\"text/javascript\"></script>\r\n" +
    "</head> \r\n" +
    "<body>\r\n" +
    "  <div id=\"map\" style=\"width: 343px; height: 385px;\"></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" +
    "         \r\n" +
    "        }\r\n" +
    "      })(marker, i));\r\n" +
    "    }\r\n" +
    "  </script>\r\n" +
    "</body>\r\n" +
    "</html>";
    html=new StringBuffer();
    html.append(initial);

        String point = "['"+""+"',"+lattitude+","+longitude+","+""+"],";

        html.append(point);
    centerPoint = "  center: new google.maps.LatLng("+lattitude+","+longitude+"),";
    html.append(second);
    html.append(centerPoint);
    html.append(finalpart);
    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);
stringbufferhtml;
字符串initial=“\r\n”+
“\r\n”+
“\r\n”+
“\r\n”+
“Google映射多个标记\r\n”+
“\r\n”+
“\r\n”+
“\r\n”+
“\r\n”+
“\r\n”+
“\r\n”+
“var位置=[”;
字符串second=“];\r\n”+
“\r\n”+
var map=new google.maps.map(document.getElementById('map'),{\r\n+
“缩放:8,”;
字符串中心点=”;
String finalpart=“mapTypeId:google.maps.mapTypeId.ROADMAP\r\n”+
“});\r\n”+
“\r\n”+
“var infowindow=new google.maps.infowindow();\r\n”+
“\r\n”+
变量标记,i;\r\n+
“\r\n”+
“对于(i=0;i