MapView Custom LocalTiles

#1

Hi everyone, Expo/ReactNative noob here. I’m trying to setup a MapView and use custom tiles. Basically I have a completely fictional map that I want to display (https://vignette.wikia.nocookie.net/finalfantasy/images/9/98/FFTIvalice.png/revision/latest?cb=20070910130528). The map itself is only (496x368), regardless of how small it is (thus very very blurry when you would zoom in/out), i still wanted to do it because I planned on having nice hi res markers on top. I was able to create tiles for my map, but I’m confused how to use them with the LocalTile from ReactNativeMaps. My custom tiles are very small, there are literally only 4 tiles total.

My problem is that… nothing shows. I’m not quite sure what I’m doing wrong. The code I’m using is very small:

<MapView mapType={“none”} style={this.styles.map}> <LocalTile pathTemplate={“appassets/maps/ivalice/{z}/{x}/{y}.png”} tileSize={256} maximumZ={1}/>

I’ve been seeing online that people are using a path to the system files, but I need to load the tiles from my app assets. I saw someone saying you need to zip them and on app load unzip them into that directory, but that seems like of extra work the app has to do for just 4 images. Is that the only way to do this?

#2

I think this might currently not work with the way Expo names assets, because that library assumes the tiles have their local filename in a certain format. We are tracking the issue here.

closed #3

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.