Skip to content

Usage

You can try out leafmap by using Google Colab image

To use thinkgreen in a project:

1
import thinkgreen

Create an interactive map

1
2
3
m = thinkgreen.Map(center = [36, -84], zoom = 10)

m

Another way to create an interactive map

1
2
3
4
5
import folium

m = folium.Map(location =[36, -84], zoom_start=10)

m

Customize base layers

1
2
3
4
5
6
7
m = thinkgreen.Map(center = [36, -84], zoom = 10)
m.add_search_control(position="topright")
m.add_layers_control()
m.add_tile_layer(url=url, name="Google Maps", attribution="Google")
m.add_basemap(basemap="satellite")

m

Customize basemaps

1
2
3
4
5
m = thinkgreen.Map()

m.add_toolbar()

m

Adding different types of graphs

1
2
3
4
5
6
7
m = thinkgreen.Map() 

m.add_bar(x=[1,2,3,4], y=[1,2,3,4])

m.add_pie(x=[1,2,3,4])

m.add_plot(x=[1,2,3,4], y=[1,2,3,4])

Add Shapefiles or GeoJSON layers

1
2
3
4
5
m = thinkgreen.Map()

m.add_shp("filename")

m.add_geojson("filename")

Last update: 2023-05-11