# \<ion-slides\> item does not render the Leaflet map

**URL:** <https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828>\
**Category:** ionic-v3\
**Created:** [September 18, 2017, 2:22pm UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828 "2017-09-18T14:22:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Treppaoli](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@Treppaoli](https://forum.ionicframework.com/u/Treppaoli)\
**Post date:** [September 18, 2017, 2:22pm UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/1 "2017-09-18T14:22:36Z")

</div>

Hi,  
I have a problem with **Leaflet.js** and **ion-slides** element. if I include the map in ion-slides

```auto
<ion-slides>
  <ion-slide>
    <div id="map-slider"></div>
  </ion-slide>
</ion-slides>

```

```auto
this.map = leaflet.map('map-slider', {
      zoomControl: false,
      zoomSnap: 0,
      attributionControl: false
    }).setView([coordinates[0][0], coordinates[0][1]], 16);
    
leaflet.tileLayer('...', {
      accessToken: '...',
      id: 'mapbox.satellite'
}).addTo(this.map);

var polyline = leaflet.polyline(coordinates, { weight: 5, color: '#00ffa8' }).addTo(this.map);

this.map.fitBounds(polyline.getBounds(), { paddingTopLeft: [10, 10], paddingBottomRight: [10, 10] });

```

only renders the polyline. But if I put the map out of the element then everything works. Do you have any idea to bypass this problem?

---

<div class="post-metadata">

**Author:** ![KMenant](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@KMenant](https://forum.ionicframework.com/u/KMenant)\
**Post date:** [July 12, 2018, 6:27am UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/2 "2018-07-12T06:27:27Z")

</div>

Hi, I have the same issue. Did you find any solution ?

---

<div class="post-metadata">

**Author:** ![avishai\_peretz\_dev](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@avishai\_peretz\_dev](https://forum.ionicframework.com/u/avishai_peretz_dev)\
**Post date:** [July 12, 2018, 8:59am UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/3 "2018-07-12T08:59:41Z")

</div>

Try to set slide Item height

---

<div class="post-metadata">

**Author:** ![KMenant](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@KMenant](https://forum.ionicframework.com/u/KMenant)\
**Post date:** [July 12, 2018, 10:43am UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/4 "2018-07-12T10:43:05Z")

</div>

Thank you for your reply.  
I tried to put a height: 200px or a height: max-content on slides but nothing change.

```auto
<ion-content padding>
  WORK
  <div class="map-card-container">
    <div id="map1" style="width: 100%; height: 100%"></div>
  </div>

  DOESN'T WORK
  <ion-slides pager>
    <ion-slide style="height: max-content;">
      <div class="map-card-container">
        <div id="map2" style="width: 100%; height: 100%"></div>
      </div>
      <div class="map-card-container">
        <div id="map3" style="width: 100%; height: 100%"></div>
      </div>
    </ion-slide>
  </ion-slides>
</ion-content>

```

---

<div class="post-metadata">

**Author:** ![avishai\_peretz\_dev](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@avishai\_peretz\_dev](https://forum.ionicframework.com/u/avishai_peretz_dev)\
**Post date:** [July 12, 2018, 10:49am UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/5 "2018-07-12T10:49:41Z")

</div>

When you look in element inspector do you see the map element?

---

<div class="post-metadata">

**Author:** ![KMenant](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@KMenant](https://forum.ionicframework.com/u/KMenant)\
**Post date:** [July 12, 2018, 10:59am UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/6 "2018-07-12T10:59:06Z")

</div>

Yep, the page look like this.

 ![leaflet-slides](https://global.discourse-cdn.com/ionicframework/original/3X/0/e/0e4ba642d7e567c25d7c91750eb2a965dbae200d.jpg)  
The map is displayed, with the polyline inside.  
I can also move inside the map.  
Simply the tiles/map images are not displayed (contrary to the map that is not in the slides)

(edit : The tiles are loaded in Network)

---

<div class="post-metadata">

**Author:** ![avishai\_peretz\_dev](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@avishai\_peretz\_dev](https://forum.ionicframework.com/u/avishai_peretz_dev)\
**Post date:** [July 12, 2018, 11:01am UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/7 "2018-07-12T11:01:02Z")

</div>

try to zoom in/out see if changes after zoom

---

<div class="post-metadata">

**Author:** ![KMenant](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@KMenant](https://forum.ionicframework.com/u/KMenant)\
**Post date:** [July 12, 2018, 11:15am UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/8 "2018-07-12T11:15:19Z")

</div>

Same, when I zoom or move in the map the tiles are loaded in Network, but not displayed on the map.  
So the map detect the changes, load the correct tiles, but does not seem able to display them.

It’s append only if the map is inside a slider.

---

<div class="post-metadata">

**Author:** ![avishai\_peretz\_dev](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@avishai\_peretz\_dev](https://forum.ionicframework.com/u/avishai_peretz_dev)\
**Post date:** [July 12, 2018, 11:38am UTC](https://forum.ionicframework.com/t/ion-slides-item-does-not-render-the-leaflet-map/105828/9 "2018-07-12T11:38:29Z")

</div>

Can you upload any demo?  
That i can debug it?
