4

I am trying to have a zoomable satellite map for my Transportation network analysis. Other free maps all OK but could not get satellite to work. I am using:

token = 'pk.eyJ1IjoiYXNhZGkxOTc4IiwiYSI6ImNqanphbHVhMDA4ODgzd25yYzY1MW1nc2oifQ.dDDcWq2-tUC-XXXXXXX'
tiletxt = 'https://api.mapbox.com/v4/mapbox.satellite/3/2/3@2x.png?access_token=' + str(token)

my_map = folium.Map(location = [lat,lon], tiles = tiletxt, attr='WHAT SHOULD I PUT HERE?', zoom_start = 7)

But give a grid static map which cannot be zoomed etc.

Can I get some instructions how I can get a nice satellite map?

1

Your code is almost correct. Fixed one:

token = "pk...." # your mapbox token
tileurl = 'https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}@2x.png?access_token=' + str(token)

m = folium.Map(
    location=[48.73596, 11.18434], zoom_start=9, tiles=tileurl, attr='Mapbox')
  • Thanks for the response. I will test the tip and let you know if it worked. – Alireza Asadi Dec 19 '18 at 15:35
  • It worked buddy. Thanks – Alireza Asadi Jun 11 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.