com.google.android.gms.maps.GoogleMapOptions Java Examples

The following examples show how to use com.google.android.gms.maps.GoogleMapOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MapActivity.java    From WechatHook-Dusan with Apache License 2.0 6 votes vote down vote up
private void changeToGoogleMapView() {
    zoom = mAmapView.getMap().getCameraPosition().zoom;
    latitude = mAmapView.getMap().getCameraPosition().target.latitude;
    longitude = mAmapView.getMap().getCameraPosition().target.longitude;

    mapbtn.setText("To 高德地图");
    mIsAmapDisplay = false;
    mGoogleMapView = new com.google.android.gms.maps.MapView(this, new GoogleMapOptions()
            .camera(new com.google.android.gms.maps.model
                    .CameraPosition(new com.google.android.gms.maps.model.LatLng(latitude, longitude), zoom, 0, 0)));
    mGoogleMapView.onCreate(null);
    mGoogleMapView.onResume();
    mContainerLayout.addView(mGoogleMapView, mParams);
    mGoogleMapView.getMapAsync(this);
    handler.sendEmptyMessageDelayed(0, 500);
}
 
Example #2
Source File: GoogleMapImpl.java    From android_packages_apps_GmsCore with Apache License 2.0 6 votes vote down vote up
private GoogleMapImpl(Context context, GoogleMapOptions options) {
    this.context = context;
    Context appContext = context;
    if (appContext.getApplicationContext() != null)
        appContext = appContext.getApplicationContext();
    Context wrappedContext = ApplicationContextWrapper.gmsContextWithAttachedApplicationContext(appContext);
    backendMap = new BackendMap(wrappedContext, this);
    uiSettings = new UiSettingsImpl(this);
    projection = new ProjectionImpl(backendMap.getViewport());
    this.options = options;

    criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_COARSE);
    criteria.setPowerRequirement(Criteria.POWER_MEDIUM);

    if (options != null) initFromOptions();
}
 
Example #3
Source File: MapFragment.java    From mirror with Apache License 2.0 5 votes vote down vote up
@Scope(MirrorAppScope.class)
@Provides(MapView.class)
public MapFragment() {
    mBinder = new ViewBinder(this);
    mState = new ViewState(this);

    GoogleMapOptions mapOptions = new GoogleMapOptions()
            .liteMode(true)
            .mapToolbarEnabled(true);

    Bundle args = new Bundle();
    args.putParcelable("MapOptions", mapOptions);
    setArguments(args);
}
 
Example #4
Source File: NativeAirMapViewBuilder.java    From AirMapView with Apache License 2.0 5 votes vote down vote up
/**
 * Build the map fragment with the requested options
 *
 * @return The {@link NativeGoogleMapFragment} map fragment.
 */
@Override public NativeGoogleMapFragment build() {
  if (options == null) {
    options = new AirGoogleMapOptions(new GoogleMapOptions());
  }
  return NativeGoogleMapFragment.newInstance(options);
}
 
Example #5
Source File: MapFragmentImpl.java    From android_packages_apps_GmsCore with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) throws RemoteException {
    Log.d(TAG, "onCreate");
    //myMap().onCreate(savedInstanceState);
    // TOOD: Certainly does not belong here and this way
    Bundle mapState = savedInstanceState.getBundle("map_state");
    if (mapState != null) {
        mapState.setClassLoader(GoogleMapOptions.class.getClassLoader());
        GoogleMapOptions options = mapState.getParcelable("MapOptions");
        if (options != null) this.options = options;
    }
}
 
Example #6
Source File: AirGoogleMapOptions.java    From AirMapView with Apache License 2.0 4 votes vote down vote up
public AirGoogleMapOptions(GoogleMapOptions options) {
  this.options = options;
}
 
Example #7
Source File: CreatorImpl.java    From android_packages_apps_GmsCore with Apache License 2.0 4 votes vote down vote up
@Override
public IMapViewDelegate newMapViewDelegate(IObjectWrapper context, GoogleMapOptions options) {
    return new MapViewImpl(ObjectWrapper.unwrapTyped(context, Context.class), options);
}
 
Example #8
Source File: MapViewImpl.java    From android_packages_apps_GmsCore with Apache License 2.0 4 votes vote down vote up
public MapViewImpl(Context context, GoogleMapOptions options) {
    this.context = context;
    this.options = options;
}
 
Example #9
Source File: GoogleMapImpl.java    From android_packages_apps_GmsCore with Apache License 2.0 4 votes vote down vote up
public synchronized static GoogleMapImpl create(Context context, GoogleMapOptions options) {
    return new GoogleMapImpl(context, options);
}
 
Example #10
Source File: MapFragmentImpl.java    From android_packages_apps_GmsCore with Apache License 2.0 4 votes vote down vote up
@Override
public void onInflate(IObjectWrapper activity, GoogleMapOptions options,
                      Bundle savedInstanceState) throws RemoteException {
    if (options != null) this.options = options;
    Log.d(TAG, "onInflate");
}
 
Example #11
Source File: CreatorImpl.java    From android_packages_apps_GmsCore with Apache License 2.0 4 votes vote down vote up
@Override
public IMapViewDelegate newMapViewDelegate(IObjectWrapper context, GoogleMapOptions options) throws RemoteException {
    return new MapViewImpl((Context) ObjectWrapper.unwrap(context), options);
}