I'm using react-native-maps in React Native and I wanted to use OpenStreetMap (because Google Map is incredibly expensive for a commercial project). MapView gives very low resolution tiles, the tiles and labels are very blurry (see pictures below).
This code is working perfectly with Google Maps:
import MapView, {
MAP_TYPES,
PROVIDER_DEFAULT,
PROVIDER_GOOGLE,
} from "react-native-maps";
...
<MapView
ref={(map) => (currentMap = map)}
initialRegion={location}
showsUserLocation
style={{
height: Globals.Layout.window.height,
width: Globals.Layout.window.width,
}}
></MapView>
Change to this to use OpenStreetMap, and you get correct tiles, but everything is blurred and in low resolution :
import MapView, {
MAP_TYPES,
PROVIDER_DEFAULT,
PROVIDER_GOOGLE,
} from "react-native-maps";
...
<MapView
ref={(map) => (currentMap = map)}
initialRegion={location}
showsUserLocation
provider={PROVIDER_DEFAULT}
mapType={MAP_TYPES.NONE}
style={{
height: Globals.Layout.window.height,
width: Globals.Layout.window.width,
}}
>
<MapView.UrlTile
urlTemplate={"http://a.tile.openstreetmap.org/{z}/{x}/{y}.png"}
shouldReplaceMapContent={true}
/>
</MapView>
OpenStreetMap result (very blurry)
Environment info:
- react: ~16.9.0 => 16.9.0
- react-native: 0.61.4
- react-native-maps: 0.26.1
How can I do to make the resolution of the tiles higher (or simulate a zoom-out?)