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": "c00b5464-95ad-44b9-9e33-cf2cdeef229d",
  "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": "04a572d4-1f96-4fbd-a3a4-d93fcbd962ea",
  "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": "bevel",
  "outline_line_width": {
    "value": 1
  },
  "output_backend": "canvas",
  "plot_height": 600,
  "plot_width": 600,
  "renderers": [],
  "right": [],
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": {
    "id": "f82c9414-91a1-4420-88b0-8d4773db8eb4",
    "type": "Title"
  },
  "title_location": "above",
  "toolbar": {
    "id": "fc8a8098-08ef-4716-9cea-9b0b82d72702",
    "type": "Toolbar"
  },
  "toolbar_location": "right",
  "toolbar_sticky": true,
  "v_symmetry": false,
  "width": null,
  "x_range": null,
  "x_scale": {
    "id": "190a2eed-25a9-4732-974e-1da8df1bda6f",
    "type": "LinearScale"
  },
  "y_range": null,
  "y_scale": {
    "id": "b7f03f5e-a977-4d3c-8ee0-511e36849a31",
    "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": "3042dd50-8c56-448f-9c3c-8d2c37a5266f",
  "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": "38fe00fa-7b20-4401-b7fc-f20c199d22f0",
  "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": "bevel",
  "outline_line_width": {
    "value": 1
  },
  "output_backend": "canvas",
  "plot_height": 600,
  "plot_width": 600,
  "renderers": [],
  "right": [],
  "sizing_mode": "fixed",
  "subscribed_events": [],
  "tags": [],
  "title": {
    "id": "b4a386f8-f52f-41ff-8b7d-2f571a649e60",
    "type": "Title"
  },
  "title_location": "above",
  "toolbar": {
    "id": "c72176c6-7c64-4496-84cc-4462af37d6ec",
    "type": "Toolbar"
  },
  "toolbar_location": "right",
  "toolbar_sticky": true,
  "v_symmetry": false,
  "width": null,
  "x_range": null,
  "x_scale": {
    "id": "d5bca2e2-9e69-489d-a21f-9086c70d7d9c",
    "type": "LinearScale"
  },
  "y_range": null,
  "y_scale": {
    "id": "66050be9-95bf-4ae2-b30f-806019f392f8",
    "type": "LinearScale"
  }
}