Code example for GoogleMap

Methods: setInfoWindowAdapter

0
        if (map == null) {
            return; 
        } 
 
        mInfoWindowAdapter = new CardInfoWindowAdapter(getActivity(), this);
        map.setInfoWindowAdapter(mInfoWindowAdapter);
 
        // the map doesn't automatically snap to our current location, so we need to do that 
        // somehow. 
        if (showMyLocation) {
            final LocationManager lm = (LocationManager) getActivity().getSystemService(
                    Context.LOCATION_SERVICE);
            final Location myLoc = lm.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER);
            // XXX this returns null 
            // final Location myLoc = getMap().getMyLocation(); 
            if (myLoc != null) {
                map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(myLoc.getLatitude(),
                        myLoc.getLongitude()), 16));
            } 
        } 
    }