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.

tilt

property type: Int

Tilt angle of the map. The only allowed values are 0 and 45. Only has an effect on ‘satellite’ and ‘hybrid’ map types. A value of 0 causes the map to always use a 0 degree overhead view. A value of 45 causes the tilt angle to switch to 45 imagery if available.

JSON Prototype
{
  "id": "12467",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "lat": null,
  "lng": null,
  "map_type": "roadmap",
  "name": null,
  "scale_control": false,
  "styles": null,
  "subscribed_events": [],
  "tags": [],
  "tilt": 45,
  "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.

Note that Google Maps exert explicit control over aspect ratios at all times, which imposes some limitations on GMapPlot:

  • Only Range1d ranges are supported. Attempting to use other range types will result in an error.

  • Usage of BoxZoomTool is incompatible with GMapPlot. Adding a BoxZoomTool will have no effect.

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": [],
  "align": "start",
  "api_key": null,
  "aspect_ratio": null,
  "aspect_scale": 1,
  "background": null,
  "background_fill_alpha": {
    "value": 1.0
  },
  "background_fill_color": {
    "value": "#ffffff"
  },
  "below": [],
  "border_fill_alpha": {
    "value": 1.0
  },
  "border_fill_color": {
    "value": "#ffffff"
  },
  "center": [],
  "css_classes": [],
  "disabled": false,
  "extra_x_ranges": {},
  "extra_y_ranges": {},
  "frame_height": null,
  "frame_width": null,
  "height": null,
  "height_policy": "auto",
  "hidpi": true,
  "id": "12472",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "left": [],
  "lod_factor": 10,
  "lod_interval": 300,
  "lod_threshold": 2000,
  "lod_timeout": 500,
  "map_options": null,
  "margin": [
    0,
    0,
    0,
    0
  ],
  "match_aspect": false,
  "max_height": null,
  "max_width": null,
  "min_border": 5,
  "min_border_bottom": null,
  "min_border_left": null,
  "min_border_right": null,
  "min_border_top": null,
  "min_height": null,
  "min_width": 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": [],
  "reset_policy": "standard",
  "right": [],
  "sizing_mode": null,
  "subscribed_events": [],
  "tags": [],
  "title": {
    "id": "12476",
    "type": "Title"
  },
  "title_location": "above",
  "toolbar": {
    "id": "12478",
    "type": "Toolbar"
  },
  "toolbar_location": "right",
  "toolbar_sticky": true,
  "visible": true,
  "width": null,
  "width_policy": "auto",
  "x_range": {
    "id": "12477",
    "type": "Range1d"
  },
  "x_scale": {
    "id": "12475",
    "type": "LinearScale"
  },
  "y_range": {
    "id": "12474",
    "type": "Range1d"
  },
  "y_scale": {
    "id": "12473",
    "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": "12481",
  "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": [],
  "align": "start",
  "aspect_ratio": null,
  "aspect_scale": 1,
  "background": null,
  "background_fill_alpha": {
    "value": 1.0
  },
  "background_fill_color": {
    "value": "#ffffff"
  },
  "below": [],
  "border_fill_alpha": {
    "value": 1.0
  },
  "border_fill_color": {
    "value": "#ffffff"
  },
  "center": [],
  "css_classes": [],
  "disabled": false,
  "extra_x_ranges": {},
  "extra_y_ranges": {},
  "frame_height": null,
  "frame_width": null,
  "height": null,
  "height_policy": "auto",
  "hidpi": true,
  "id": "12485",
  "js_event_callbacks": {},
  "js_property_callbacks": {},
  "left": [],
  "lod_factor": 10,
  "lod_interval": 300,
  "lod_threshold": 2000,
  "lod_timeout": 500,
  "margin": [
    0,
    0,
    0,
    0
  ],
  "match_aspect": false,
  "max_height": null,
  "max_width": null,
  "min_border": 5,
  "min_border_bottom": null,
  "min_border_left": null,
  "min_border_right": null,
  "min_border_top": null,
  "min_height": null,
  "min_width": 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": [],
  "reset_policy": "standard",
  "right": [],
  "sizing_mode": null,
  "subscribed_events": [],
  "tags": [],
  "title": {
    "id": "12489",
    "type": "Title"
  },
  "title_location": "above",
  "toolbar": {
    "id": "12490",
    "type": "Toolbar"
  },
  "toolbar_location": "right",
  "toolbar_sticky": true,
  "visible": true,
  "width": null,
  "width_policy": "auto",
  "x_range": {
    "id": "12491",
    "type": "DataRange1d"
  },
  "x_scale": {
    "id": "12488",
    "type": "LinearScale"
  },
  "y_range": {
    "id": "12487",
    "type": "DataRange1d"
  },
  "y_scale": {
    "id": "12486",
    "type": "LinearScale"
  }
}