Skip to content

Commit

Permalink
Revert "Added MBTiles support for iOS and Android (#2208)" (#2387)
Browse files Browse the repository at this point in the history
This reverts commit 2d760e1.
  • Loading branch information
rborn committed Jul 19, 2018
1 parent 2d760e1 commit c3b3802
Show file tree
Hide file tree
Showing 30 changed files with 270 additions and 6,224 deletions.
33 changes: 0 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,39 +221,6 @@ For Android: LocalTile is still just overlay over original map tiles. It means t

See [OSM Wiki](https://wiki.openstreetmap.org/wiki/Category:Tile_downloading) for how to download tiles for offline usage.


#### Tile Overlay using MbTile

Tiles can be stored locally in a MBTiles database on the device using xyz tiling scheme. The locally stored tiles can be displayed as a tile overlay. This can be used for displaying maps offline. Manging many tiles in a database is especially useful if larger areas are covered by an offline map. Keeping all the files locally and "raw" on the device most likely results in bad performance as well as troublesome datahandling. Please make sure that your database follows the MBTiles [specifications](https://github.com/mapbox/mbtiles-spec). This only works with tiles stored in the [xyz scheme](https://gist.github.com/tmcw/4954720) as used by Google, OSM, MapBox, ... Make sure to include the ending .mbtiles when you pass your pathTemplate.

```jsx
import MapView from 'react-native-maps';

<MapView
region={this.state.region}
onRegionChange={this.onRegionChange}
>
<MapView.MbTile
/**
* The path template of the locally stored MBTiles database.
/storage/emulated/0/path/to/mBTilesDatabase.mbtiles
*/
pathTemplate={this.state.pathTemplate}
/**
* The size of provided local tiles (usually 256 or 512).
*/
tileSize={256}
/>
</MapView>
```

For Android: LocalTile is still just overlay over original map tiles. It means that if device is online, underlying tiles will be still downloaded. If original tiles download/display is not desirable set mapType to 'none'. For example:
```
<MapView
mapType={Platform.OS == "android" ? "none" : "standard"}
>
```

### Customizing the map style

Create the json object, or download a generated one from the [google style generator](https://mapstyle.withgoogle.com/).
Expand Down
91 changes: 0 additions & 91 deletions example/examples/MbTileOverlay.js

This file was deleted.

11 changes: 1 addition & 10 deletions index.d.ts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ declare module "react-native-maps" {
}

// =======================================================================
// UrlTile, LocalTile & MbTile
// UrlTile & LocalTile
// =======================================================================

export interface MapUrlTileProps extends ViewProperties {
Expand All @@ -387,15 +387,6 @@ declare module "react-native-maps" {
export class LocalTile extends React.Component<MapLocalTileProps, any> {
}

export interface MapMbTileProps extends ViewProperties {
pathTemplate: string;
tileSize: number;
zIndex?: number;
}

export class MbTile extends React.Component<MapMbTileProps, any> {
}

// =======================================================================
// Overlay
// =======================================================================
Expand Down
16 changes: 11 additions & 5 deletions index.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import MapView from './lib/components/MapView';
import MapView, { Animated, MAP_TYPES, ProviderPropType } from './lib/components/MapView';
import Marker from './lib/components/MapMarker.js';
import Overlay from './lib/components/MapOverlay.js';

export { default as Marker } from './lib/components/MapMarker.js';
export { default as Polyline } from './lib/components/MapPolyline.js';
export { default as Polygon } from './lib/components/MapPolygon.js';
export { default as Circle } from './lib/components/MapCircle.js';
export { default as UrlTile } from './lib/components/MapUrlTile.js';
export { default as LocalTile } from './lib/components/MapLocalTile.js';
export { default as MbTile } from './lib/components/MapMbTile.js';
export { default as Overlay } from './lib/components/MapOverlay.js';
export { default as Callout } from './lib/components/MapCallout.js';
export { default as AnimatedRegion } from './lib/components/AnimatedRegion.js';
export { Animated, ProviderPropType, MAP_TYPES } from './lib/components/MapView.js';

export { Marker, Overlay };
export { Animated, MAP_TYPES, ProviderPropType };

export const PROVIDER_GOOGLE = MapView.PROVIDER_GOOGLE;
export const PROVIDER_DEFAULT = MapView.PROVIDER_DEFAULT;

export const MarkerAnimated = Marker.Animated;
export const OverlayAnimated = Overlay.Animated;

export default MapView;

This file was deleted.

This file was deleted.

0 comments on commit c3b3802

Please sign in to comment.