jwass / mplleaflet

Easily convert matplotlib plots from Python into interactive Leaflet web maps.
BSD 3-Clause "New" or "Revised" License
522 stars 76 forks source link

added stamen toner map tiles #34

Closed jdoepfert closed 7 years ago

jwass commented 8 years ago

Thanks! Any change you can squash these so we can get rid of the .py~ file in the history?

jdoepfert commented 8 years ago

should be fine now!

habi commented 7 years ago

Could this PR be merged? I'd love to use the toner maps...

jwass commented 7 years ago

@habi @jdoepfert Yes! I'll see if I can get to this soon.

ocefpaf commented 7 years ago

Could this PR be merged? I'd love to use the toner maps...

You can use them already if you pass the tuple to the tiles= kwarg like:

import mplleaflet
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot([-38.48, -38.48, -38.48], [-16, -13, -10], 'ro')

stamen_toner = (
    'http://a.tile.stamen.com/toner/{z}/{x}/{y}.png',
    'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map data &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
)

mplleaflet.display(fig=fig, tiles=stamen_toner)