Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.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
Java 使用两个谷歌地图android_Java_Android_Google Maps Android Api 2 - Fatal编程技术网

Java 使用两个谷歌地图android

Java 使用两个谷歌地图android,java,android,google-maps-android-api-2,Java,Android,Google Maps Android Api 2,我正在编写使用谷歌地图的程序。地图上有标记。信息Winodow打开你点击标记。单击“信息”窗口时,新布局将可见。有一个图片文本和新的小地图集中在该标记上。但在某些版本的android上,它不是一张小地图,而是一个看不见的空间 它在4.0.1上运行良好,在3.2和一些2.*版本上不起作用 以下是OnInfo WindowClick的代码 @Override public void onInfoWindowClick(Marker marker) { Strin

我正在编写使用谷歌地图的程序。地图上有标记。信息Winodow打开你点击标记。单击“信息”窗口时,新布局将可见。有一个图片文本和新的小地图集中在该标记上。但在某些版本的android上,它不是一张小地图,而是一个看不见的空间

它在4.0.1上运行良好,在3.2和一些2.*版本上不起作用

以下是OnInfo WindowClick的代码

 @Override
public void onInfoWindowClick(Marker marker) {              
    String url = markers.get(marker.getId());       
    int id = 0;
    Camera cam = null;
    id = Integer.parseInt(marker.getTitle());
    LinearLayout secondLL = (LinearLayout) findViewById(R.id.bigpicture);
    int visibility = secondLL.getVisibility();
    if(visibility == View.GONE)
    {
         secondLL.setVisibility(View.VISIBLE);           
         ImageView image = (ImageView)findViewById(R.id.badge2);
         for (int i = 0; i < camera.size(); i++)
         {
             cam = camera.get(i);
             if (cam.id == id) break;
         }

         TextView number = (TextView)findViewById(R.id.number);
         String infoNumber = "";
         if (id != 0)            
         infoNumber += "Камера №" + Integer.toString(cam.id) + ","; 
         number.setText(infoNumber);

         TextView full = (TextView)findViewById(R.id.full);
         String infoFull = "";
         if (cam.full != null)
         infoFull += cam.full + ",";
         full.setText(infoFull);

         TextView district = (TextView)findViewById(R.id.district);
         String infoDistrict ="";
         if (cam.district != null)
         infoDistrict += "Район " + cam.district;
         district.setText(infoDistrict);

         imageLoader.displayImage(url, image);  
         LatLng DOT = new LatLng(cam.lat, cam.lon);

         SupportMapFragment map2Fragment = (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map2);
         map2 = map2Fragment.getMap();

         if (map2 != null)
         {

             map2.clear();
             map2.setTrafficEnabled(true);
             map2.setMyLocationEnabled(false);           
             map2.getUiSettings().setZoomControlsEnabled(false);
             map2.getUiSettings().setAllGesturesEnabled(false);
             Marker dot = map2.addMarker(new MarkerOptions()
                .position(DOT)                         
                .icon(BitmapDescriptorFactory
                        .fromResource(R.drawable.green)));
             map2.moveCamera(CameraUpdateFactory.newLatLngZoom(DOT, 17));
         }
    }                          
}
@覆盖
公用void onInfo窗口单击(标记){
字符串url=markers.get(marker.getId());
int id=0;
摄像机摄像机=null;
id=Integer.parseInt(marker.getTitle());
LinearLayout secondLL=(LinearLayout)findViewById(R.id.bigpicture);
int visibility=secondLL.getVisibility();
如果(可见性==视图已消失)
{
secondLL.setVisibility(View.VISIBLE);
ImageView图像=(ImageView)findViewById(R.id.2);
对于(int i=0;i
这是什么意思:但在某些版本的android上,它不是一个小地图,而是一个不可见的空间。我可以看到第一个地图,打开的信息窗口,其他标记,移动它。