当前位置: 首页>>代码示例>>Java>>正文


Java GoogleMap.setOnInfoWindowClickListener方法代码示例

本文整理汇总了Java中com.google.android.gms.maps.GoogleMap.setOnInfoWindowClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java GoogleMap.setOnInfoWindowClickListener方法的具体用法?Java GoogleMap.setOnInfoWindowClickListener怎么用?Java GoogleMap.setOnInfoWindowClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.maps.GoogleMap的用法示例。


在下文中一共展示了GoogleMap.setOnInfoWindowClickListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMapReady

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
public void onMapReady(final GoogleMap googleMap) {


        for(int i=0;i<PicList.size();i++)
        {
            LatLng place = new LatLng(Double.valueOf(PicList.get(i).get_latitude()),Double.valueOf(PicList.get(i).get_longitude()));

            //make small size icon
            Bitmap smallMarker = Bitmap.createScaledBitmap(imgeHelper.getBitmapFromByteArray(PicList.get(i).get_thumbnail()), 70, 70, false);
            googleMap.addMarker(new MarkerOptions().position(place)
                    .title(PicList.get(i).get_city())).setIcon(BitmapDescriptorFactory.fromBitmap(smallMarker));

            googleMap.moveCamera(CameraUpdateFactory.newLatLng(place));

            // Set a listener for marker click.
            googleMap.setOnMarkerClickListener(this);
            //this listener is listening the events that you click on the title of the map marker
            googleMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
                @Override
                public void onInfoWindowClick(Marker marker) {

                    DBHelper dbHelper = new DBHelper(getContext(), "Picture.db", null, 1);
                    picCities = dbHelper.selectPicFromCity(marker.getTitle());


                    //send data to citygallery activity
                    Intent intent = new Intent(getContext(), CItyGalleryActivity.class);
                    intent.putExtra("cityChoise",picCities.get(0).get_city().toString());
                    startActivity(intent);

                    dbHelper.close();

                }
            });
        }


    }
 
开发者ID:peterdestasio,项目名称:Geoclick,代码行数:39,代码来源:MapViewFragment.java

示例2: onMapReady

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
    // Add a marker in Sydney, Australia,
    // and move the map's camera to the same location.
    LatLng sydney = new LatLng(-33.852, 151.211);
    MarkerOptions marker = new MarkerOptions().position(sydney)
            .title("Marker in Sydney");
    googleMap.addMarker(marker);
    googleMap.setOnInfoWindowClickListener(this);
    googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
 
开发者ID:parthdave93,项目名称:AndroidTestingTutorial,代码行数:12,代码来源:MapActivity.java

示例3: MapsManager

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
MapsManager(Activity context, GoogleMap map) {
    mContext = context;

    // 地圖
    mMaps.add(MAP_CODE_MAIN, map);
    mMapTiles.add(MAP_CODE_MAIN, null);

    mZoomNumber = (TextView) context.findViewById(R.id.zoom_number);

    // 顯示準心座標
    mCrossCoor = (TextView) context.findViewById(R.id.tvCoord);
    mCrossCoor.setOnClickListener((MapsActivity) mContext);

    // 加入比例尺
    RelativeLayout container = (RelativeLayout) context.findViewById(R.id.layout_container);
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(800, 800);
    mScaleBar = new ScaleBar(mContext, getMap(MAP_CODE_MAIN));
    mScaleBar.setLayoutParams(params);
    container.addView(mScaleBar);

    // 註冊畫面縮放的監聽
    map.setOnCameraMoveListener(this);

    // Set the Listener
    map.setOnMapClickListener(this);
    map.setOnMapLongClickListener(this);
    map.setOnInfoWindowClickListener(this);
    map.setOnMarkerDragListener(this);
    map.setOnCameraIdleListener(this);

    // 在Activity和Map物件註冊ClusterManager
    mClusterManagers.add(MAP_CODE_MAIN, new ClusterManager<CustomMarker>(mContext, map));
    // The Rule about Cluster Managing
    mClusterManagers.get(MAP_CODE_MAIN).setRenderer(
            new CustomRenderer(mContext, map, mClusterManagers.get(MAP_CODE_MAIN)));
    mClusterManagers.get(MAP_CODE_MAIN).setOnClusterClickListener(
            (CustomRenderer) mClusterManagers.get(MAP_CODE_MAIN).getRenderer());
    // Click on marker to open infoWindow
    map.setOnMarkerClickListener(mClusterManagers.get(MAP_CODE_MAIN));
    // POI in Google map
    map.setOnPoiClickListener(this);

    // Test for new info window
    map.setInfoWindowAdapter(new CustomAdapter(mContext));
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:46,代码来源:MapsManager.java


注:本文中的com.google.android.gms.maps.GoogleMap.setOnInfoWindowClickListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。