bokeh.models.map_plots

Models for displaying maps in Bokeh plots.

class GMapOptions(**kwargs)[source]

Bases: bokeh.models.map_plots.MapOptions

Options for GMapPlot objects.

map_type

property type: Enum ( MapType )

The map type to use for the GMapPlot.

scale_control

property type: Bool

Whether the Google map should display its distance scale control.

styles

property type: JSON

A JSON array of map styles to use for the GMapPlot. Many example styles can be found here.

JSON Prototype
{
  "id": "dd7a45a8-0c0b-4d99-8fb5-946a59444b20",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "lat": null,
  "lng": null,
  "map_type": "roadmap",
  "name": null,
  "scale_control": false,
  "styles": null,
  "subscribed_events": [],
  "tags": [],
  "zoom": 12
}
class GMapPlot(*args, **kw)[source]

Bases: bokeh.models.map_plots.MapPlot

A Bokeh Plot with a Google Map displayed underneath.

Data placed on this plot should be specified in decimal lat/lon coordinates e.g. (37.123, -122.404). It will be automatically converted into the web mercator projection to display properly over google maps tiles.

Please also note that only Range1d ranges are supported by GMapPlot.

api_key

property type: String

Google Maps API requires an API key. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own.

map_options

property type: Instance ( GMapOptions )

Options for displaying the plot.

JSON Prototype
{
  "above": [],
  "api_key": null,
  "aspect_scale": 1,
  "background_fill_alpha": {
    "value": 1.0
  },
  "background_fill_color": {
    "value": "#ffffff"
  },
  "below": [],
  "border_fill_alpha": {
    "value": 1.0
  },
  "border_fill_color": {
    "value": "#ffffff"
  },
  "css_classes": [],
  "disabled": false,
  "extra_x_ranges": {},
  "extra_y_ranges": {},
  "h_symmetry": true,
  "height": null,
  "hidpi": true,
  "id": "7a3ab639-aac4-4155-8a5f-10509d4ec025",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "left": [],
  "lod_factor": 10,
  "lod_interval": 300,
  "lod_threshold": 2000,
  "lod_timeout": 500,
  "map_options": null,
  "match_aspect": false,
  "min_border": 5,
  "min_border_bottom": null,
  "min_border_left": null,
  "min_border_right": null,
  "min_border_top": null,
  "name": null,
  "outline_line_alpha": {
    "value": 1.0
  },
  "outline_line_cap": "butt",
  "outline_line_color": {
    "value": "#e5e5e5"
  },
  "outline_line_dash": [],
  "outline_line_dash_offset": 0,
  "outline_line_join": "miter",
  "outline_line_width": {
    "value": 1
  },
  "output_backend": "canvas",
  "plot_height": 600,
  "plot_width": 600,
  "renderers": [],
  "right": [],
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": {
    "id": "d804ee5c-14b1-44b3-b07a-03b43269ff1f",
    "type": "Title"
  },
  "title_location": "above",
  "toolbar": {
    "id": "f1d51d38-34fd-4a77-8ba8-fbebfb137333",
    "type": "Toolbar"
  },
  "toolbar_location": "right",
  "toolbar_sticky": true,
  "v_symmetry": false,
  "width": null,
  "x_range": null,
  "x_scale": {
    "id": "513e5ac6-4f8e-48c9-b31c-c13e842dfcc1",
    "type": "LinearScale"
  },
  "y_range": null,
  "y_scale": {
    "id": "2a51b11e-5d72-430b-aaf5-4342e208855f",
    "type": "LinearScale"
  }
}
class MapOptions(**kwargs)[source]

Bases: bokeh.model.Model

Abstract base class for map options’ models.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

lat

property type: Float

The latitude where the map should be centered.

lng

property type: Float

The longitude where the map should be centered.

zoom

property type: Int

The initial zoom level to use when displaying the map.

JSON Prototype
{
  "id": "7090346f-c960-412d-bd13-0480fc471edf",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "lat": null,
  "lng": null,
  "name": null,
  "subscribed_events": [],
  "tags": [],
  "zoom": 12
}
class MapPlot(*args, **kw)[source]

Bases: bokeh.models.plots.Plot

Abstract base class for map plot models.

Note

This is an abstract base class used to help organize the hierarchy of Bokeh model types. It is not useful to instantiate on its own.

JSON Prototype
{
  "above": [],
  "aspect_scale": 1,
  "background_fill_alpha": {
    "value": 1.0
  },
  "background_fill_color": {
    "value": "#ffffff"
  },
  "below": [],
  "border_fill_alpha": {
    "value": 1.0
  },
  "border_fill_color": {
    "value": "#ffffff"
  },
  "css_classes": [],
  "disabled": false,
  "extra_x_ranges": {},
  "extra_y_ranges": {},
  "h_symmetry": true,
  "height": null,
  "hidpi": true,
  "id": "bca35e9a-067c-4236-a61c-8a9a33929594",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "left": [],
  "lod_factor": 10,
  "lod_interval": 300,
  "lod_threshold": 2000,
  "lod_timeout": 500,
  "match_aspect": false,
  "min_border": 5,
  "min_border_bottom": null,
  "min_border_left": null,
  "min_border_right": null,
  "min_border_top": null,
  "name": null,
  "outline_line_alpha": {
    "value": 1.0
  },
  "outline_line_cap": "butt",
  "outline_line_color": {
    "value": "#e5e5e5"
  },
  "outline_line_dash": [],
  "outline_line_dash_offset": 0,
  "outline_line_join": "miter",
  "outline_line_width": {
    "value": 1
  },
  "output_backend": "canvas",
  "plot_height": 600,
  "plot_width": 600,
  "renderers": [],
  "right": [],
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": {
    "id": "6cc13daa-0778-45f8-af86-5390f0d41c7e",
    "type": "Title"
  },
  "title_location": "above",
  "toolbar": {
    "id": "8ac7ab1f-551e-4bbe-b6b2-0e2524777387",
    "type": "Toolbar"
  },
  "toolbar_location": "right",
  "toolbar_sticky": true,
  "v_symmetry": false,
  "width": null,
  "x_range": null,
  "x_scale": {
    "id": "277fb708-4413-4373-b678-cb8aec104996",
    "type": "LinearScale"
  },
  "y_range": null,
  "y_scale": {
    "id": "81c8d420-c5e5-4a38-b513-e4bd45eb352d",
    "type": "LinearScale"
  }
}