Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GMapPlot Resets to (0, 0) #2822

avanetten opened this issue Sep 8, 2015 · 2 comments

GMapPlot Resets to (0, 0) #2822

avanetten opened this issue Sep 8, 2015 · 2 comments


Copy link

@avanetten avanetten commented Sep 8, 2015

ResetTool() for GmapPlot centers on lat, lon = (0,0), rather than the lat, lon defined in GMapOptions.

from __future__ import print_function
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
    GMapPlot, GeoJSPlot, Range1d, ColumnDataSource, LinearAxis,
    PanTool, WheelZoomTool, BoxSelectTool, ResetTool,
    BoxSelectionOverlay, GMapOptions, GeoJSOptions, GeoJSPlot, 
    NumeralTickFormatter, PrintfTickFormatter)
from bokeh.resources import INLINE

gmap_options = GMapOptions(lat=30.2861, lng=-97.7394, map_type="roadmap", zoom=13)

x_range = Range1d()
y_range = Range1d()

plot = GMapPlot(
        x_range=x_range, y_range=y_range,
        title = "Austin")

source = ColumnDataSource(
        lat=[30.2861, 30.2855, 30.2869],
        lon=[-97.7394, -97.7390, -97.7405],
        fill=['orange', 'blue', 'green']

circle = Circle(x="lon", y="lat", size=15, fill_color="fill", line_color="black")
plot.add_glyph(source, circle)

plot.add_tools(PanTool(), WheelZoomTool(), ResetTool())

xaxis = LinearAxis(axis_label="lat", major_tick_in=0, formatter=NumeralTickFormatter(format="0.000"))
plot.add_layout(xaxis, 'below')

yaxis = LinearAxis(axis_label="lon", major_tick_in=0, formatter=PrintfTickFormatter(format="%.3f"))
plot.add_layout(yaxis, 'left')

doc = Document()

if __name__ == "__main__":
    filename = "maps.html"
    with open(filename, "w") as f:
        f.write(file_html(doc, INLINE, "Maps Example"))
    print("Wrote %s" % filename)
Copy link

@bryevdv bryevdv commented Sep 8, 2015

@brendancol could you take a look at this?

Copy link

@birdsarah birdsarah commented Feb 10, 2016

As of 0.11.1, reset just appears to do nothing, rather than resetting to 0,0.

A fix may be related to #3783 (but may be not).

Here's updated code: (note this plot is only rendering sometimes for me - probably related to #3737)

@bryevdv bryevdv modified the milestones: 0.12.5, short-term Jan 9, 2017
@bryevdv bryevdv mentioned this issue Jan 24, 2017
1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.