@Override public void setMapType(MapType type) { int nativeType = 0; switch (type) { case MAP_TYPE_NORMAL: nativeType = GoogleMap.MAP_TYPE_NORMAL; break; case MAP_TYPE_SATELLITE: nativeType = GoogleMap.MAP_TYPE_SATELLITE; break; case MAP_TYPE_TERRAIN: nativeType = GoogleMap.MAP_TYPE_TERRAIN; break; } googleMap.setMapType(nativeType); }
@Override public void onViewRecycled(RecyclerView.ViewHolder holder) { MapAdapter.ViewHolder mapHolder = (MapAdapter.ViewHolder) holder; if (mapHolder != null && mapHolder.map != null) { // Clear the map and free up resources by changing the map type to none. // Also reset the map when it gets reattached to layout, so the previous map would // not be displayed. mapHolder.map.clear(); mapHolder.map.setMapType(GoogleMap.MAP_TYPE_NONE); } } };
private void updateMapType() { // No toast because this can also be called by the Android framework in onResume() at which // point mMap may not be ready yet. if (mMap == null) { return; } String layerName = ((String) mSpinner.getSelectedItem()); if (layerName.equals(getString(R.string.normal))) { mMap.setMapType(MAP_TYPE_NORMAL); } else if (layerName.equals(getString(R.string.hybrid))) { mMap.setMapType(MAP_TYPE_HYBRID); } else if (layerName.equals(getString(R.string.satellite))) { mMap.setMapType(MAP_TYPE_SATELLITE); } else if (layerName.equals(getString(R.string.terrain))) { mMap.setMapType(MAP_TYPE_TERRAIN); } else if (layerName.equals(getString(R.string.none_map))) { mMap.setMapType(MAP_TYPE_NONE); } else { Log.i("LDA", "Error setting layer with name " + layerName); } }
@Override public void onMapReady(GoogleMap map) { map.setMapType(GoogleMap.MAP_TYPE_NONE); TileProvider tileProvider = new UrlTileProvider(256, 256) { @Override public synchronized URL getTileUrl(int x, int y, int zoom) { // The moon tile coordinate system is reversed. This is not normal. int reversedY = (1 << zoom) - y - 1; String s = String.format(Locale.US, MOON_MAP_URL_FORMAT, zoom, x, reversedY); URL url = null; try { url = new URL(s); } catch (MalformedURLException e) { throw new AssertionError(e); } return url; } }; mMoonTiles = map.addTileOverlay(new TileOverlayOptions().tileProvider(tileProvider)); mTransparencyBar.setOnSeekBarChangeListener(this); }
/** * Displays a {@link LiteListDemoActivity.NamedLocation} on a * {@link com.google.android.gms.maps.GoogleMap}. * Adds a marker and centers the camera on the NamedLocation with the normal map type. */ private void setMapLocation() { if (map == null) return; NamedLocation data = (NamedLocation) mapView.getTag(); if (data == null) return; // Add a marker for this item and set the camera map.moveCamera(CameraUpdateFactory.newLatLngZoom(data.location, 13f)); map.addMarker(new MarkerOptions().position(data.location)); // Set the map type back to normal. map.setMapType(GoogleMap.MAP_TYPE_NORMAL); }
@Override public final void setMapType(int type) { map.setMapType(type); }
@Override public void setMapType(Type type) { int googleMapType; switch (type) { case SATELLITE: googleMapType = GoogleMap.MAP_TYPE_SATELLITE; break; case NORMAL: default: googleMapType = GoogleMap.MAP_TYPE_NORMAL; break; } map.setMapType(googleMapType); }
@Override public void onMapReady(GoogleMap map) { Log.d(TAG, "onMapReady: " + map); this.map = map; // Configura o tipo do mapa map.setMapType(GoogleMap.MAP_TYPE_NORMAL); }
@Override public void onMapReady(GoogleMap map) { Log.d(TAG, "onMapReady: " + map); this.map = map; // Configura o tipo do mapa map.setMapType(GoogleMap.MAP_TYPE_NORMAL); }
public void toggleStyle() { if (GoogleMap.MAP_TYPE_NORMAL == mGoogleMap.getMapType()) { mGoogleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); } else { mGoogleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); } }
public static void toggleStyle(GoogleMap googleMap) { if (GoogleMap.MAP_TYPE_NORMAL == googleMap.getMapType()) { googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); } else { googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); } }
@Override public void onMovedToScrapHeap(View view) { ViewHolder holder = (ViewHolder) view.getTag(); if (holder != null && holder.map != null) { holder.map.clear(); holder.map.setMapType(GoogleMap.MAP_TYPE_NONE); } } };
@Override public void onMapReady(GoogleMap googleMap) { mapReady = true; this.googleMap = googleMap; this.googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); flyHere(NEWDELHI); }
@Override public void onMapReady(GoogleMap googleMap) { map = googleMap; map.setMapType(GoogleMap.MAP_TYPE_NORMAL); customMap = new CustomMap(map, latLngsArrayList, MainActivity.this); try { customMap.setCustomMapStyle(R.raw.mapstyle); // Customise the styling of the base map using a JSON object defined in a raw resource file. } catch (Resources.NotFoundException e) { Log.e("Explore detail activity", "Can't find style. Error: " + e); } handleMap(); } });
/** * Change between normal map, satellite hybrid and terrain view * * @param newView the new view, should be one of GoogleMap.MAP_TYPE_NORMAL, * GoogleMap.MAP_TYPE_HYBRID or GoogleMap.MAP_TYPE_TERRAIN */ private void changeView(int newView) { if (mMap != null) mMap.setMapType(newView); drawerListAdapert.changeView(newView); if (mDrawerLayout != null) mDrawerLayout.closeDrawers(); getSharedPreferences("settings", Context.MODE_PRIVATE).edit().putInt("mapView", newView) .commit(); }
@Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); mMap.animateCamera(CameraUpdateFactory.zoomTo(17)); }
@Override public void onClick(View v) { mMap.setMapType(mMap.getMapType() == GoogleMap.MAP_TYPE_SATELLITE ? GoogleMap.MAP_TYPE_NORMAL : GoogleMap.MAP_TYPE_SATELLITE); btnSatellite.setImageResource(mMap.getMapType() == GoogleMap.MAP_TYPE_SATELLITE ? R.drawable.ic_satellite_off : R.drawable.ic_satellite_on); } });
@Override public void onMapReady(GoogleMap googleMap) { map = googleMap; map.setMapType(GoogleMap.MAP_TYPE_NORMAL); customMap = new CustomMap(map, latLngsArrayList, MainActivity.this); try { customMap.setCustomMapStyle(R.raw.mapstyle); // Customise the styling of the base map using a JSON object defined in a raw resource file. } catch (Resources.NotFoundException e) { Log.e("Explore detail activity", "Can't find style. Error: " + e); } handleMap(); customMap.addCustomPin(); event_pager.setAdapter(new MapViewPagerAdapter(MainActivity.this, latLngsArrayList)); } });
public void setMapData(LatLng newLatLng){ if(map!=null){ map.moveCamera(CameraUpdateFactory.newLatLngZoom(newLatLng, 13f)); map.addMarker(new MarkerOptions().position(newLatLng)); map.setMapType(GoogleMap.MAP_TYPE_NORMAL); }else{ Log.e("Map","Map null"); } }
@Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); mMap.animateCamera(CameraUpdateFactory.zoomTo(17)); if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { mMap.setMyLocationEnabled(true); } PolylineOptions polylineOptions = new PolylineOptions() .color(Color.CYAN) .geodesic(true); mPolyline = mMap.addPolyline(polylineOptions); }