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

项目:saarang-iosched    文件:MapFragment.java   
void addTileProvider(int floor, File f) {
    if (!f.exists()) {
        return;
    }
    TileProvider provider;
    try {
        SVGTileProvider svgProvider = new SVGTileProvider(f, mDPI);
        if (mTileCache == null) {
            // Use the SVGTileProvider directly as the TileProvider without a cache
            provider = svgProvider;
        } else {
            // Wrap the SVGTileProvider ina a CachedTileProvider for caching on disk
            provider = new CachedTileProvider(Integer.toString(floor), svgProvider, mTileCache);
        }
    } catch (IOException e) {
        LogUtils.LOGD(TAG, "Could not create Tile Provider.");
        return;
    }

    TileOverlayOptions tileOverlay = new TileOverlayOptions()
            .tileProvider(provider).visible(false);

    mTileProviders.put(floor, provider);
    mTileOverlays.put(floor, mMap.addTileOverlay(tileOverlay));
}
项目:SISTEM-INFORMASI-GEOGRAFIS-LOKASI-RESTORAN-DI-KOTA-BANDUNG-SUB-MODUL-ANDROID-BASE-APPLICATION-    文件:TileOverlayDemoActivity.java   
@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, y, x);
            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);
}
项目:FiveMinsMore    文件:TileUtils.java   
public static void setMapFile(MapsActivity context) {
    MapsForgeTilesProvider provider;
    try {
         provider = new MapsForgeTilesProvider(
                 context.getApplication(), new File(mapFile), new File(themeFile));
    } catch (Exception e) {
        mapFile = null;
        e.printStackTrace();
        Toast.makeText(context, "無法開啟檔案", Toast.LENGTH_SHORT).show();
        return;
    }

    TileOverlay lastTile = context.getMapsManager().getCurrentMapTile();
    if (lastTile != null)
        lastTile.remove();

    MapsManager manager = context.getMapsManager();
    manager.setCurrentMapTile(manager.getCurrentMap().addTileOverlay(
            new TileOverlayOptions().tileProvider(provider)));
    manager.getCurrentMapTile().setZIndex(ZINDEX_BASEMAP);
    manager.getCurrentMap().setMapType(GoogleMap.MAP_TYPE_NONE);
}
项目:iosched-reader    文件:MapFragment.java   
private void onTilesLoaded(List<TileLoadingTask.TileEntry> list) {
    if (list != null) {
        // Display tiles if they have been loaded, skip them otherwise but display the rest of
        // the map.
        for (TileLoadingTask.TileEntry entry : list) {
            TileOverlayOptions tileOverlay = new TileOverlayOptions()
                    .tileProvider(entry.provider).visible(false);

            // Store the tile overlay and provider
            mTileProviders.put(entry.floor, entry.provider);
            mTileOverlays.put(entry.floor, mMap.addTileOverlay(tileOverlay));
        }
    }

    enableMapElements();
}
项目:smconf-android    文件:MapFragment.java   
private void onTilesLoaded(List<TileLoadingTask.TileEntry> list) {
    if (list != null) {
        // Display tiles if they have been loaded, skip them otherwise but display the rest of
        // the map.
        for (TileLoadingTask.TileEntry entry : list) {
            TileOverlayOptions tileOverlay = new TileOverlayOptions()
                    .tileProvider(entry.provider).visible(false);

            // Store the tile overlay and provider
            mTileProviders.put(entry.floor, entry.provider);
            mTileOverlays.put(entry.floor, mMap.addTileOverlay(tileOverlay));
        }
    }

    enableMapElements();
}
项目:2015-Google-I-O-app    文件:MapFragment.java   
private void onTilesLoaded(List<TileLoadingTask.TileEntry> list) {
    if (list != null) {
        // Display tiles if they have been loaded, skip them otherwise but display the rest of
        // the map.
        for (TileLoadingTask.TileEntry entry : list) {
            TileOverlayOptions tileOverlay = new TileOverlayOptions()
                    .tileProvider(entry.provider).visible(false);

            // Store the tile overlay and provider
            mTileProviders.put(entry.floor, entry.provider);
            mTileOverlays.put(entry.floor, mMap.addTileOverlay(tileOverlay));
        }
    }

    enableMapElements();
}
项目:FMTech    文件:MapFragment.java   
private void onTilesLoaded(List<TileLoadingTask.TileEntry> list) {
    if (list != null) {
        // Display tiles if they have been loaded, skip them otherwise but display the rest of
        // the map.
        for (TileLoadingTask.TileEntry entry : list) {
            TileOverlayOptions tileOverlay = new TileOverlayOptions()
                    .tileProvider(entry.provider).visible(false);

            // Store the tile overlay and provider
            mTileProviders.put(entry.floor, entry.provider);
            mTileOverlays.put(entry.floor, mMap.addTileOverlay(tileOverlay));
        }
    }

    enableMapElements();
}
项目:mage-android    文件:MapFragment.java   
/**
 * Add XYZ Directory tile cache overlay
 * @param enabledCacheOverlays
 * @param xyzDirectoryCacheOverlay
 */
private void addXYZDirectoryCacheOverlay(Map<String, CacheOverlay> enabledCacheOverlays, XYZDirectoryCacheOverlay xyzDirectoryCacheOverlay){
    // Retrieve the cache overlay if it already exists (and remove from cache overlays)
    CacheOverlay cacheOverlay = cacheOverlays.remove(xyzDirectoryCacheOverlay.getCacheName());
    if(cacheOverlay == null){
        // Create a new tile provider and add to the map
        TileProvider tileProvider = new FileSystemTileProvider(256, 256, xyzDirectoryCacheOverlay.getDirectory().getAbsolutePath());
        TileOverlayOptions overlayOptions = createTileOverlayOptions(tileProvider);
        // Set the tile overlay in the cache overlay
        TileOverlay tileOverlay = map.addTileOverlay(overlayOptions);
        xyzDirectoryCacheOverlay.setTileOverlay(tileOverlay);
        cacheOverlay = xyzDirectoryCacheOverlay;
    }
    // Add the cache overlay to the enabled cache overlays
    enabledCacheOverlays.put(cacheOverlay.getCacheName(), cacheOverlay);
}
项目:AppDevFestSudeste2015    文件:MapFragment.java   
void addTileProvider(int floor, File f) {
    if (!f.exists()) {
        return;
    }
    TileProvider provider;
    try {
        SVGTileProvider svgProvider = new SVGTileProvider(f, mDPI);
        if (mTileCache == null) {
            // Use the SVGTileProvider directly as the TileProvider without a cache
            provider = svgProvider;
        } else {
            // Wrap the SVGTileProvider ina a CachedTileProvider for caching on disk
            provider = new CachedTileProvider(Integer.toString(floor), svgProvider, mTileCache);
        }
    } catch (IOException e) {
        LOGD(TAG, "Could not create Tile Provider.");
        return;
    }

    TileOverlayOptions tileOverlay = new TileOverlayOptions()
            .tileProvider(provider).visible(false);

    mTileProviders.put(floor, provider);
    mTileOverlays.put(floor, mMap.addTileOverlay(tileOverlay));
}
项目:QuizUpWinner    文件:GoogleMap.java   
public final TileOverlay addTileOverlay(TileOverlayOptions paramTileOverlayOptions)
{
  try
  {
    f localf = this.Br.addTileOverlay(paramTileOverlayOptions);
    if (localf != null)
    {
      TileOverlay localTileOverlay = new TileOverlay(localf);
      return localTileOverlay;
    }
    return null;
  }
  catch (RemoteException localRemoteException)
  {
    throw new RuntimeRemoteException(localRemoteException);
  }
}
项目:devfestnorte-app    文件:MapFragment.java   
void addTileProvider(int floor, File f) {
    if (!f.exists()) {
        return;
    }
    TileProvider provider;
    try {
        SVGTileProvider svgProvider = new SVGTileProvider(f, mDPI);
        if (mTileCache == null) {
            // Use the SVGTileProvider directly as the TileProvider without a cache
            provider = svgProvider;
        } else {
            // Wrap the SVGTileProvider ina a CachedTileProvider for caching on disk
            provider = new CachedTileProvider(Integer.toString(floor), svgProvider, mTileCache);
        }
    } catch (IOException e) {
        LOGD(TAG, "Could not create Tile Provider.");
        return;
    }

    TileOverlayOptions tileOverlay = new TileOverlayOptions()
            .tileProvider(provider).visible(false);

    mTileProviders.put(floor, provider);
    mTileOverlays.put(floor, mMap.addTileOverlay(tileOverlay));
}
项目:XamarinAdmobTutorial    文件:TileOverlayDemoActivity.java   
private void setUpMap() {
    mMap.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 = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(tileProvider));
}
项目:saarang-iosched    文件:MapFragment.java   
void addTileProvider(int floor, File f) {
    if (!f.exists()) {
        return;
    }
    TileProvider provider;
    try {
        SVGTileProvider svgProvider = new SVGTileProvider(f, mDPI);
        if (mTileCache == null) {
            // Use the SVGTileProvider directly as the TileProvider without a cache
            provider = svgProvider;
        } else {
            // Wrap the SVGTileProvider ina a CachedTileProvider for caching on disk
            provider = new CachedTileProvider(Integer.toString(floor), svgProvider, mTileCache);
        }
    } catch (IOException e) {
        LogUtils.LOGD(TAG, "Could not create Tile Provider.");
        return;
    }

    TileOverlayOptions tileOverlay = new TileOverlayOptions()
            .tileProvider(provider).visible(false);

    mTileProviders.put(floor, provider);
    mTileOverlays.put(floor, mMap.addTileOverlay(tileOverlay));
}
项目:HereAStory-Android    文件:TileOverlayDemoActivity.java   
private void setUpMap() {
    mMap.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 = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(tileProvider));
}
项目:GoogleMapsV2Demo    文件:TileOverlayDemoActivity.java   
private void setUpMap() {
    mMap.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;
        }
    };

    mMap.addTileOverlay(new TileOverlayOptions().tileProvider(tileProvider));
}
项目:opentravelmate    文件:NativeMap.java   
/**
 * Add an overlay to the map.
 * 
 * @param id
    *     Map place holder ID.
 * @param jsonTileOverlay
 *     JSON serialized TileOverlay.
 */
@JavascriptInterface
public void addTileOverlay(final String id, final String jsonTileOverlay) {
    final GoogleMap map = getGoogleMapSync(id);

    UIThreadExecutor.execute(postponeWhenMapIsInvisible(id, new Runnable() {
        @Override public void run() {
            try {
                TileOverlay tileOverlay = TileOverlay.fromJsonTileOverlay(new JSONObject(jsonTileOverlay));

                TileProvider tileProvider = new UrlPatternTileProvider(tileOverlay.tileUrlPattern, tileOverlay.enableGrayscaleFilter);
                com.google.android.gms.maps.model.TileOverlay gTileOverlay = map.addTileOverlay(new TileOverlayOptions()
                    .tileProvider(tileProvider)
                    .zIndex(tileOverlay.zIndex));
                tileOverlayById.put(tileOverlay.id, gTileOverlay);
            } catch (JSONException e) {
                exceptionListener.onException(false, e);
            }
        }
    }));
}
项目:ZalartAndroid    文件:Util.java   
/**
 * Sets which map tile to use
 * 
 * @param context
 *            The calling Activity
 * @param map
 *            The GoogleMap
 */
public static void setMapTile(Context context, GoogleMap map) {
    // load preferences
    Preferences.loadSettings(context);
    TileOverlayOptions osm = new TileOverlayOptions()
            .tileProvider(new OpenStreetMapTileProvider());

    TileOverlayOptions mapbox = new TileOverlayOptions()
            .tileProvider(new MapBoxTileProvider());

    final String mapTile = Preferences.mapTiles;
    if (map != null) {
        map.setMapType(GoogleMap.MAP_TYPE_NONE);
        map.addTileOverlay(osm).remove();
        map.addTileOverlay(mapbox).remove();
        map.clear();
        if (mapTile.equals("google")) {
            map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
        } else if (mapTile.equals("osm")) {
            map.addTileOverlay(osm);
        } else {
            map.addTileOverlay(mapbox);
        }
    }
}
项目:android-maps-utils    文件:HeatmapsDemoActivity.java   
public void onItemSelected(AdapterView<?> parent, View view,
                           int pos, long id) {
    String dataset = parent.getItemAtPosition(pos).toString();

    TextView attribution = ((TextView) findViewById(R.id.attribution));

    // Check if need to instantiate (avoid setData etc twice)
    if (mProvider == null) {
        mProvider = new HeatmapTileProvider.Builder().data(
                mLists.get(getString(R.string.police_stations)).getData()).build();
        mOverlay = getMap().addTileOverlay(new TileOverlayOptions().tileProvider(mProvider));
        // Render links
        attribution.setMovementMethod(LinkMovementMethod.getInstance());
    } else {
        mProvider.setData(mLists.get(dataset).getData());
        mOverlay.clearTileCache();
    }
    // Update attribution
    attribution.setText(Html.fromHtml(String.format(getString(R.string.attrib_format),
            mLists.get(dataset).getUrl())));

}
项目:iosched2013    文件:MapFragment.java   
void addTileProvider(int floor, File f) {
    if (!f.exists()) {
        return;
    }

    TileProvider provider;
    try {
        provider = new SVGTileProvider(f, mDPI);
    } catch (IOException e) {
        LOGD(TAG, "Could not create Tile Provider.");
        e.printStackTrace();
        return;
    }
    TileOverlayOptions tileOverlay = new TileOverlayOptions()
            .tileProvider(provider).visible(false);
    mTileProviders[floor] = provider;
    mTileOverlays[floor] = mMap.addTileOverlay(tileOverlay);
}
项目:Companion-For-PUBG-Android    文件:GoogleMapControllerImpl.java   
/**
 * Will overlay the current {@link GoogleMap} with tiles for PUBG.
 */
private void setUpMap() {
    final TileOverlayOptions overlayOptions = new TileOverlayOptions();
    overlayOptions.tileProvider(new PUBGTileProvider());
    this.googleMap.setMaxZoomPreference(5);
    this.googleMap.setMapType(GoogleMap.MAP_TYPE_NONE);
    this.googleMap.addTileOverlay(overlayOptions);
    this.googleMap.getUiSettings().setMapToolbarEnabled(false);
}
项目:FiveMinsMore    文件:TileUtils.java   
public static void pickAdditionalTile(final Context context) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle("選擇疊加圖層")
            .setItems(ADDITION_TILES, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    MapsManager manager = ((MapsActivity) context).getMapsManager();
                    GoogleMap map = manager.getCurrentMap();
                    switch (which) {
                        case 1:
                            manager.addMapAddTiles(map.addTileOverlay(
                                    new TileOverlayOptions().tileProvider(
                                            new CoorTileProvider(context, Color.BLACK))));
                            break;

                        case 2:
                            manager.addMapAddTiles(map.addTileOverlay(
                                    new TileOverlayOptions().tileProvider(
                                            new CoorTileProvider(context, Color.WHITE))));
                            break;

                        case 4:
                            manager.clearCurrentMapAddTiles();
                            break;

                        default:
                            TileOverlay tileOverlay = map.addTileOverlay(
                                    getTileSetting(URL_ADDITIONAL_TILES[which].toString()));
                            tileOverlay.setZIndex(ZINDEX_ADDTILE);
                            manager.addMapAddTiles(tileOverlay);
                    }
                }
            });
    builder.show();
}
项目:GoogleMapsLayout-Android    文件:CachingUrlTileProvider.java   
/**
 * Creates a new TileOverlayOptions object to be used with {@link com.google.android.gms.maps.GoogleMap#addTileOverlay(TileOverlayOptions) map.addTileOverlay()}
 * @return a TileOverlayOptions with this object set as a tile provider plus fadeIn set to false
 */
public TileOverlayOptions createTileOverlayOptions() {
    TileOverlayOptions tileOverlayOptions = new TileOverlayOptions().tileProvider(this);

    // set fadeIn to false for all GMS versions that support it
    try {
        Class.forName("com.google.android.gms.maps.model.TileOverlayOptions")
                .getMethod("fadeIn", boolean.class)
                .invoke(tileOverlayOptions, false);
    } catch (Exception e) {
    }

    return tileOverlayOptions;
}
项目:oma-riista-android    文件:EntryMapView.java   
@SuppressLint("RtlHardcoded")
private void setUpMap() {
    if (mMap == null) {
        return;
    }

    if (mTiletype != AppPreferences.MapTileSource.GOOGLE) {
        mMap.setMapType(GoogleMap.MAP_TYPE_NONE);
        mMap.setMyLocationEnabled(false);
        mMap.setMaxZoomPreference(MAP_ZOOM_LEVEL_MAX);
        mMap.setMinZoomPreference(MAP_ZOOM_LEVEL_MIN);

        mTileProvider = new MmlTileProvider(256, 256);
        mTileProvider.setMapType(mTiletype);

        mMmlOverlay = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(mTileProvider).zIndex(1f));

        if (mCopyrightText == null) {
            mCopyrightText = setupCopyright();
            addView(mCopyrightText);
        } else {
            mCopyrightText.setText(R.string.map_copyright_mml);
        }
    }

    if (mUpdatedLocation != null) {
        onLocationUpdated(mUpdatedLocation);
        mUpdatedLocation = null;
    }
}
项目:treehugger    文件:HeatMapLoader.java   
@Override
protected void onPostExecute(List<LatLng> list) {
    if (!list.isEmpty()) {
        mProvider = new HeatmapTileProvider.Builder()
                .data(list)
                .build();
        callback.updateHeatMap(new TileOverlayOptions().tileProvider(mProvider));
    }
}
项目:ttnmapper_android_v2    文件:MapsActivity.java   
public void onToggleCoverage(View v) {
    if (mMap == null) {
        return;
    }

    com.github.clans.fab.FloatingActionButton floatingActionButton = (com.github.clans.fab.FloatingActionButton) findViewById(R.id.fabItemCoverage);
    SharedPreferences myPrefs = this.getSharedPreferences(SettingConstants.PREFERENCES, MODE_PRIVATE);
    boolean previousState = myPrefs.getBoolean(SettingConstants.COVERAGE, SettingConstants.COVERAGE_DEFAULT);

    SharedPreferences.Editor prefsEditor = myPrefs.edit();
    prefsEditor.putBoolean(SettingConstants.COVERAGE, !previousState);
    prefsEditor.apply();

    if (previousState) {
        floatingActionButton.setColorNormalResId(R.color.fab_disabled);
        floatingActionButton.setColorPressedResId(R.color.fab_disabled_pressed);

        clearAndReaddAllToMap();
    } else {
        floatingActionButton.setColorNormalResId(R.color.fab_green_dark);
        floatingActionButton.setColorPressedResId(R.color.fab_green_light);

        CoverageTileProvider mTileProvider = new CoverageTileProvider(256, 256, getString(R.string.ttnmapper_tms_url));
        TileOverlayOptions options = new TileOverlayOptions();
        options.tileProvider(mTileProvider);
        options.transparency((float) 0.8);
        mMap.addTileOverlay(options);
    }

    Answers.getInstance().logCustom(new CustomEvent(SettingConstants.COVERAGE)
            .putCustomAttribute("on", "" + !previousState));
}
项目:PhoneChat    文件:PluginTileOverlay.java   
/**
 * Create tile overlay
 * 
 * @param args
 * @param callbackContext
 * @throws JSONException
 */
@SuppressWarnings("unused")
private void createTileOverlay(final JSONArray args,
  final CallbackContext callbackContext) throws JSONException {

  JSONObject opts = args.getJSONObject(1);
  int tileSize = opts.getInt("tileSize");
  final String tileUrlFormat = opts.getString("tileUrlFormat");

  double opacity = 1.0;
  if (opts.has("opacity")) {
    opacity = opts.getDouble("opacity");
  }
  PluginTileProvider tileProvider = new PluginTileProvider(tileUrlFormat, opacity, tileSize);

  TileOverlayOptions options = new TileOverlayOptions();
  options.tileProvider(tileProvider);
  if (opts.has("zIndex")) {
    options.zIndex((float)opts.getDouble("zIndex"));
  }
  if (opts.has("visible")) {
    options.visible(opts.getBoolean("visible"));
  }
  TileOverlay tileOverlay = this.map.addTileOverlay(options);
  String id = "tile_" + tileOverlay.getId();

  this.objects.put(id, tileOverlay);
  this.objects.put(id.replace("tile_", "tileProvider_"), tileProvider);

  JSONObject result = new JSONObject();
  result.put("hashCode", tileOverlay.hashCode());
  result.put("id", id);
  callbackContext.success(result);
}
项目:Tower-develop    文件:GoogleMapFragment.java   
private void setupArcGISTileProvider(Context context, GoogleMap map){
    Timber.i("Enabling ArcGIS tile provider.");

    //Remove the default google map layer
    map.setMapType(GoogleMap.MAP_TYPE_NORMAL);

    final GoogleMapPrefFragment.PrefManager prefManager = GoogleMapPrefFragment.PrefManager;
    String selectedMap = prefManager.getArcGISMapType(context);

    if(!(tileProviderManager instanceof ArcGISTileProviderManager)
        || !selectedMap.equals(((ArcGISTileProviderManager) tileProviderManager).getSelectedMap())){

        //Setup the online tile overlay
        if(onlineTileOverlay != null){
            onlineTileOverlay.remove();
            onlineTileOverlay = null;
        }

        tileProviderManager = new ArcGISTileProviderManager(context, selectedMap);
        TileOverlayOptions options = new TileOverlayOptions()
            .tileProvider(tileProviderManager.getOnlineTileProvider())
            .zIndex(ONLINE_TILE_PROVIDER_Z_INDEX);

        onlineTileOverlay = map.addTileOverlay(options);

        //Setup the offline tile overlay
        if(offlineTileOverlay != null){
            offlineTileOverlay.remove();
            offlineTileOverlay = null;
        }

        if(prefManager.isOfflineMapLayerEnabled(context)){
            options = new TileOverlayOptions()
                .tileProvider(tileProviderManager.getOfflineTileProvider())
                .zIndex(OFFLINE_TILE_PROVIDER_Z_INDEX);

            offlineTileOverlay = map.addTileOverlay(options);
        }
    }
}
项目:FMTech    文件:fkq.java   
public static TileOverlayOptions a(Parcel paramParcel)
{
  boolean bool1 = false;
  int i = efj.a(paramParcel);
  IBinder localIBinder = null;
  float f = 0.0F;
  boolean bool2 = true;
  int j = 0;
  while (paramParcel.dataPosition() < i)
  {
    int k = paramParcel.readInt();
    switch (0xFFFF & k)
    {
    default: 
      efj.b(paramParcel, k);
      break;
    case 1: 
      efj.a(paramParcel, k, 4);
      j = paramParcel.readInt();
      break;
    case 2: 
      localIBinder = efj.f(paramParcel, k);
      break;
    case 3: 
      bool1 = efj.c(paramParcel, k);
      break;
    case 4: 
      efj.a(paramParcel, k, 4);
      f = paramParcel.readFloat();
      break;
    case 5: 
      bool2 = efj.c(paramParcel, k);
    }
  }
  if (paramParcel.dataPosition() != i) {
    throw new bm("Overread allowed size end=" + i, paramParcel);
  }
  return new TileOverlayOptions(j, localIBinder, bool1, f, bool2);
}
项目:mage-android    文件:MapFragment.java   
/**
 * Create Tile Overlay Options for the Tile Provider using the z index
 * @param tileProvider
 * @param zIndex
 * @return
 */
private TileOverlayOptions createTileOverlayOptions(TileProvider tileProvider, int zIndex){
    TileOverlayOptions overlayOptions = new TileOverlayOptions();
    overlayOptions.tileProvider(tileProvider);
    overlayOptions.zIndex(zIndex);
    return overlayOptions;
}
项目:MAST-MOBILE    文件:MapViewerActivity.java   
private void loadOfflineData(int pos) {
    try {
        String extPath = Environment.getExternalStorageDirectory().getAbsolutePath();
        String filepath = extPath + "/" + CommonFunctions.parentFolderName + "/" + CommonFunctions.dataFolderName
                + "/" + offlineSpatialData.get(pos).getFile_Name();
        OfflineTileProvider provider = offlineSpatialData.get(pos).getProvider();
        File mbtileFile = new File(filepath);

        TileOverlayOptions opts = new TileOverlayOptions();
        if (provider == null) {
            // Create an instance of OfflineTileProvider.
            provider = new OfflineTileProvider(mbtileFile);
            offlineSpatialData.get(pos).setProvider(provider);
        }
        // Set the tile provider on the TileOverlayOptions.
        opts.tileProvider(provider);
        // Add the tile overlay to the map.
        TileOverlay overlay = googleMap.addTileOverlay(opts);
        offlineSpatialData.get(pos).setOverlay(overlay);

        // Sometime later when the map view is destroyed, close the provider.
        // This is important to prevent a leak of the backing SQLiteDatabase.
        provider.close();
    } catch (Exception e) {
        cf.appLog("", e);
        //String msg = getResources().getString(R.string.unableToLoadOfflineData);
        //Toast.makeText(context,msg+": "+offlineSpatialData.get(pos).getAlias(), Toast.LENGTH_SHORT).show();
    }
}
项目:MAST-MOBILE    文件:CaptureDataMapActivity.java   
private void loadOfflineData(int pos) {
    try {
        String extPath = Environment.getExternalStorageDirectory().getAbsolutePath();
        String filepath = extPath + "/" + CommonFunctions.parentFolderName + "/" + CommonFunctions.dataFolderName
                + "/" + offlineSpatialData.get(pos).getFile_Name();
        OfflineTileProvider provider = offlineSpatialData.get(pos).getProvider();
        File mbtileFile = new File(filepath);

        TileOverlayOptions opts = new TileOverlayOptions();
        if (provider == null) {
            // Create an instance of OfflineTileProvider.
            provider = new OfflineTileProvider(mbtileFile);
            offlineSpatialData.get(pos).setProvider(provider);
        }
        // Set the tile provider on the TileOverlayOptions.
        opts.tileProvider(provider);
        // Add the tile overlay to the map.
        TileOverlay overlay = googleMap.addTileOverlay(opts);
        offlineSpatialData.get(pos).setOverlay(overlay);

        // Sometime later when the map view is destroyed, close the provider.
        // This is important to prevent a leak of the backing SQLiteDatabase.
        provider.close();
    } catch (Exception e) {
        cf.appLog("", e);
        String msg = getResources().getString(R.string.unableToLoadOfflineData);
        Toast.makeText(context, msg + ": " + offlineSpatialData.get(pos).getAlias(), Toast.LENGTH_SHORT).show();
    }
}
项目:DroidPlanner-Tower    文件:GoogleMapFragment.java   
private void setupOfflineMapOverlay(GoogleMap map) {
    map.setMapType(GoogleMap.MAP_TYPE_NONE);
    TileOverlay tileOverlay = map.addTileOverlay(new TileOverlayOptions()
            .tileProvider(new LocalMapTileProvider()));
    tileOverlay.setZIndex(-1);
    tileOverlay.clearTileCache();
}
项目:neo4art    文件:PluginTileOverlay.java   
/**
 * Create tile overlay
 * 
 * @param args
 * @param callbackContext
 * @throws JSONException
 */
@SuppressWarnings("unused")
private void createTileOverlay(final JSONArray args,
  final CallbackContext callbackContext) throws JSONException {

  JSONObject opts = args.getJSONObject(1);
  int tileSize = opts.getInt("tileSize");
  final String tileUrlFormat = opts.getString("tileUrlFormat");

  double opacity = 1.0;
  if (opts.has("opacity")) {
    opacity = opts.getDouble("opacity");
  }
  PluginTileProvider tileProvider = new PluginTileProvider(tileUrlFormat, opacity, tileSize);

  TileOverlayOptions options = new TileOverlayOptions();
  options.tileProvider(tileProvider);
  if (opts.has("zIndex")) {
    options.zIndex((float)opts.getDouble("zIndex"));
  }
  if (opts.has("visible")) {
    options.visible(opts.getBoolean("visible"));
  }
  TileOverlay tileOverlay = this.map.addTileOverlay(options);
  String id = "tile_" + tileOverlay.getId();

  this.objects.put(id, tileOverlay);
  this.objects.put(id.replace("tile_", "tileProvider_"), tileProvider);

  JSONObject result = new JSONObject();
  result.put("hashCode", tileOverlay.hashCode());
  result.put("id", id);
  callbackContext.success(result);
}
项目:neo4art    文件:PluginTileOverlay.java   
/**
 * Create tile overlay
 * 
 * @param args
 * @param callbackContext
 * @throws JSONException
 */
@SuppressWarnings("unused")
private void createTileOverlay(final JSONArray args,
  final CallbackContext callbackContext) throws JSONException {

  JSONObject opts = args.getJSONObject(1);
  int tileSize = opts.getInt("tileSize");
  final String tileUrlFormat = opts.getString("tileUrlFormat");

  double opacity = 1.0;
  if (opts.has("opacity")) {
    opacity = opts.getDouble("opacity");
  }
  PluginTileProvider tileProvider = new PluginTileProvider(tileUrlFormat, opacity, tileSize);

  TileOverlayOptions options = new TileOverlayOptions();
  options.tileProvider(tileProvider);
  if (opts.has("zIndex")) {
    options.zIndex((float)opts.getDouble("zIndex"));
  }
  if (opts.has("visible")) {
    options.visible(opts.getBoolean("visible"));
  }
  TileOverlay tileOverlay = this.map.addTileOverlay(options);
  String id = "tile_" + tileOverlay.getId();

  this.objects.put(id, tileOverlay);
  this.objects.put(id.replace("tile_", "tileProvider_"), tileProvider);

  JSONObject result = new JSONObject();
  result.put("hashCode", tileOverlay.hashCode());
  result.put("id", id);
  callbackContext.success(result);
}
项目:neo4art    文件:PluginTileOverlay.java   
/**
 * Create tile overlay
 * 
 * @param args
 * @param callbackContext
 * @throws JSONException
 */
@SuppressWarnings("unused")
private void createTileOverlay(final JSONArray args,
  final CallbackContext callbackContext) throws JSONException {

  JSONObject opts = args.getJSONObject(1);
  int tileSize = opts.getInt("tileSize");
  final String tileUrlFormat = opts.getString("tileUrlFormat");

  double opacity = 1.0;
  if (opts.has("opacity")) {
    opacity = opts.getDouble("opacity");
  }
  PluginTileProvider tileProvider = new PluginTileProvider(tileUrlFormat, opacity, tileSize);

  TileOverlayOptions options = new TileOverlayOptions();
  options.tileProvider(tileProvider);
  if (opts.has("zIndex")) {
    options.zIndex((float)opts.getDouble("zIndex"));
  }
  if (opts.has("visible")) {
    options.visible(opts.getBoolean("visible"));
  }
  TileOverlay tileOverlay = this.map.addTileOverlay(options);
  String id = "tile_" + tileOverlay.getId();

  this.objects.put(id, tileOverlay);
  this.objects.put(id.replace("tile_", "tileProvider_"), tileProvider);

  JSONObject result = new JSONObject();
  result.put("hashCode", tileOverlay.hashCode());
  result.put("id", id);
  callbackContext.success(result);
}
项目:devnexus-android    文件:VenueMapFragment.java   
private void onTilesLoaded(List<TileLoadingTask.TileEntry> list) {
    if (list != null && mMap != null) {
        // Display tiles if they have been loaded, skip them otherwise but display the rest of
        // the map.
        for (TileLoadingTask.TileEntry entry : list) {
            TileOverlayOptions tileOverlay = new TileOverlayOptions()
                    .tileProvider(entry.provider).visible(false).zIndex(500);

            // Store the tile overlay and provider
            mTileProviders.put(entry.floor, entry.provider);
            mTileOverlays.put(entry.floor, mMap.addTileOverlay(tileOverlay));
        }
    }

}
项目:QuizUpWinner    文件:IGoogleMapDelegate.java   
public com.google.android.gms.maps.model.internal.f addTileOverlay(TileOverlayOptions paramTileOverlayOptions)
{
  Parcel localParcel1 = Parcel.obtain();
  Parcel localParcel2 = Parcel.obtain();
  try
  {
    localParcel1.writeInterfaceToken("com.google.android.gms.maps.internal.IGoogleMapDelegate");
    if (paramTileOverlayOptions != null)
    {
      localParcel1.writeInt(1);
      paramTileOverlayOptions.writeToParcel(localParcel1, 0);
    }
    else
    {
      localParcel1.writeInt(0);
    }
    this.dU.transact(13, localParcel1, localParcel2, 0);
    localParcel2.readException();
    com.google.android.gms.maps.model.internal.f localf = com.google.android.gms.maps.model.internal.f.a.ap(localParcel2.readStrongBinder());
    return localf;
  }
  finally
  {
    localParcel2.recycle();
    localParcel1.recycle();
  }
}
项目:iosched    文件:MapFragment.java   
/**
 * Add the first TileOverlay to the map.
 */
private void onTilesLoaded(List<TileLoadingTask.TileEntry> list) {
    if (list.isEmpty()) {
        return;
    }
    // Get the first entry and make it visible
    TileLoadingTask.TileEntry entry = list.get(0);
    TileOverlayOptions tileOverlay = new TileOverlayOptions()
            .tileProvider(entry.provider).visible(true);

    // Store the tile overlay and provider
    mTileProvider = entry.provider;
    mTileOverlay = mMap.addTileOverlay(tileOverlay);
}
项目:anti-piracy-android-app    文件:OfflineMap.java   
@Override
protected void onPreExecute() {
    progressDialog = ProgressDialog.show(mContext, mContext.getString(R.string.offline_map_progress_dialog_title_text), mContext.getString(R.string.offline_map_progress_dialog_content_text), true);

    mMapUI.setMapType(GoogleMap.MAP_TYPE_NONE);

    BackgroundTileProvider tileProvider = new BackgroundTileProvider(mContext);           
    backgroundTileOverlay = mMapUI.addTileOverlay(new TileOverlayOptions().tileProvider(tileProvider).zIndex(1).visible(false));
    backgroundTileOverlay.setVisible(true);
}
项目:disconnected-content-explorer-android    文件:GeoPackageMapOverlays.java   
/**
 * Add a tile table to the map
 *
 * @param geoPackage
 * @param name
 * @param data
 */
private void addTileTable(GeoPackage geoPackage, String name, GeoPackageMapData data) {

    GeoPackageTableMapData tableData = new GeoPackageTableMapData(name, false);
    data.addTable(tableData);

    // Create a new GeoPackage tile provider and add to the map
    TileDao tileDao = geoPackage.getTileDao(name);
    BoundedOverlay geoPackageTileOverlay = GeoPackageOverlayFactory.getBoundedOverlay(tileDao);

    // Check for linked feature tables
    FeatureTileTableLinker linker = new FeatureTileTableLinker(geoPackage);
    List<FeatureDao> featureDaos = linker.getFeatureDaosForTileTable(tileDao.getTableName());
    for (FeatureDao featureDao : featureDaos) {

        // Create the feature tiles
        FeatureTiles featureTiles = new DefaultFeatureTiles(context, featureDao);

        // Create an index manager
        FeatureIndexManager indexer = new FeatureIndexManager(context, geoPackage, featureDao);
        featureTiles.setIndexManager(indexer);

        // Add the feature overlay query
        FeatureOverlayQuery featureOverlayQuery = new FeatureOverlayQuery(context, geoPackageTileOverlay, featureTiles);
        tableData.addFeatureOverlayQuery(featureOverlayQuery);
    }

    // Set the tiles index to be -2 of it is behind features and tiles drawn from features
    int zIndex = -2;

    // If these tiles are linked to features, set the zIndex to -1 so they are placed before imagery tiles
    if (!featureDaos.isEmpty()) {
        zIndex = -1;
    }

    TileOverlayOptions overlayOptions = createTileOverlayOptions(geoPackageTileOverlay, zIndex);
    TileOverlay tileOverlay = map.addTileOverlay(overlayOptions);
    tableData.setTileOverlay(tileOverlay);
}