title: How do I reset the view of my map back to my location in Ionic with Leaflet and OpenStreetMap?
body: <p>Right now I'm working on a locationbased App in Ionic v4. Now I want to be able to reset the map view back to my location. I guess I need to use <code>setView</code> again to achieve this, but I don't know the syntax to do that.</p>
  
  <p>Here is all the relevant Code I've got so far:</p>
  
  <p><strong>home.page.html</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ion-content&gt;
    &lt;div class="home-button" (click)="centerMap()"&gt;
      &lt;ion-icon name="navigate"&gt;&lt;/ion-icon&gt;
    &lt;/div&gt;
    &lt;div id="map"&gt;&lt;/div&gt;
  &lt;/ion-content&gt;
  </code></pre>
  
  <p><strong>home.page.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>centerMap() {
      this.mapService.backToCenter();
  }
  </code></pre>
  
  <p><strong>map.service.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>loadmap(map) {
      this.map = map;
      this.map.locate({
          setView: true,
          maxZoom: 22,
          minZoom: 12
      })
      .on('locationfound', e =&gt; {
          const markerGroup = leaflet.featureGroup();
          const marker: any = leaflet
              .marker([e.latitude, e.longitude], {
                  icon: positionIcon,
                  zIndexOffset: -1000
              })
              .on('click', () =&gt; {
                  console.log('Position marker clicked');
              });
          markerGroup.addLayer(marker);
          this.map.addLayer(markerGroup);
          this.loadMarkers(this.dropService.getDrops());
      });
      return this.map;
  }
  backToCenter() {
      console.log('Center Map');
  }
  </code></pre>
  
  <p>Is there a way to trigger a new <code>setView</code> on click on a button? </p>