gmap {rbokeh} | R Documentation

## Initialize a Bokeh Google Map plot

### Description

Initialize a Bokeh Google Map plot

### Usage

    gmap(data = NULL, lat = 0, lng = 0, zoom = 0, api_key = NULL,
      map_type = "hybrid", map_style = NULL, scale_control = NULL,
      width = 600, height = 600, title = NULL, title_location = NULL,
      xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL,
      range_padding = 0.07, xgrid = FALSE, ygrid = FALSE,
      legend_location = "top_right", logo = NULL,
      theme = getOption("bokeh_theme"), tools = c("pan", "wheel_zoom", "save"),
      toolbar_location = "above", toolbar_sticky = NULL, h_symmetry = TRUE,
      v_symmetry = FALSE, lod_factor = 10, lod_interval = 300,
      lod_threshold = NULL, lod_timeout = 500, output_backend = "canvas",
      min_border = NULL, min_border_left = NULL, min_border_bottom = NULL,
      min_border_right = NULL, min_border_top = NULL, hidpi = NULL)

### Arguments

`data` | A default data frame to be used by the layers added to the figure.
`lat` | The latitude where the map should be centered.
`lng` | The longitude where the map should be centered.
`zoom` | The initial zoom level to use when displaying the map.
`api_key` | Google Maps API key. If not specified, a search for an environmen variable, `GMAP_API_KEY`, will be done.
`map_type` | The ‘map type'_ to use for the GMapPlot. One of ’satellite', 'roadmap', 'terrain', 'hybrid'. See https://developers.google.com/maps/documentation/javascript/reference#MapTypeId for more details.
`map_style` | a json string of a Google Maps style - see `gmap_style`
`scale_control` | Whether the Google map should display its distance scale control.
`width` | Figure width in pixels.
`height` | Figure width in pixels.
`title` | A title to display on the plot.
`title_location` | Where the title will be located. Titles on the left or right side will be rotated. One of 'above', 'below', 'left', 'right'.
`xlab` | Label for x axis. Also specifiable in `x_axis`.
`ylab` | Label for y axis. Also specifiable in `y_axis`.
`xlim` | The extent of the plotting area in the x-dimension (will be computed automatically if not specified). Also specifiable in `x_range`.
`ylim` | The extent of the plotting area in the y-dimension (will be computed automatically if not specified). Also specifiable in `y_range`.
`range_padding` | If limits are not explicitly specified, by what factor should the computed extents of the data be padded? This is a number used as a multiplier of the computed range.
`xgrid` | Logical indicating whether to draw x axis grid lines.
`ygrid` | Logical indicating whether to draw y axis grid lines.
`legend_location` | The location where the legend should draw itself, or `NULL` to omit the legend. One of 'top_right', 'top_left', 'bottom_left', 'bottom_right'.
`logo` | What version of the Bokeh logo to display on the toolbar. If set to `NULL`, no logo will be displayed. One of 'normal', 'grey', or `NULL`.
`theme` | An rbokeh theme to use. See, for example, `bk_default_theme`.

`tools`

character vector of interactivity tools options (acceptable values are: "box_select", "lasso_select", "poly_select", "crosshair", "box_zoom", "wheel_zoom", "zoom_in", "zoom_out", "pan", "wheel_pan", "reset", "undo", "redo", "save", "help"). Additionally, tool functions can be called on a figure to specify more control - see `tool_box_select`, for example, where links to the rest of the family of tool functions can also be found. If `NULL`, the toolbar will not be drawn. If `""` the toolbar will be drawn but no tools will be added by default.

`toolbar_location` | Where the toolbar will be located. If set to None, no toolbar will be attached to the plot. One of 'above', 'below', 'left', 'right'.
`toolbar_sticky` | Stick the toolbar to the edge of the plot. Default: TRUE If FALSE, the toolbar will be outside of the axes, titles etc.
`h_symmetry` | Whether the total horizontal padding on both sides of the plot will be made equal (the left or right padding amount, whichever is larger).
`v_symmetry` | Whether the total vertical padding on both sides of the plot will be made equal (the top or bottom padding amount, whichever is larger).
`lod_factor` | Decimation factor to use when applying level-of-detail decimation.
`lod_interval` | Interval (in ms) during which an interactive tool event will enable level-of-detail downsampling.
`lod_threshold` | A number of data points, above which level-of-detail downsampling may be performed by glyph renderers. Set to “None“ to disable any level-of-detail downsampling.
`lod_timeout` | Timeout (in ms) for checking whether interactive tool events are still occurring. Once level-of-detail mode is enabled, a check is made every “lod_timeout“ ms. If no interactive tool events have happened, level-of-detail mode is disabled.
`output_backend` | Specify the output backend for the plot area. Default is "canvas", HTML5 Canvas. Note: When set to "webgl", glyphs without a WebGL rendering implementation will fall back to rendering onto 2D canvas. Must be one of 'canvas', 'svg', 'webgl'.
`min_border` | A convenience property to set all all the “min_border_X“ properties to the same value. If an individual border property is explicitly set, it will override “min_border“.
`min_border_left` | Minimum size in pixels of the padding region to the left of the central plot region. Note: This is a *minimum*. The padding region may expand as needed to accommodate titles or axes, etc.
`min_border_bottom` | Minimum size in pixels of the padding region below the bottom of the central plot region. Note: This is a *minimum*. The padding region may expand as needed to accommodate titles or axes, etc.
`min_border_right` | Minimum size in pixels of the padding region to the right of the central plot region. Note: This is a *minimum*. The padding region may expand as needed to accommodate titles or axes, etc.
`min_border_top` | Minimum size in pixels of the padding region above the top of the central plot region. Note: This is a *minimum*. The padding region may expand as needed to accommodate titles or axes, etc.
`hidpi` | Whether to use HiDPI mode when available.

### Note

This function can be used in the same way as `figure`, adding layers on top of the Google Map. Google has its own terms of service for using Google Maps API and any use of rbokeh with Google Maps must be within Google's Terms of Service

### See Also

`gmap_style`

### Examples

    ## Not run:
    gmap(lat = 40.74, lng = -73.95, zoom = 11,
      width = 600, height = 600,
      map_style = gmap_style("blue_water"), map_type = "roadmap")

    gmap(lat = 40.44, lng = -113.785, zoom = 4,
      width = 1000, height = 700,
      map_style = gmap_style("blue_water"), map_type = "roadmap") %>%
      ly_points(long, lat, data = us.cities, color = factor(capital),
        size = spec(pop, range = c(2, 50)), hover = maps::us.cities)

    ## End(Not run)

[Package rbokeh version 0.6.3 Index]