Java 类com.google.android.gms.maps.model.MapStyleOptions 实例源码

项目:ExtraMapUtils    文件:MapUtils.java   
private static void setSelectedStyle(StyleDef styleName, GoogleMap googleMap, Context context) {
    MapStyleOptions style;
    switch (styleName) {
        case RETRO:
            style = MapStyleOptions.loadRawResourceStyle(context, R.raw.mapstyle_retro);
            break;
        case NIGHT:
            style = MapStyleOptions.loadRawResourceStyle(context, R.raw.mapstyle_night);
            break;
        case GRAY_SCALE:
            style = MapStyleOptions.loadRawResourceStyle(context, R.raw.mapstyle_grayscale);
            break;
        case DEFAULT:
            style = null;
            break;
        default:
            return;
    }
    googleMap.setMapStyle(style);
}
项目:Taxi-App-Android-XML    文件:Home.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;

    boolean success = googleMap.setMapStyle(new MapStyleOptions(getResources()
            .getString(R.string.style_json)));

    if (!success) {
        Log.e("Style", "Style parsing failed.");
    }
    LatLng jakarta = new LatLng(-6.232812, 106.820933);
    LatLng southjakarta = new LatLng(-6.22865,106.8151753);
    mMap.addMarker(new MarkerOptions().position(jakarta).icon(BitmapDescriptorFactory.fromBitmap(getBitmapFromView("Set Pickup Location", R.drawable.dot_pickup))));
    mMap.addMarker(new MarkerOptions().position(southjakarta).icon(BitmapDescriptorFactory.fromBitmap(getBitmapFromView("Set Dropoff Location", R.drawable.dot_dropoff))));
    mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(jakarta, 15f));


}
项目:Nibo    文件:BaseNiboFragment.java   
protected MapStyleOptions getMapStyle() {
    if (mStyleEnum == NiboStyle.CUSTOM) {
        if (mStyleFileID != DEFAULT_MARKER_ICON_RES) {
            return MapStyleOptions.loadRawResourceStyle(
                    getActivity(), mStyleFileID);
        } else {
            throw new IllegalStateException("NiboStyle.CUSTOM requires that you supply a custom style file, you can get one at https://snazzymaps.com/explore");
        }
    } else if (mStyleEnum == NiboStyle.DEFAULT) {
        return null;
    } else {
        if (mStyleEnum == null) {
            return null;
        }
        {
            return MapStyleOptions.loadRawResourceStyle(
                    getActivity(), mStyleEnum.getValue());
        }
    }
}
项目:Ridr    文件:RideView.java   
@Override
// Basic thing to do when the map is setup
// Callback for when the googleMap object is set up
public void onMapReady(GoogleMap googleMap) {
    // Make our map a map
    map = googleMap;

    Calendar current = Calendar.getInstance();

    // Add night view for nice viewing when it's dark out
    // Dark styling is easier on the eyes
    SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss");
    if (nightTime(time.format(current.getTime()))) {
        MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(this, R.raw.maps_night_style);
        map.setMapStyle(style);
    }

    // Let's listen for clicks on our markers to display information
    map.setOnMarkerClickListener(showInfoWindow);


}
项目:Ridr    文件:AcceptRiderView.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    gMap = googleMap;

    Calendar current = Calendar.getInstance();

    // Add night view for nice viewing when it's dark out
    // Dark styling is easier on the eyes
    SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss");
    if (nightTime(time.format(current.getTime()))) {
        MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(this, R.raw.maps_night_style);
        gMap.setMapStyle(style);
    }

    setupMap(request);

}
项目:SEPTA-Android    文件:NextToArriveTripDetailActivity.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    this.googleMap = googleMap;
    //googleMap.getUiSettings().setScrollGesturesEnabled(false);
    //googleMap.getUiSettings().setZoomControlsEnabled(false);
    //googleMap.getUiSettings().setZoomGesturesEnabled(false);
    googleMap.getUiSettings().setAllGesturesEnabled(false);
    googleMap.getUiSettings().setMapToolbarEnabled(false);
    googleMap.setOnMarkerClickListener(
            new GoogleMap.OnMarkerClickListener() {
                public boolean onMarkerClick(Marker marker) {
                    return true;
                }
            });

    MapStyleOptions mapStyle = MapStyleOptions.loadRawResourceStyle(this, R.raw.maps_json_styling);
    googleMap.setContentDescription("Map displaying selected route between " + start.getStopName() + " and " + destination.getStopName() + " with your vehicle location.");

    googleMap.setMapStyle(mapStyle);

    updateMap();
}
项目:ExtraMapUtils    文件:ListViewFragment.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    MapsInitializer.initialize(context);
    MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(context, R.raw.mapstyle_night);
    map = googleMap;
    map.setMapStyle(style);
    final ViewOption viewOption = (ViewOption) mapView.getTag();
    if (viewOption != null) {
        setMapLocation(viewOption, map, context);
    }
}
项目:SpaceRace    文件:MapActivity.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    this.map = googleMap;
    map.setMapStyle(
            MapStyleOptions.loadRawResourceStyle(
                    this, SharedPreferencesManager.getMapStyle()));
    map.setMinZoomPreference(8.0f);
}
项目:Taxi-App-Android-XML    文件:MyTrip.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;

    boolean success = googleMap.setMapStyle(new MapStyleOptions(getResources()
            .getString(R.string.style_json)));

    if (!success) {
        Log.e("Style", "Style parsing failed.");
    }
    LatLng jakarta = new LatLng(-6.232812, 106.820933);
    mMap.addMarker(new MarkerOptions().position(jakarta).icon(BitmapDescriptorFactory.fromBitmap(getBitmapFromView("Set Pickup Location", R.drawable.dot_pickup))));
    mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(jakarta, 15f));
}
项目:Runnest    文件:DisplayRunFragment.java   
/**
 * Called when the <code>GoogleMap</code> is ready. Initialize a MapHandler.
 *
 * @param googleMap     the <code>GoogleMap</code>
 */
@Override
public void onMapReady(GoogleMap googleMap) {
    MapStyleOptions mapStyle = MapStyleOptions.loadRawResourceStyle(getActivity(), R.raw.map_style_no_label);
    googleMap.setMapStyle(mapStyle);

    UtilsUI.recapDisplayTrackSetupUI(googleMap);
    UtilsUI.recapDisplayTrack(runToBeDisplayed.getTrack(), googleMap,
            ContextCompat.getColor(getContext(), R.color.colorAccent));
}
项目:Runnest    文件:ChallengeReceiverFragment.java   
/**
 * Called when the GoogleMap is ready. Initializes a MapHandler.
 *
 * @param googleMap     The GoogleMap, must be non null.
 */
@Override
public void onMapReady(GoogleMap googleMap) {

    if (googleMap == null) {
        throw new IllegalArgumentException("The GoogleMap can't be null");
    }

    MapStyleOptions mapStyle = MapStyleOptions.loadRawResourceStyle(getActivity(), R.raw.map_style_no_label);
    googleMap.setMapStyle(mapStyle);

    mapHandler = new MapHandler(googleMap, ContextCompat.getColor(getContext(), R.color.colorAccent));
    mapHandler.setupRunningMapUI();
}
项目:Runnest    文件:RunFragment.java   
/**
 * Called when the GoogleMap is ready. Initialize a MapHandler.
 *
 * @param googleMap     The GoogleMap must be non null.
 */
@Override
public void onMapReady(GoogleMap googleMap) {

    if (googleMap == null) {
        throw new IllegalArgumentException("The GoogleMap must be non null");
    }

    MapStyleOptions mapStyle = MapStyleOptions.loadRawResourceStyle(getActivity(), R.raw.map_style_no_label);
    googleMap.setMapStyle(mapStyle);
    mapHandler = new MapHandler(googleMap, ContextCompat.getColor(getContext(), R.color.colorAccent));
}
项目:Runnest    文件:DisplayChallengeFragment.java   
/**
 * Called when the <code>GoogleMap</code> is ready. Initialize a MapHandler.
 *
 * @param googleMap     the <code>GoogleMap</code>
 */
@Override
public void onMapReady(GoogleMap googleMap) {
    MapStyleOptions mapStyle = MapStyleOptions.loadRawResourceStyle(getActivity(), R.raw.map_style_no_label);

    switch(currentMapType) {

        case USER_MAP:
            Track userTrack = challengeToBeDisplayed.getMyRun().getTrack();
            googleMap.setMapStyle(mapStyle);

            UtilsUI.recapDisplayTrack(userTrack, googleMap, userColor);
            UtilsUI.recapDisplayTrackSetupUI(googleMap);

            currentMapType = MapType.OPPONENT_MAP;
            opponentMapView.getMapAsync(this);
            break;
        case OPPONENT_MAP:
            Track opponentTrack = challengeToBeDisplayed.getOpponentRun().getTrack();
            googleMap.setMapStyle(mapStyle);

            UtilsUI.recapDisplayTrack(opponentTrack, googleMap, opponentColor);
            UtilsUI.recapDisplayTrackSetupUI(googleMap);
            break;
        default:
            throw new IllegalStateException("unknown map type");
    }
}
项目:Hyke    文件:NearMeFragment.java   
@Override
public void onMapReady(GoogleMap map) {
    googleMap = map;
    try {
        googleMap.setMapStyle(
                MapStyleOptions.loadRawResourceStyle(
                        this.getContext(), R.raw.style_json));
        googleMap.setMyLocationEnabled(true);
        if (location != null){
            loadLocationByLatLng();
        }
    }catch (SecurityException e){}
}
项目:ThemedGoogleMap    文件:GoogleMapStyler.java   
/**
 * Call this method to build the GoogleMapStyler
 *
 * @return GoogleMapStyler
 */
public GoogleMapStyler build() {
    if (json.length() > 1) {
        json = json.deleteCharAt(json.length() - 1);
    }
    json = json.append("]");
    String temp = json.toString().replaceAll("\\\\", "");
    googleMapStyler.setMapStyleOptions(new MapStyleOptions(temp));
    return googleMapStyler;
}
项目:Ridr    文件:GeoView.java   
@Override
// Basic thing to do when the map is setup
// Callback for when the googleMap object is set up
public void onMapReady(GoogleMap googleMap) {
    // Make our map a map
    map = googleMap;

    // Allow the user to go home at any time
    map.setMyLocationEnabled(true);

    map.setOnMapLongClickListener(searchAtPoint);
    // What time is it?
    Calendar current = Calendar.getInstance();

    // Add night view for nice viewing when it's dark out
    // Dark styling is easier on the eyes
    SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss");
    if (nightTime(time.format(current.getTime()))) {
        MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(this, R.raw.maps_night_style);
        map.setMapStyle(style);
    }

    // Let's listen for clicks on our markers to display information
    map.setOnMarkerClickListener(showInfoWindow);
    map.setOnInfoWindowClickListener(goToRequest);
    map.setInfoWindowAdapter(displayRequest);

}
项目:Saude-no-Mapa    文件:EstablishmentPresenterImpl.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;
    MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(mContext, R.raw.map_style);
    mMap.setMapStyle(style);
    checkPermissions();
    configureMapClickListener();
}
项目:Saude-no-Mapa    文件:EmergencyPresenterImpl.java   
@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;
    MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(mContext, R.raw.map_style);
    mMap.setMapStyle(style);
    checkPermissions();
    configureMapClickListener();
}
项目:trail-android    文件:OverlayRouteActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_projection_route);

    View view = new FrameLayout(this);

    mSpinner = findViewById(R.id.spinner_location);
    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
        R.array.array_place, android.R.layout.simple_spinner_item);
    // Specify the layout to use when the list of choices appears
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner
    mSpinner.setAdapter(adapter);
    mSpinner.setOnItemSelectedListener(this);

    mSwitchCompat = findViewById(R.id.switch_btn);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        Window w = getWindow();
        w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
    }

    mapFragment = (TrailSupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    route = Data.getRoute();

    mapStyle = MapStyleOptions.loadRawResourceStyle(getApplicationContext(), R.raw.mapstyle);
}
项目:snazzymaps-browser    文件:SnazzyMapsStyle.java   
/**
 * Shortcut for applying this style to a {@link GoogleMap}.
 *
 * @param map The {@link GoogleMap} object to style.
 */
void applyToMap(GoogleMap map) {
    try {
        map.setMapStyle(new MapStyleOptions(mJson.getString("json")));
    } catch (JSONException e) {
        Log.e(TAG, e.toString());
    }
}
项目:iosched    文件:MapFragment.java   
@Override
public void onMapReady(GoogleMap googleMap) {

    // Initialise marker icons.
    ICON_ACTIVE = BitmapDescriptorFactory.fromBitmap(
            UIUtils.drawableToBitmap(getContext(), R.drawable.map_marker_selected));
    ICON_NORMAL = BitmapDescriptorFactory.fromBitmap(
            UIUtils.drawableToBitmap(getContext(), R.drawable.map_marker_unselected));

    mMap = googleMap;
    mMap.setMapStyle(MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.maps_style));
    mMap.setIndoorEnabled(false);
    mMap.setOnMarkerClickListener(this);
    mMap.setOnMapClickListener(this);
    mMap.setLatLngBoundsForCameraTarget(VIEWPORT);
    mMap.setMinZoomPreference(BuildConfig.MAP_VIEWPORT_MINZOOM);
    UiSettings mapUiSettings = mMap.getUiSettings();
    mapUiSettings.setZoomControlsEnabled(false);
    mapUiSettings.setMapToolbarEnabled(false);

    // This state is set via 'setMyLocationLayerEnabled.
    //noinspection MissingPermission
    mMap.setMyLocationEnabled(mMyLocationEnabled);

    // Move camera directly to the venue
    centerOnVenue(false);

    loadMapData();

    LOGD(TAG, "Map setup complete.");
}
项目:referendum_1o_android    文件:DelegatingGoogleMap.java   
@Override
public boolean setMapStyle(MapStyleOptions mapStyleOptions) {
    return real.setMapStyle(mapStyleOptions);
}
项目:referendum_1o_android    文件:GoogleMapWrapper.java   
@Override
public boolean setMapStyle(MapStyleOptions mapStyleOptions) {
    return map.setMapStyle(mapStyleOptions);
}
项目:GeoShare_Android    文件:MapsFragment.java   
public void setup() {
    MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(Application.getContext(), R.raw.map_style);
    this.googleMap.setMapStyle(style);

    if (ActivityCompat.checkSelfPermission(Application.getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
            && ActivityCompat.checkSelfPermission(Application.getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, GET_PERMS);
        return;
    }

    setupLocationChangeListener();

    if (!locationServiceEnabled) {
        locationSettingsRequest(Application.getContext());
        return;
    }

    isTracking = true;

    if (gpsTracking == null) {
        gpsTracking = new GPSTracking(getContext());
    }

    googleMap.setMyLocationEnabled(false);
    googleMap.setBuildingsEnabled(false);
    googleMap.getUiSettings().setCompassEnabled(false);
    googleMap.getUiSettings().setMyLocationButtonEnabled(false);
    googleMap.getUiSettings().setMapToolbarEnabled(false);

    /* FIREBASE TRACKING SETUP */
    setTrackingReference();

    /* USING CUSTOM GPS TRACKING MARKER */
    LatLng currentLocation = new LatLng(gpsTracking.getLatitude(), gpsTracking.getLongitude());

    Bitmap myLocationMarker = BitmapFactory.decodeResource(getResources(), R.drawable.navigation);
    Bitmap scaledLocation = Bitmap.createScaledBitmap(myLocationMarker, 72, 72, false);

    setCameraPosition(gpsTracking.getLatitude(), gpsTracking.getLongitude(), standardZoomLevel, false);
    myLocation = googleMap.addMarker(new MarkerOptions()
            .position(currentLocation)
            .flat(true)
            .icon(BitmapDescriptorFactory.fromBitmap(scaledLocation))
            .anchor(0.5f, 0.5f)
    );
    myLocation.setTag(0);

    nearbyRadius(currentLocation);
    //accuracyCircle(currentLocation, gpsTracking.getLocation().getAccuracy());

    trackingButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (!isTracking) {
                isTracking = true;
                trackingButton.setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimary)));

                if (listenerLocation != null) {
                    setCameraPosition(listenerLocation.getLatitude(), listenerLocation.getLongitude(), standardZoomLevel, true);
                } else {
                    setCameraPosition(gpsTracking.getLatitude(), gpsTracking.getLongitude(), standardZoomLevel, true);
                }

                if (selectedMarker != null) resetMarkerIcon(selectedMarker);
            }
        }
    });

    if (user != null) {
        shareReference.addChildEventListener(staticLocationListener);
    }
}
项目:Japp16    文件:GoogleJotiMap.java   
@Override
public boolean setMapStyle(MapStyleOptions mapStyleOptions) {
            return googleMap.setMapStyle(mapStyleOptions);
}
项目:Japp16    文件:OsmJotiMap.java   
public boolean setMapStyle(MapStyleOptions mapStyleOptions) {
    return false; //// TODO: 30/08/17
}
项目:geohashdroid    文件:BaseMapActivity.java   
@Override
public void mapTypeSelected(int type) {
    // 1 is night, -1 is day.
    short becomesNight = 0;

    // Map type!
    if(mMap != null) {
        switch(type) {
            case GoogleMap.MAP_TYPE_NORMAL:
                mMap.setMapStyle(null);
                becomesNight = -1;
                // Let's abuse a fallthrough!
            case GoogleMap.MAP_TYPE_HYBRID:
            case GoogleMap.MAP_TYPE_TERRAIN:
                mMap.setMapType(type);
                break;
            case MapTypeDialogFragment.MAP_STYLE_NIGHT:
                // Whoops, this one isn't a type.  It's a style.  First, the
                // type has to be normal for this to work.
                mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);

                // Then, load up the night style.
                if(!mMap.setMapStyle(MapStyleOptions.loadRawResourceStyle(this, R.raw.map_night)))
                    Log.e(DEBUG_TAG, "Couldn't parse the map style JSON!");

                becomesNight = 1;
                break;
        }
    }

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor edit = prefs.edit();
    edit.putInt(GHDConstants.PREF_LAST_MAP_TYPE, type);
    edit.apply();

    BackupManager bm = new BackupManager(this);
    bm.dataChanged();

    // Set the night only if it's changed at all.
    if(becomesNight == 1) setNightMode(true);
    else if(becomesNight == -1) setNightMode(false);
}
项目:buseta    文件:LwbStopListFragment.java   
/**
 * Manipulates the map once available.
 * This callback is triggered when the map is ready to be used.
 * If Google Play services is not installed on the device, the user will be prompted to install
 * it inside the SupportMapFragment. This method will only be triggered once the user has
 * installed Google Play services and returned to the app.
 */
@Override
public void onMapReady(GoogleMap googleMap) {
    map = googleMap;
    if (map == null) return;
    map.setMapStyle(MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.map_style));
    map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(22.3964, 114.1095), 10));
    GoogleMapOptions options = new GoogleMapOptions();
    options.mapToolbarEnabled(false);
    options.compassEnabled(true);
    options.rotateGesturesEnabled(true);
    options.scrollGesturesEnabled(false);
    options.tiltGesturesEnabled(true);
    options.zoomControlsEnabled(false);
    options.zoomGesturesEnabled(true);
    map.setBuildingsEnabled(false);
    map.setIndoorEnabled(false);
    map.setTrafficEnabled(false);
    map.setOnMarkerClickListener(this);
    if (ActivityCompat.checkSelfPermission(getContext(),
            Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||
            ActivityCompat.checkSelfPermission(getContext(),
                    Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
        map.setMyLocationEnabled(true);
    }
    if (busRouteStops != null && busRouteStops.size() > 0) {
        PolylineOptions line = new PolylineOptions().width(20).zIndex(1)
                .color(ContextCompat.getColor(getContext(), R.color.colorAccent));
        for (BusRouteStop stop: busRouteStops) {
            LatLng latLng = new LatLng(Double.parseDouble(stop.latitude), Double.parseDouble(stop.longitude));
            line.add(latLng);
            IconGenerator iconFactory = new IconGenerator(getContext());
            Bitmap bmp = iconFactory.makeIcon(stop.sequence + ": " + stop.name);
            map.addMarker(new MarkerOptions().position(latLng)
                    .icon(BitmapDescriptorFactory.fromBitmap(bmp))).setTag(stop);
        }
        line.startCap(new RoundCap());
        line.endCap(new RoundCap());
        map.addPolyline(line);
        if (busRouteStops.size() < goToStopPos) {
            goToStopPos = 0;
        }
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(
                new LatLng(Double.parseDouble(busRouteStops.get(goToStopPos).latitude),
                        Double.parseDouble(busRouteStops.get(goToStopPos).longitude)), 16));
    }
}
项目:buseta    文件:KmbStopListFragment.java   
/**
 * Manipulates the map once available.
 * This callback is triggered when the map is ready to be used.
 * If Google Play services is not installed on the device, the user will be prompted to install
 * it inside the SupportMapFragment. This method will only be triggered once the user has
 * installed Google Play services and returned to the app.
 */
@Override
public void onMapReady(GoogleMap googleMap) {
    map = googleMap;
    if (map == null) return;
    map.setMapStyle(MapStyleOptions.loadRawResourceStyle(getContext(), R.raw.map_style));
    map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(22.3964, 114.1095), 10));
    GoogleMapOptions options = new GoogleMapOptions();
    options.mapToolbarEnabled(false);
    options.compassEnabled(true);
    options.rotateGesturesEnabled(true);
    options.scrollGesturesEnabled(false);
    options.tiltGesturesEnabled(true);
    options.zoomControlsEnabled(false);
    options.zoomGesturesEnabled(true);
    map.setBuildingsEnabled(false);
    map.setIndoorEnabled(false);
    map.setTrafficEnabled(false);
    map.setOnMarkerClickListener(this);
    if (ActivityCompat.checkSelfPermission(getContext(),
            Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||
            ActivityCompat.checkSelfPermission(getContext(),
                    Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
        map.setMyLocationEnabled(true);
    }
    if (busRouteStops != null && busRouteStops.size() > 0) {
        PolylineOptions line = new PolylineOptions().width(20).zIndex(1)
                .color(ContextCompat.getColor(getContext(), R.color.colorAccent));
        for (BusRouteStop stop: busRouteStops) {
            LatLng latLng = new LatLng(Double.parseDouble(stop.latitude), Double.parseDouble(stop.longitude));
            line.add(latLng);
            IconGenerator iconFactory = new IconGenerator(getContext());
            Bitmap bmp = iconFactory.makeIcon(stop.sequence + ": " + stop.name);
            map.addMarker(new MarkerOptions().position(latLng)
                    .icon(BitmapDescriptorFactory.fromBitmap(bmp))).setTag(stop);
        }
        line.startCap(new RoundCap());
        line.endCap(new RoundCap());
        map.addPolyline(line);
        if (busRouteStops.size() < goToStopPos) {
            goToStopPos = 0;
        }
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(
                new LatLng(Double.parseDouble(busRouteStops.get(goToStopPos).latitude),
                        Double.parseDouble(busRouteStops.get(goToStopPos).longitude)), 16));
    }
}
项目:WiFi-Automatic    文件:Map.java   
@SuppressWarnings("MissingPermission")
@Override
public void onMapReady(final GoogleMap mMap) {
    MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(this, R.raw.map);
    mMap.setMapStyle(style);
    LatLng location = getIntent().getParcelableExtra("location");
    if (location == null) {
        mGoogleApiClient = new GoogleApiClient.Builder(this).addApi(LocationServices.API)
                .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {
                    @Override
                    public void onConnected(final Bundle bundle) {
                        android.location.Location l = LocationServices.FusedLocationApi
                                .getLastLocation(mGoogleApiClient);
                        if (l != null && mMap.getCameraPosition().zoom <= 2) {
                            mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(
                                    new LatLng(l.getLatitude(), l.getLongitude()), 16));
                        }
                        mGoogleApiClient.disconnect();
                    }

                    @Override
                    public void onConnectionSuspended(int cause) {
                        if (BuildConfig.DEBUG) Logger.log("connection suspended: " + cause);
                    }
                }).build();

        mGoogleApiClient.connect();

        mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
            @Override
            public void onMapClick(final LatLng center) {
                getIntent().putExtra("location", center);
                setResult(RESULT_OK, getIntent());
                finish();
            }
        });
    } else {
        mMap.addCircle(new CircleOptions().center(location).radius(100).strokeColor(Color.BLUE)
                .fillColor(Color.argb(64, 0, 0, 255)));
        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location, 16));
    }

    mMap.setMyLocationEnabled(true);
}
项目:ThemedGoogleMap    文件:GoogleMapStyler.java   
/**
 * Method returns the generated MapStyleOptions object to set to the google map.
 *
 * @return mapStyleOptions google map style options
 */
public MapStyleOptions getMapStyleOptions() {
    return mapStyleOptions;
}
项目:ThemedGoogleMap    文件:GoogleMapStyler.java   
/**
 * Method sets the MapStyleOptions object
 *
 * @param mapStyleOptions google map style options
 */
private void setMapStyleOptions(MapStyleOptions mapStyleOptions) {
    this.mapStyleOptions = mapStyleOptions;
}
项目:referendum_1o_android    文件:GoogleMap.java   
boolean setMapStyle(MapStyleOptions mapStyleOptions);
项目:referendum_1o_android    文件:IGoogleMap.java   
boolean setMapStyle(MapStyleOptions mapStyleOptions);
项目:Japp16    文件:IJotiMap.java   
public boolean setMapStyle(MapStyleOptions mapStyleOptions);