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


Java GoogleMap.setOnMarkerClickListener方法代码示例

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


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

示例1: setUpClusterer

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
private void setUpClusterer(@NonNull CivifyMap map) {
    GoogleMap googleMap = map.getGoogleMap();
    setRenderer(new IssueMarkerClusterRenderer(map, this));
    setOnClusterItemClickListener(this);
    googleMap.setOnMarkerClickListener(this);
    googleMap.setOnCameraIdleListener(this);
}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:8,代码来源:CivifyMarkers.java

示例2: enableSubMap

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
public void enableSubMap(GoogleMap subMap) {
    mMaps.add(MAP_CODE_SUB, subMap);
    mMapTiles.add(MAP_CODE_SUB, null);

    subMap.setMapType(MAP_TYPE_HYBRID);
    subMap.moveCamera(CameraUpdateFactory.newCameraPosition(mMaps.get(MAP_CODE_MAIN).getCameraPosition()));
    onCameraMove();

    // 在Activity和Map物件註冊ClusterManager
    mClusterManagers.add(MAP_CODE_SUB, new ClusterManager<CustomMarker>(mContext, subMap));
    // The Rule about Cluster Managing
    mClusterManagers.get(MAP_CODE_SUB).setRenderer(
            new CustomRenderer(mContext, subMap, mClusterManagers.get(MAP_CODE_SUB)));
    mClusterManagers.get(MAP_CODE_SUB).setOnClusterClickListener(
            (CustomRenderer) mClusterManagers.get(MAP_CODE_SUB).getRenderer());
    // Click on marker to open infoWindow
    subMap.setOnMarkerClickListener(mClusterManagers.get(MAP_CODE_SUB));
    // Click on Cluster to zoom to Markers
    subMap.setOnCameraIdleListener(this);

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

示例3: onMapReady

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

        GoogleMap map = getMap();
        if (map == null) {
            MFBUtil.Alert(this, getString(R.string.txtError), getString(R.string.errNoGoogleMaps));
            finish();
            return;
        }

        map.setMapType(GoogleMap.MAP_TYPE_HYBRID);
        UiSettings settings = map.getUiSettings();
        settings.setCompassEnabled(false);
        settings.setRotateGesturesEnabled(false);
        settings.setScrollGesturesEnabled(true);
        settings.setZoomControlsEnabled(false);
        settings.setZoomGesturesEnabled(true);

        View mapView = getFragmentManager().findFragmentById(R.id.mfbMap).getView();
        if (mapView != null && mapView.getViewTreeObserver() != null && mapView.getViewTreeObserver().isAlive()) {
            mapView.getViewTreeObserver().addOnGlobalLayoutListener(this);
        }

        map.setOnMarkerClickListener(this);
        if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
            map.setMyLocationEnabled(true);
        }
        map.setOnMapLongClickListener(this);

        updateMapElements();
    }
}
 
开发者ID:ericberman,项目名称:MyFlightbookAndroid,代码行数:34,代码来源:ActFlightMap.java

示例4: onMapReady

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap map) {
    mLocationClient = getLocationClient();
    mLocationClient.addListener(this);

    updateMapPosition();

    if (mNew) {
        mMapView.setShowInfoWindow(true);
        mMapView.setShowAccuracy(true);
    }

    map.setOnMapClickListener(new OnMapClickListener() {
        @Override
        public void onMapClick(LatLng loaction) {
            viewMap();
        }
    });

    map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
        @Override
        public boolean onMarkerClick(Marker marker) {
            viewMap();
            return true;
        }
    });
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-android,代码行数:28,代码来源:EditActivity.java

示例5: onMapReady

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

	// Move camera to Porto Alegre
	LatLng portoAlegre = new LatLng(-30.039005, -51.224059);
	this.googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(portoAlegre, 14));
	customizeMap();
	customizeMapLocation();

	// Set map specific listeners
	googleMap.setOnMarkerClickListener(this);
	googleMap.setOnCameraMoveListener(this);

	mapViewModel = new MapViewModel(this.googleMap, this);
	binding.setViewModel(mapViewModel); // We don't use data binding anywhere though
}
 
开发者ID:EduardoVernier,项目名称:bikedeboa-android,代码行数:18,代码来源:MapActivity.java

示例6: onMapReady

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
    mapView.setContentDescription("MAP");
    this.googleMap = googleMap;
    if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
        setUpGoogleApiClient();
        // Draw an indication of the user's current location on the map
        this.googleMap.setMyLocationEnabled(true);
    }
    googleMap.setOnMarkerClickListener(this);
}
 
开发者ID:thandomy,项目名称:foodie,代码行数:12,代码来源:HomeActivity.java

示例7: onMapReady

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
/**
 * Appena la mappa è disponibile, oltre a settare le funzioni di base riportate nella classe
 * padre, vengono attivate le funzioni specifiche della mappa e avviata una prima ricerca dei
 * parcheggi nella zona di Urbino (di dafault).
 */
@Override
public void onMapReady(GoogleMap googleMap) {
    super.onMapReady(googleMap);
    googleMap.setOnMarkerClickListener(this);
    googleMap.setOnMapClickListener(this);

    // vengono cercati i parcheggi presso urbino all'avvio
    AsyncDownloadParcheggi adp
            = new AsyncDownloadParcheggi(mMainActivity, MappaGoogle.COORD_INIZIALI);
    adp.execute();
}
 
开发者ID:IelloDevTeam,项目名称:IelloAndroidApp,代码行数:17,代码来源:MappaMain.java

示例8: onMapReady

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap map) {
    // New entry, track and save gps location.
    if (mEvent != null && mEvent.mLocalId <= 0
            && (mEvent.mLocationSource == null || mEvent.mLocationSource.equals(GameHarvest.LOCATION_SOURCE_GPS))) {
        mMapView.setShowInfoWindow(true);
        mMapView.setShowAccuracy(true);

        if (getActivity() != null) {
            mLocationClient = ((BaseActivity) getActivity()).getLocationClient();
            mLocationClient.addListener(this);
        }
    }

    map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
        @Override
        public void onMapClick(LatLng arg0) {
            viewMap();
        }
    });

    map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
        @Override
        public boolean onMarkerClick(Marker marker) {
            viewMap();
            return true;
        }
    });
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-android,代码行数:30,代码来源:HarvestFragment.java

示例9: 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

示例10: 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

示例11: onMapReady

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
    super.onMapReady(googleMap);
    googleMap.setOnMapClickListener(this);
    googleMap.setOnMarkerClickListener(this);
}
 
开发者ID:IelloDevTeam,项目名称:IelloAndroidApp,代码行数:7,代码来源:MappaSegnalazione.java

示例12: initMap

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
protected void initMap(GoogleMap map) {
    super.initMap(map);
    map.setOnMarkerClickListener(this);
    map.setOnMapClickListener(this);
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:7,代码来源:PopupMeasurementMapFragment.java

示例13: initMap

import com.google.android.gms.maps.GoogleMap; //导入方法依赖的package包/类
@Override
protected void initMap(GoogleMap map) {
    super.initMap(map);
    map.setOnMarkerClickListener(this);
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:6,代码来源:TagsMapFragment.java


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