#!/usr/bin/env python # coding: utf-8 # In[1]: import os import json us_states = os.path.join("data", "us-states.json") with open(us_states) as f: states = json.load(f) kw = {"location": [48, -102], "zoom_start": 3} # In[2]: import folium from folium import GeoJson m = folium.Map(tiles=None, **kw) GeoJson(states).add_to(m) m # In[3]: import branca # Create a white image of 4 pixels, and embed it in a url. white_tile = branca.utilities.image_to_url([[1, 1], [1, 1]]) # Create a map using this url for each tile. m = folium.Map(tiles=white_tile, attr="white tile", **kw) GeoJson(states).add_to(m) m # In[4]: images = [[(-1) ** ((i + j) // 30) for i in range(300)] for j in range(300)] tiles = branca.utilities.image_to_url(images) m = folium.Map(tiles=tiles, attr="Just because we can", **kw) GeoJson(states).add_to(m) m # In[5]: images = [[(-1) ** ((i // 30 + j // 30)) for i in range(300)] for j in range(300)] tiles = branca.utilities.image_to_url(images) m = folium.Map(tiles=tiles, attr="Just because we can", **kw) GeoJson(states).add_to(m) m