Guest User

Untitled

a guest
Jan 18th, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. ValueError: Invalid value for 'x_range', MapPlot ranges may only be Range1d, not data ranges
  2.  
  3. sudo lsof -t -i tcp:5000 -s tcp:listen | sudo xargs kill
  4.  
  5. from bokeh.models import (
  6. GMapPlot, GMapOptions, ColumnDataSource, Circle, DataRange1d, PanTool,
  7. WheelZoomTool, BoxSelectTool
  8. )
  9. from bokeh.io import output_file, show, output_notebook
  10.  
  11. output_notebook()
  12.  
  13.  
  14. map_options = GMapOptions(lat=30.29, lng=-97.73, map_type="roadmap", zoom=11)
  15.  
  16. plot = GMapPlot(
  17. x_range=DataRange1d(), y_range=DataRange1d(), map_options=map_options
  18. )
  19.  
  20. plot.title.text = "Austin"
  21.  
  22.  
  23. plot.api_key = "INSERT PERSONAL GOOGLE API KEY"
  24.  
  25.  
  26. completed_lats = [30.265872,30.2900002]
  27.  
  28. completed_longs = [-97.749270,-97.733322]
  29.  
  30. completed_source = ColumnDataSource( data=dict(
  31. lat=completed_lats,
  32. lon=completed_longs,))
  33.  
  34. completed_dots = Circle(x="lon", y="lat", size=50, fill_color="blue",
  35. fill_alpha=0.1, line_color=None)
  36. plot.add_glyph(completed_source, completed_dots)
  37.  
  38.  
  39. plot.add_tools(PanTool(), WheelZoomTool(), BoxSelectTool())
  40.  
  41. show(plot)
Add Comment
Please, Sign In to add comment