Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70434

Mapbox not working on iOS but fine on android

$
0
0

@lunneyd wrote:

Mapbox works perfectly in android but for iOS it doesn’t even display the map. It asks can the phone have access to location but that’s it. Any ideas.

 initMap(lat: number, long: number)
  {
    let map = L.map('map').setView([lat, long], 18);

    L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
      attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
      maxZoom: 18,
      id: 'mapbox.streets',
      accessToken: 'tokengoeshere'
    }).addTo(map);

    this.setMap(lat, long, map);

    return map;
  }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70434

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>