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


Java Marker.showInfoWindow方法代码示例

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


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

示例1: onClusterItemClick

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public boolean onClusterItemClick(Station station) {
    Location stationLocation = new Location("");
    stationLocation.setLatitude(Double.parseDouble(station.getLatitude()));
    stationLocation.setLongitude(Double.parseDouble(station.getLongitude()));
    Object[] markers = clusterManager.getMarkerCollection().getMarkers().toArray();
    for (Object m : markers) {
        if (m instanceof Marker) {
            Marker mark = (Marker) m;
            Location location = new Location("");
            location.setLatitude(mark.getPosition().latitude);
            location.setLongitude(mark.getPosition().longitude);
            if (location.distanceTo(stationLocation) == 0) {
                map.animateCamera(CameraUpdateFactory.newLatLng(station.getPosition()));
                mark.setTitle(gson.toJson(station));
                mark.showInfoWindow();
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:23,代码来源:MapFragment.java

示例2: moveCameraToPosition

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
private void moveCameraToPosition(LatLng position) {
    if (position == null)
        googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(SSN_COLLEGE.getCenter(), 17));
    else {
        Marker marker = googleMap.addMarker(new MarkerOptions()
                .position(position)
                .title(location));
        marker.showInfoWindow();
        googleMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder()
                .target(position).zoom(18).build()));
    }
}
 
开发者ID:adithya321,项目名称:Instincts-2k17,代码行数:13,代码来源:MapsActivity.java

示例3: onMarkerDragEnd

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public void onMarkerDragEnd(Marker marker) {
    LatLng latLng = marker.getPosition();
    marker.setSnippet(ProjFuncs.latLng2DString(latLng, false));
    marker.showInfoWindow();
    mMaps.get(MAP_CODE_MAIN).animateCamera(CameraUpdateFactory.newLatLng(latLng));
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:8,代码来源:MapsManager.java

示例4: onMapReady

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
@Override
public void onMapReady(GoogleMap googleMap) {
    Marker marker = googleMap.addMarker(new MarkerOptions().position(location)
            .title(descriptionString));
    marker.showInfoWindow();
    googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location, 20));
}
 
开发者ID:kev5,项目名称:GoMeet,代码行数:8,代码来源:MapsMarkerActivity.java

示例5: collectLocationsAndPutOnMap

import com.google.android.gms.maps.model.Marker; //导入方法依赖的package包/类
private void collectLocationsAndPutOnMap(Map<String, Object> servings) {

        //iterate through each user, ignoring their UID
        for (Map.Entry<String, Object> entry : servings.entrySet()) {

            //Get user map
            singleUser = (Map) entry.getValue();
            //Get phone field and append to list

            latitudes.add((Double) singleUser.get("latitude"));
            longitudes.add((Double) singleUser.get("longitude"));
            keys.add((String) singleUser.get("key"));
            userIds.add((String) singleUser.get("userId"));
            //amount.add((Double) singleUser.get("price"));


            titles.add((String) singleUser.get("title"));
        }

        for (int i = 0; i < latitudes.size(); i++) {
            LatLng aLocation = new LatLng(
                    latitudes.get(i), longitudes.get(i)
            );


            BitmapDrawable bitmapdraw=(BitmapDrawable)getResources().getDrawable(R.drawable.wii);
            Bitmap b=bitmapdraw.getBitmap();
            Bitmap smallMarker = Bitmap.createScaledBitmap(b, 150, 150, false);

            Marker marker =  googleMap.addMarker(new MarkerOptions()
                    .position(aLocation)
                    .title(titles.get(i))
                    .icon(BitmapDescriptorFactory.
                            fromBitmap(smallMarker))

            );
            marker.setTag(keys.get(i));
            marker.showInfoWindow();
        /*googleMap.addMarker(new MarkerOptions()
                .position(new LatLng(
                        20, -25))
                .title("fake location"));*/

        }

    }
 
开发者ID:thandomy,项目名称:foodie,代码行数:47,代码来源:HomeActivity.java


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