map_maker (Folium)

These are the functions in the folium.map_maker module.

map_maker.folium functions

make_map_plot(map_data[, plot_height, …])

Creates a Folium map from a list of dicts with geometry / style info.

Module contents

Copyright 2020 Expedia, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

map_maker.folium.map_maker.make_map_plot(map_data, plot_height=800, plot_width=800, tiles='cartodbpositron', point_size=2, polygon_line_width=2, linestring_width=2, tooltips={'points'})

Creates a Folium map from a list of dicts with geometry / style info.

Takes a list of dictionaries, each of which has the following fields:

{
    "shape": # WKT | GeoJSON String | Geo-Interface | Shapely Geometry
    "alpha": # Alpha value of the fill.
    "color": # Color of the shape
}
Parameters
  • map_data (list of dict) – A list of dictionaries defining the shape and style to map with the fields defined above.

  • plot_height (int) – The height of the plot in px.

  • plot_width (int) – The width of the plot in px.

  • tiles (str) – The tile source for the map. Default is CartoDB Positron.

  • point_size (float, default 2.) – The size of the points to plot, if there are any points present.

  • polygon_line_width (float, default 2.) – The line width of the polygon outline, if there are any polygons present. Set to 0 to disable polygon outlines.

  • linestring_width (float, default 2.) – The line with of the linestring, if there are any linestrings present.

  • tooltips (set) – The labels of tooltips to display, can be “points”, “linestrings”, “polygons” or any combination of those.

Returns

fig – The Folium object for the map.

Return type

folium.Map