We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bokeh GMapOptions error
Bokeh version - 0.12.16
Python - 3.5
OS - Windows 10
Browser - IE, Chrome, Firefox
Other relevant packages - GMapOptions, gmap

I'm fairly new to Bokeh so please excuse me for my lack of knowledge/experience with bokeh. I am trying to create a geographic visualization using bokeh and then integrate my bokeh server app into flask to deploy it on a VPS. When run independently my code produces the necessary visualization but, gives an error in the command line. The error is occuring at the gmap call. I tried looking this error up and found a few relevant results all of which pointed to bugs in the Bokeh library. Where I am really getting stuck is, at the point of deployment of this visualization either independently as a bokeh server app or by integrating it with Flask because of this error. Any help on this is greatly appreciated. Thanks!


```
from bokeh.io import curdoc
from bokeh.models import GMapOptions
from bokeh.plotting import gmap
map_options = GMapOptions(lat=37.686293, lng=-97.3614409, map_type="roadmap", zoom=13)
p = gmap(google_api_key="My Google Maps API Key", map_options=map_options, title="Resolutions Clients", plot_width=1000, plot_height=600)
curdoc().add_root(p)
```


C:\Users\Administrator\PycharmProjects\FlaskApp>bokeh serve --show test.py
2018-06-11 14:20:52,449 Starting Bokeh server version 0.12.16 (running on Tornad
o 5.0.2)
2018-06-11 14:20:52,463 Bokeh app running at: http://localhost:5006/test
2018-06-11 14:20:52,464 Starting Bokeh server with process id: 9972
2018-06-11 14:20:52,816 200 GET /test (::1) 161.02ms
2018-06-11 14:20:53,072 101 GET /test/ws?bokeh-protocol-version=1.0&bokeh-sessio
n-id=YwriVJupgcBKp7IEeFdj5R95PJG2lxe6g82SFqbObcDA (::1) 1.00ms
2018-06-11 14:20:53,072 WebSocket connection opened
2018-06-11 14:20:53,072 ServerConnection created
2018-06-11 14:20:53,120 error handling message Message 'PATCH-DOC' (revision 1):
 TypeError("__init__() missing 2 required positional arguments: 'google_api_key'
 and 'map_options'",)




--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bokeh/plotting/gmap.py`
Content:
```
1 from __future__ import absolute_import, print_function
2 
3 import logging
4 logger = logging.getLogger(__name__)
5 
6 from six import string_types
7 
8 from ..core.enums import HorizontalLocation, VerticalLocation
9 from ..core.properties import Auto, Either, Enum, Int, Seq, Instance, String
10 from ..models import GMapPlot, LinearAxis, MercatorTicker, MercatorTickFormatter, Range1d, Title, Tool
11 from ..models import glyphs, markers
12 from ..models.tools import Drag, Inspection, Scroll, Tap
13 from ..util.options import Options
14 from .helpers import _process_tools_arg, _process_active_tools, _glyph_function
15 
16 DEFAULT_TOOLS = "pan,wheel_zoom,reset,help"
17 
18 class GMapFigureOptions(Options):
19 
20     tools = Either(String, Seq(Either(String, Instance(Tool))), default=DEFAULT_TOOLS, help="""
21     Tools the plot should start with.
22     """)
23 
24     x_minor_ticks = Either(Auto, Int, default="auto", help="""
25     Number of minor ticks between adjacent x-axis major ticks.
26     """)
27 
28     y_minor_ticks = Either(Auto, Int, default="auto", help="""
29     Number of minor ticks between adjacent y-axis major ticks.
30     """)
31 
32     x_axis_location = Enum(VerticalLocation, default="below", help="""
33     Where the x-axis should be located.
34     """)
35 
36     y_axis_location = Enum(HorizontalLocation, default="left", help="""
37     Where the y-axis should be located.
38     """)
39 
40     x_axis_label = String(default="", help="""
41     A label for the x-axis.
42     """)
43 
44     y_axis_label = String(default="", help="""
45     A label for the y-axis.
46     """)
47 
48     active_drag = Either(Auto, String, Instance(Drag), default="auto", help="""
49     Which drag tool should initially be active.
50     """)
51 
52     active_inspect = Either(Auto, String, Instance(Inspection), Seq(Instance(Inspection)), default="auto", help="""
53     Which drag tool should initially be active.
54     """)
55 
56     active_scroll = Either(Auto, String, Instance(Scroll), default="auto", help="""
57     Which scroll tool should initially be active.
58     """)
59 
60     active_tap = Either(Auto, String, Instance(Tap), default="auto", help="""
61     Which tap tool should initially be active.
62     """)
63 
64 class GMap(GMapPlot):
65     ''' A subclass of :class:`~bokeh.models.plots.Plot` that simplifies plot
66     creation with default axes, grids, tools, etc.
67 
68     In addition to all the Bokeh model property attributes documented below,
69     the ``Figure`` initializer also accepts the following options, which can
70     help simplify configuration:
71 
72     .. bokeh-options:: GMapFigureOptions
73         :module: bokeh.plotting.figure
74 
75     '''
76 
77     __subtype__ = "GMap"
78     __view_model__ = "GMapPlot"
79 
80     def __init__(self, google_api_key, map_options, **kw):
81 
82         if 'plot_width' in kw and 'width' in kw:
83             raise ValueError("Figure called with both 'plot_width' and 'width' supplied, supply only one")
84         if 'plot_height' in kw and 'height' in kw:
85             raise ValueError("Figure called with both 'plot_height' and 'height' supplied, supply only one")
86         if 'height' in kw:
87             kw['plot_height'] = kw.pop('height')
88         if 'width' in kw:
89             kw['plot_width'] = kw.pop('width')
90 
91         opts = GMapFigureOptions(kw)
92 
93         title = kw.get("title", None)
94         if isinstance(title, string_types):
95             kw['title'] = Title(text=title)
96 
97         super(GMap, self).__init__(api_key=google_api_key, map_options=map_options,
98                                    x_range=Range1d(), y_range=Range1d(), **kw)
99 
100         xf = MercatorTickFormatter(dimension="lon")
101         xt = MercatorTicker(dimension="lon")
102         self.add_layout(LinearAxis(formatter=xf, ticker=xt), 'below')
103 
104         yf = MercatorTickFormatter(dimension="lat")
105         yt = MercatorTicker(dimension="lat")
106         self.add_layout(LinearAxis(formatter=yf, ticker=yt), 'left')
107 
108         tool_objs, tool_map = _process_tools_arg(self, opts.tools)
109         self.add_tools(*tool_objs)
110         _process_active_tools(self.toolbar, tool_map, opts.active_drag, opts.active_inspect, opts.active_scroll, opts.active_tap)
111 
112     annular_wedge = _glyph_function(glyphs.AnnularWedge)
113 
114     annulus = _glyph_function(glyphs.Annulus)
115 
116     arc = _glyph_function(glyphs.Arc)
117 
118     asterisk = _glyph_function(markers.Asterisk)
119 
120     bezier = _glyph_function(glyphs.Bezier)
121 
122     circle = _glyph_function(markers.Circle)
123 
124     circle_cross = _glyph_function(markers.CircleCross)
125 
126     circle_x = _glyph_function(markers.CircleX)
127 
128     cross = _glyph_function(markers.Cross)
129 
130     diamond = _glyph_function(markers.Diamond)
131 
132     diamond_cross = _glyph_function(markers.DiamondCross)
133 
134     hbar = _glyph_function(glyphs.HBar)
135 
136     ellipse = _glyph_function(glyphs.Ellipse)
137 
138     image = _glyph_function(glyphs.Image)
139 
140     image_rgba = _glyph_function(glyphs.ImageRGBA)
141 
142     image_url = _glyph_function(glyphs.ImageURL)
143 
144     inverted_triangle = _glyph_function(markers.InvertedTriangle)
145 
146     line = _glyph_function(glyphs.Line)
147 
148     multi_line = _glyph_function(glyphs.MultiLine)
149 
150     oval = _glyph_function(glyphs.Oval)
151 
152     patch = _glyph_function(glyphs.Patch)
153 
154     patches = _glyph_function(glyphs.Patches)
155 
156     quad = _glyph_function(glyphs.Quad)
157 
158     quadratic = _glyph_function(glyphs.Quadratic)
159 
160     ray = _glyph_function(glyphs.Ray)
161 
162     rect = _glyph_function(glyphs.Rect)
163 
164     segment = _glyph_function(glyphs.Segment)
165 
166     square = _glyph_function(markers.Square)
167 
168     square_cross = _glyph_function(markers.SquareCross)
169 
170     square_x = _glyph_function(markers.SquareX)
171 
172     text = _glyph_function(glyphs.Text)
173 
174     triangle = _glyph_function(markers.Triangle)
175 
176     vbar = _glyph_function(glyphs.VBar)
177 
178     wedge = _glyph_function(glyphs.Wedge)
179 
180     x = _glyph_function(markers.X)
181 
182 def gmap(google_api_key, map_options, **kwargs):
183     ''' Create a new :class:`~bokeh.plotting.gmap.GMap` for plotting.
184 
185     Args:
186         google_api_key (str):
187             Google requires an API key be supplied for maps to function. See:
188 
189             https://developers.google.com/maps/documentation/javascript/get-api-key
190 
191         map_options: (GMapOptions)
192             Configuration specific to a Google Map
193 
194     In addition to the standard :class:`~bokeh.plotting.gmap.GMap` keyword
195     arguments (e.g. ``plot_width`` or ``sizing_mode``), the following
196     additional options can be passed as well:
197 
198     .. bokeh-options:: GMapFigureOptions
199         :module: bokeh.plotting.gmap
200 
201     Returns:
202        GMap
203 
204     '''
205 
206     return GMap(google_api_key, map_options, **kwargs)
207
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/bokeh/plotting/gmap.py b/bokeh/plotting/gmap.py
--- a/bokeh/plotting/gmap.py
+++ b/bokeh/plotting/gmap.py
@@ -65,6 +65,15 @@
     ''' A subclass of :class:`~bokeh.models.plots.Plot` that simplifies plot
     creation with default axes, grids, tools, etc.
 
+    Args:
+        google_api_key (str):
+            Google requires an API key be supplied for maps to function. See:
+
+            https://developers.google.com/maps/documentation/javascript/get-api-key
+
+        map_options: (GMapOptions)
+            Configuration specific to a Google Map
+
     In addition to all the Bokeh model property attributes documented below,
     the ``Figure`` initializer also accepts the following options, which can
     help simplify configuration:
@@ -77,7 +86,7 @@
     __subtype__ = "GMap"
     __view_model__ = "GMapPlot"
 
-    def __init__(self, google_api_key, map_options, **kw):
+    def __init__(self, **kw):
 
         if 'plot_width' in kw and 'width' in kw:
             raise ValueError("Figure called with both 'plot_width' and 'width' supplied, supply only one")
@@ -94,8 +103,7 @@
         if isinstance(title, string_types):
             kw['title'] = Title(text=title)
 
-        super(GMap, self).__init__(api_key=google_api_key, map_options=map_options,
-                                   x_range=Range1d(), y_range=Range1d(), **kw)
+        super(GMap, self).__init__(x_range=Range1d(), y_range=Range1d(), **kw)
 
         xf = MercatorTickFormatter(dimension="lon")
         xt = MercatorTicker(dimension="lon")
@@ -203,4 +211,4 @@
 
     '''
 
-    return GMap(google_api_key, map_options, **kwargs)
+    return GMap(api_key=google_api_key, map_options=map_options, **kwargs)

{"golden_diff": "diff --git a/bokeh/plotting/gmap.py b/bokeh/plotting/gmap.py\n--- a/bokeh/plotting/gmap.py\n+++ b/bokeh/plotting/gmap.py\n@@ -65,6 +65,15 @@\n     ''' A subclass of :class:`~bokeh.models.plots.Plot` that simplifies plot\n     creation with default axes, grids, tools, etc.\n \n+    Args:\n+        google_api_key (str):\n+            Google requires an API key be supplied for maps to function. See:\n+\n+            https://developers.google.com/maps/documentation/javascript/get-api-key\n+\n+        map_options: (GMapOptions)\n+            Configuration specific to a Google Map\n+\n     In addition to all the Bokeh model property attributes documented below,\n     the ``Figure`` initializer also accepts the following options, which can\n     help simplify configuration:\n@@ -77,7 +86,7 @@\n     __subtype__ = \"GMap\"\n     __view_model__ = \"GMapPlot\"\n \n-    def __init__(self, google_api_key, map_options, **kw):\n+    def __init__(self, **kw):\n \n         if 'plot_width' in kw and 'width' in kw:\n             raise ValueError(\"Figure called with both 'plot_width' and 'width' supplied, supply only one\")\n@@ -94,8 +103,7 @@\n         if isinstance(title, string_types):\n             kw['title'] = Title(text=title)\n \n-        super(GMap, self).__init__(api_key=google_api_key, map_options=map_options,\n-                                   x_range=Range1d(), y_range=Range1d(), **kw)\n+        super(GMap, self).__init__(x_range=Range1d(), y_range=Range1d(), **kw)\n \n         xf = MercatorTickFormatter(dimension=\"lon\")\n         xt = MercatorTicker(dimension=\"lon\")\n@@ -203,4 +211,4 @@\n \n     '''\n \n-    return GMap(google_api_key, map_options, **kwargs)\n+    return GMap(api_key=google_api_key, map_options=map_options, **kwargs)\n", "issue": "Bokeh GMapOptions error\nBokeh version - 0.12.16\r\nPython - 3.5\r\nOS - Windows 10\r\nBrowser - IE, Chrome, Firefox\r\nOther relevant packages - GMapOptions, gmap\r\n\r\nI'm fairly new to Bokeh so please excuse me for my lack of knowledge/experience with bokeh. I am trying to create a geographic visualization using bokeh and then integrate my bokeh server app into flask to deploy it on a VPS. When run independently my code produces the necessary visualization but, gives an error in the command line. The error is occuring at the gmap call. I tried looking this error up and found a few relevant results all of which pointed to bugs in the Bokeh library. Where I am really getting stuck is, at the point of deployment of this visualization either independently as a bokeh server app or by integrating it with Flask because of this error. Any help on this is greatly appreciated. Thanks!\r\n\r\n\r\n```\r\nfrom bokeh.io import curdoc\r\nfrom bokeh.models import GMapOptions\r\nfrom bokeh.plotting import gmap\r\nmap_options = GMapOptions(lat=37.686293, lng=-97.3614409, map_type=\"roadmap\", zoom=13)\r\np = gmap(google_api_key=\"My Google Maps API Key\", map_options=map_options, title=\"Resolutions Clients\", plot_width=1000, plot_height=600)\r\ncurdoc().add_root(p)\r\n```\r\n\r\n\r\nC:\\Users\\Administrator\\PycharmProjects\\FlaskApp>bokeh serve --show test.py\r\n2018-06-11 14:20:52,449 Starting Bokeh server version 0.12.16 (running on Tornad\r\no 5.0.2)\r\n2018-06-11 14:20:52,463 Bokeh app running at: http://localhost:5006/test\r\n2018-06-11 14:20:52,464 Starting Bokeh server with process id: 9972\r\n2018-06-11 14:20:52,816 200 GET /test (::1) 161.02ms\r\n2018-06-11 14:20:53,072 101 GET /test/ws?bokeh-protocol-version=1.0&bokeh-sessio\r\nn-id=YwriVJupgcBKp7IEeFdj5R95PJG2lxe6g82SFqbObcDA (::1) 1.00ms\r\n2018-06-11 14:20:53,072 WebSocket connection opened\r\n2018-06-11 14:20:53,072 ServerConnection created\r\n2018-06-11 14:20:53,120 error handling message Message 'PATCH-DOC' (revision 1):\r\n TypeError(\"__init__() missing 2 required positional arguments: 'google_api_key'\r\n and 'map_options'\",)\r\n\r\n\r\n\n", "before_files": [{"content": "from __future__ import absolute_import, print_function\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom six import string_types\n\nfrom ..core.enums import HorizontalLocation, VerticalLocation\nfrom ..core.properties import Auto, Either, Enum, Int, Seq, Instance, String\nfrom ..models import GMapPlot, LinearAxis, MercatorTicker, MercatorTickFormatter, Range1d, Title, Tool\nfrom ..models import glyphs, markers\nfrom ..models.tools import Drag, Inspection, Scroll, Tap\nfrom ..util.options import Options\nfrom .helpers import _process_tools_arg, _process_active_tools, _glyph_function\n\nDEFAULT_TOOLS = \"pan,wheel_zoom,reset,help\"\n\nclass GMapFigureOptions(Options):\n\n    tools = Either(String, Seq(Either(String, Instance(Tool))), default=DEFAULT_TOOLS, help=\"\"\"\n    Tools the plot should start with.\n    \"\"\")\n\n    x_minor_ticks = Either(Auto, Int, default=\"auto\", help=\"\"\"\n    Number of minor ticks between adjacent x-axis major ticks.\n    \"\"\")\n\n    y_minor_ticks = Either(Auto, Int, default=\"auto\", help=\"\"\"\n    Number of minor ticks between adjacent y-axis major ticks.\n    \"\"\")\n\n    x_axis_location = Enum(VerticalLocation, default=\"below\", help=\"\"\"\n    Where the x-axis should be located.\n    \"\"\")\n\n    y_axis_location = Enum(HorizontalLocation, default=\"left\", help=\"\"\"\n    Where the y-axis should be located.\n    \"\"\")\n\n    x_axis_label = String(default=\"\", help=\"\"\"\n    A label for the x-axis.\n    \"\"\")\n\n    y_axis_label = String(default=\"\", help=\"\"\"\n    A label for the y-axis.\n    \"\"\")\n\n    active_drag = Either(Auto, String, Instance(Drag), default=\"auto\", help=\"\"\"\n    Which drag tool should initially be active.\n    \"\"\")\n\n    active_inspect = Either(Auto, String, Instance(Inspection), Seq(Instance(Inspection)), default=\"auto\", help=\"\"\"\n    Which drag tool should initially be active.\n    \"\"\")\n\n    active_scroll = Either(Auto, String, Instance(Scroll), default=\"auto\", help=\"\"\"\n    Which scroll tool should initially be active.\n    \"\"\")\n\n    active_tap = Either(Auto, String, Instance(Tap), default=\"auto\", help=\"\"\"\n    Which tap tool should initially be active.\n    \"\"\")\n\nclass GMap(GMapPlot):\n    ''' A subclass of :class:`~bokeh.models.plots.Plot` that simplifies plot\n    creation with default axes, grids, tools, etc.\n\n    In addition to all the Bokeh model property attributes documented below,\n    the ``Figure`` initializer also accepts the following options, which can\n    help simplify configuration:\n\n    .. bokeh-options:: GMapFigureOptions\n        :module: bokeh.plotting.figure\n\n    '''\n\n    __subtype__ = \"GMap\"\n    __view_model__ = \"GMapPlot\"\n\n    def __init__(self, google_api_key, map_options, **kw):\n\n        if 'plot_width' in kw and 'width' in kw:\n            raise ValueError(\"Figure called with both 'plot_width' and 'width' supplied, supply only one\")\n        if 'plot_height' in kw and 'height' in kw:\n            raise ValueError(\"Figure called with both 'plot_height' and 'height' supplied, supply only one\")\n        if 'height' in kw:\n            kw['plot_height'] = kw.pop('height')\n        if 'width' in kw:\n            kw['plot_width'] = kw.pop('width')\n\n        opts = GMapFigureOptions(kw)\n\n        title = kw.get(\"title\", None)\n        if isinstance(title, string_types):\n            kw['title'] = Title(text=title)\n\n        super(GMap, self).__init__(api_key=google_api_key, map_options=map_options,\n                                   x_range=Range1d(), y_range=Range1d(), **kw)\n\n        xf = MercatorTickFormatter(dimension=\"lon\")\n        xt = MercatorTicker(dimension=\"lon\")\n        self.add_layout(LinearAxis(formatter=xf, ticker=xt), 'below')\n\n        yf = MercatorTickFormatter(dimension=\"lat\")\n        yt = MercatorTicker(dimension=\"lat\")\n        self.add_layout(LinearAxis(formatter=yf, ticker=yt), 'left')\n\n        tool_objs, tool_map = _process_tools_arg(self, opts.tools)\n        self.add_tools(*tool_objs)\n        _process_active_tools(self.toolbar, tool_map, opts.active_drag, opts.active_inspect, opts.active_scroll, opts.active_tap)\n\n    annular_wedge = _glyph_function(glyphs.AnnularWedge)\n\n    annulus = _glyph_function(glyphs.Annulus)\n\n    arc = _glyph_function(glyphs.Arc)\n\n    asterisk = _glyph_function(markers.Asterisk)\n\n    bezier = _glyph_function(glyphs.Bezier)\n\n    circle = _glyph_function(markers.Circle)\n\n    circle_cross = _glyph_function(markers.CircleCross)\n\n    circle_x = _glyph_function(markers.CircleX)\n\n    cross = _glyph_function(markers.Cross)\n\n    diamond = _glyph_function(markers.Diamond)\n\n    diamond_cross = _glyph_function(markers.DiamondCross)\n\n    hbar = _glyph_function(glyphs.HBar)\n\n    ellipse = _glyph_function(glyphs.Ellipse)\n\n    image = _glyph_function(glyphs.Image)\n\n    image_rgba = _glyph_function(glyphs.ImageRGBA)\n\n    image_url = _glyph_function(glyphs.ImageURL)\n\n    inverted_triangle = _glyph_function(markers.InvertedTriangle)\n\n    line = _glyph_function(glyphs.Line)\n\n    multi_line = _glyph_function(glyphs.MultiLine)\n\n    oval = _glyph_function(glyphs.Oval)\n\n    patch = _glyph_function(glyphs.Patch)\n\n    patches = _glyph_function(glyphs.Patches)\n\n    quad = _glyph_function(glyphs.Quad)\n\n    quadratic = _glyph_function(glyphs.Quadratic)\n\n    ray = _glyph_function(glyphs.Ray)\n\n    rect = _glyph_function(glyphs.Rect)\n\n    segment = _glyph_function(glyphs.Segment)\n\n    square = _glyph_function(markers.Square)\n\n    square_cross = _glyph_function(markers.SquareCross)\n\n    square_x = _glyph_function(markers.SquareX)\n\n    text = _glyph_function(glyphs.Text)\n\n    triangle = _glyph_function(markers.Triangle)\n\n    vbar = _glyph_function(glyphs.VBar)\n\n    wedge = _glyph_function(glyphs.Wedge)\n\n    x = _glyph_function(markers.X)\n\ndef gmap(google_api_key, map_options, **kwargs):\n    ''' Create a new :class:`~bokeh.plotting.gmap.GMap` for plotting.\n\n    Args:\n        google_api_key (str):\n            Google requires an API key be supplied for maps to function. See:\n\n            https://developers.google.com/maps/documentation/javascript/get-api-key\n\n        map_options: (GMapOptions)\n            Configuration specific to a Google Map\n\n    In addition to the standard :class:`~bokeh.plotting.gmap.GMap` keyword\n    arguments (e.g. ``plot_width`` or ``sizing_mode``), the following\n    additional options can be passed as well:\n\n    .. bokeh-options:: GMapFigureOptions\n        :module: bokeh.plotting.gmap\n\n    Returns:\n       GMap\n\n    '''\n\n    return GMap(google_api_key, map_options, **kwargs)\n", "path": "bokeh/plotting/gmap.py"}], "after_files": [{"content": "from __future__ import absolute_import, print_function\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nfrom six import string_types\n\nfrom ..core.enums import HorizontalLocation, VerticalLocation\nfrom ..core.properties import Auto, Either, Enum, Int, Seq, Instance, String\nfrom ..models import GMapPlot, LinearAxis, MercatorTicker, MercatorTickFormatter, Range1d, Title, Tool\nfrom ..models import glyphs, markers\nfrom ..models.tools import Drag, Inspection, Scroll, Tap\nfrom ..util.options import Options\nfrom .helpers import _process_tools_arg, _process_active_tools, _glyph_function\n\nDEFAULT_TOOLS = \"pan,wheel_zoom,reset,help\"\n\nclass GMapFigureOptions(Options):\n\n    tools = Either(String, Seq(Either(String, Instance(Tool))), default=DEFAULT_TOOLS, help=\"\"\"\n    Tools the plot should start with.\n    \"\"\")\n\n    x_minor_ticks = Either(Auto, Int, default=\"auto\", help=\"\"\"\n    Number of minor ticks between adjacent x-axis major ticks.\n    \"\"\")\n\n    y_minor_ticks = Either(Auto, Int, default=\"auto\", help=\"\"\"\n    Number of minor ticks between adjacent y-axis major ticks.\n    \"\"\")\n\n    x_axis_location = Enum(VerticalLocation, default=\"below\", help=\"\"\"\n    Where the x-axis should be located.\n    \"\"\")\n\n    y_axis_location = Enum(HorizontalLocation, default=\"left\", help=\"\"\"\n    Where the y-axis should be located.\n    \"\"\")\n\n    x_axis_label = String(default=\"\", help=\"\"\"\n    A label for the x-axis.\n    \"\"\")\n\n    y_axis_label = String(default=\"\", help=\"\"\"\n    A label for the y-axis.\n    \"\"\")\n\n    active_drag = Either(Auto, String, Instance(Drag), default=\"auto\", help=\"\"\"\n    Which drag tool should initially be active.\n    \"\"\")\n\n    active_inspect = Either(Auto, String, Instance(Inspection), Seq(Instance(Inspection)), default=\"auto\", help=\"\"\"\n    Which drag tool should initially be active.\n    \"\"\")\n\n    active_scroll = Either(Auto, String, Instance(Scroll), default=\"auto\", help=\"\"\"\n    Which scroll tool should initially be active.\n    \"\"\")\n\n    active_tap = Either(Auto, String, Instance(Tap), default=\"auto\", help=\"\"\"\n    Which tap tool should initially be active.\n    \"\"\")\n\nclass GMap(GMapPlot):\n    ''' A subclass of :class:`~bokeh.models.plots.Plot` that simplifies plot\n    creation with default axes, grids, tools, etc.\n\n    Args:\n        google_api_key (str):\n            Google requires an API key be supplied for maps to function. See:\n\n            https://developers.google.com/maps/documentation/javascript/get-api-key\n\n        map_options: (GMapOptions)\n            Configuration specific to a Google Map\n\n    In addition to all the Bokeh model property attributes documented below,\n    the ``Figure`` initializer also accepts the following options, which can\n    help simplify configuration:\n\n    .. bokeh-options:: GMapFigureOptions\n        :module: bokeh.plotting.figure\n\n    '''\n\n    __subtype__ = \"GMap\"\n    __view_model__ = \"GMapPlot\"\n\n    def __init__(self, **kw):\n\n        if 'plot_width' in kw and 'width' in kw:\n            raise ValueError(\"Figure called with both 'plot_width' and 'width' supplied, supply only one\")\n        if 'plot_height' in kw and 'height' in kw:\n            raise ValueError(\"Figure called with both 'plot_height' and 'height' supplied, supply only one\")\n        if 'height' in kw:\n            kw['plot_height'] = kw.pop('height')\n        if 'width' in kw:\n            kw['plot_width'] = kw.pop('width')\n\n        opts = GMapFigureOptions(kw)\n\n        title = kw.get(\"title\", None)\n        if isinstance(title, string_types):\n            kw['title'] = Title(text=title)\n\n        super(GMap, self).__init__(x_range=Range1d(), y_range=Range1d(), **kw)\n\n        xf = MercatorTickFormatter(dimension=\"lon\")\n        xt = MercatorTicker(dimension=\"lon\")\n        self.add_layout(LinearAxis(formatter=xf, ticker=xt), 'below')\n\n        yf = MercatorTickFormatter(dimension=\"lat\")\n        yt = MercatorTicker(dimension=\"lat\")\n        self.add_layout(LinearAxis(formatter=yf, ticker=yt), 'left')\n\n        tool_objs, tool_map = _process_tools_arg(self, opts.tools)\n        self.add_tools(*tool_objs)\n        _process_active_tools(self.toolbar, tool_map, opts.active_drag, opts.active_inspect, opts.active_scroll, opts.active_tap)\n\n    annular_wedge = _glyph_function(glyphs.AnnularWedge)\n\n    annulus = _glyph_function(glyphs.Annulus)\n\n    arc = _glyph_function(glyphs.Arc)\n\n    asterisk = _glyph_function(markers.Asterisk)\n\n    bezier = _glyph_function(glyphs.Bezier)\n\n    circle = _glyph_function(markers.Circle)\n\n    circle_cross = _glyph_function(markers.CircleCross)\n\n    circle_x = _glyph_function(markers.CircleX)\n\n    cross = _glyph_function(markers.Cross)\n\n    diamond = _glyph_function(markers.Diamond)\n\n    diamond_cross = _glyph_function(markers.DiamondCross)\n\n    hbar = _glyph_function(glyphs.HBar)\n\n    ellipse = _glyph_function(glyphs.Ellipse)\n\n    image = _glyph_function(glyphs.Image)\n\n    image_rgba = _glyph_function(glyphs.ImageRGBA)\n\n    image_url = _glyph_function(glyphs.ImageURL)\n\n    inverted_triangle = _glyph_function(markers.InvertedTriangle)\n\n    line = _glyph_function(glyphs.Line)\n\n    multi_line = _glyph_function(glyphs.MultiLine)\n\n    oval = _glyph_function(glyphs.Oval)\n\n    patch = _glyph_function(glyphs.Patch)\n\n    patches = _glyph_function(glyphs.Patches)\n\n    quad = _glyph_function(glyphs.Quad)\n\n    quadratic = _glyph_function(glyphs.Quadratic)\n\n    ray = _glyph_function(glyphs.Ray)\n\n    rect = _glyph_function(glyphs.Rect)\n\n    segment = _glyph_function(glyphs.Segment)\n\n    square = _glyph_function(markers.Square)\n\n    square_cross = _glyph_function(markers.SquareCross)\n\n    square_x = _glyph_function(markers.SquareX)\n\n    text = _glyph_function(glyphs.Text)\n\n    triangle = _glyph_function(markers.Triangle)\n\n    vbar = _glyph_function(glyphs.VBar)\n\n    wedge = _glyph_function(glyphs.Wedge)\n\n    x = _glyph_function(markers.X)\n\ndef gmap(google_api_key, map_options, **kwargs):\n    ''' Create a new :class:`~bokeh.plotting.gmap.GMap` for plotting.\n\n    Args:\n        google_api_key (str):\n            Google requires an API key be supplied for maps to function. See:\n\n            https://developers.google.com/maps/documentation/javascript/get-api-key\n\n        map_options: (GMapOptions)\n            Configuration specific to a Google Map\n\n    In addition to the standard :class:`~bokeh.plotting.gmap.GMap` keyword\n    arguments (e.g. ``plot_width`` or ``sizing_mode``), the following\n    additional options can be passed as well:\n\n    .. bokeh-options:: GMapFigureOptions\n        :module: bokeh.plotting.gmap\n\n    Returns:\n       GMap\n\n    '''\n\n    return GMap(api_key=google_api_key, map_options=map_options, **kwargs)\n", "path": "bokeh/plotting/gmap.py"}]}