title: How to use google maps offline in react native
body: <p>I'm trying to enable users to use maps offline in my react native App, I'm using <a href="https://github.com/react-native-community/react-native-maps" rel="noreferrer">react-native-maps</a><br></p>
  
  <p>I want to provide the offline mode just for a predefined area (let's say a city), therefore I need to download all the needed tiles which will be a huge number of images, so I wonder if there is a way in the google map API to download an area of the map (like in google map app)?<br>
  from the documentation it is possible to enable caching, which I do the same thing (according to the doc) however, In my case I don't want to cache every place that the user go to, as I said I just want to cache/download a predefined area.<br>
  <strong>EDIT 1</strong><br>
  <a href="https://github.com/react-native-community/react-native-maps" rel="noreferrer">react-native-maps</a> support offline navigation for that, I need to use this code : </p>
  
  <pre><code> &lt;LocalTile pathTemplate={this.state.pathTemplate} tileSize={256}/&gt;
  </code></pre>
  
  <p>with pathTemplate point to my tiles location which had to have the following hierarchy :</p>
  
  <pre><code>location/{z}/{x}/{y}
  </code></pre>
  
  <p>therefore my real probleme is how to get the tiles for my area.<br>
  I can do it manually by saving tiles from the google maps tile <a href="http://mt.google.com/vt/lyrs=m&amp;x=1&amp;y=0&amp;z=2" rel="noreferrer">server</a>, however I don't know if it is legal and also it will take a lot of time and calculation (when zooming in, I need to calculate the coordinated of the next tiles )
  <br>
  so It will be nice, if google map API provide a way to download an area's tile (with needed zoom), <br>
  another alternative would be using another map provider like <a href="https://www.openstreetmap.org/#map=6/46.449/2.210" rel="noreferrer">OpenStreetMAp</a>, but here also, I need to find a way to download all tiles at once</p>