Java 类com.google.android.gms.maps.GoogleMap.OnMyLocationChangeListener 实例源码

项目:referendum_1o_android    文件:GoogleMapWrapper.java   
@Override
public final void setOnMyLocationChangeListener(OnMyLocationChangeListener listener) {
    map.setOnMyLocationChangeListener(listener);
}
项目:Arduino-Navigator    文件:GMapControl.java   
private void setOnMyLocationChangedListener() {
    mGoogleMap.setOnMyLocationChangeListener(new OnMyLocationChangeListener() {
        @Override
        public void onMyLocationChange(Location loc) {
            float zoomLevel = mCurrentZoom;
            mCurrentLocation = loc;

            mGoogleMap.clear();

            if(mDestinationLocation == null) {
                mDestinationLocation = new Location(loc);   // Destination is not selected yet. Initialize destination
                mNaviInfo.initDestLocation(mDestinationLocation);
                // If there is pre-used destination, show it on map 
                if(mNaviInfo.getDestLatitude() != 0 && mNaviInfo.getDestLongitude() != 0) {
                    drawDestination(new LatLng(mNaviInfo.getDestLatitude(), mNaviInfo.getDestLongitude()), false);
                }
            } else {
                mNaviInfo.setCurLocation(loc);
            }

            if(!mIsInitialized) {
                zoomLevel = INITIAL_ZOOM_LEVEL;
            } else {
                zoomLevel = 0;
            }


            addMarkerOnMap(loc.getLatitude(), loc.getLongitude(), 
                    "I'm here",         // title
                    loc.getLatitude() + ", " + loc.getLongitude(),          // snippet
                    false,              // draggable
                    MARKER_DEFAULT,     // marker
                    zoomLevel,          // 0 means keep current zoom level
                    !mIsInitialized);               // move camera only when it's first time

            if(mNaviInfo.getDestLatitude() == 0 && mNaviInfo.getDestLongitude() == 0) {
                // Destination is not set. Do nothing
            } else {
                drawDestination(new LatLng(mNaviInfo.getDestLatitude(), mNaviInfo.getDestLongitude()), false);
            }

            mIsInitialized = true;

            mUnitType = AppSettings.getUnitType();
            StringBuilder sb = new StringBuilder();
            sb.append(mNaviMode==NAVI_MODE_COMPASS?"compass":"direction");
            sb.append(",");
            sb.append(mUnitType==UNIT_TYPE_METERS?"meters":"feet");
            mFragmentListener.OnFragmentCallback(IFragmentListener.CALLBACK_MAP_UPDATE_NAVI_INFO,
                    (int)mNaviInfo.getDistance(), (int)mNaviInfo.getAngle(),
                    String.format("%.3f", mDestinationLocation.getLatitude()), 
                    String.format("%.3f", mDestinationLocation.getLongitude()), 
                    sb.toString());
        }
    });
}
项目:HereAStory-Android    文件:GoogleMapWrapper.java   
@Override
public final void setOnMyLocationChangeListener(OnMyLocationChangeListener listener) {
    map.setOnMyLocationChangeListener(listener);
}
项目:referendum_1o_android    文件:IGoogleMap.java   
void setOnMyLocationChangeListener(OnMyLocationChangeListener listener);
项目:HereAStory-Android    文件:IGoogleMap.java   
void setOnMyLocationChangeListener(OnMyLocationChangeListener listener);