Code Monkey home page Code Monkey logo

Comments (5)

frslm avatar frslm commented on May 19, 2024 1

I've just merged this into master in #153, you can set it by passing in a bounds literal when creating a GoogleMapPlotter object:

import gmplot

fit_bounds = {'north':37.832285, 'south': 37.637336, 'west': -122.520364, 'east': -122.346922}
gmap = gmplot.GoogleMapPlotter(37.766956, -122.438481, 13, fit_bounds=fit_bounds)

from gmplot.

adeharo9 avatar adeharo9 commented on May 19, 2024

Agreed, this feature would make fitting the map in the desired bounds way easier than it is right now.

from gmplot.

keithstellyes avatar keithstellyes commented on May 19, 2024

I would also find this highly useful and am trying to figure this out right now.

How is everyone doing this right now?

from gmplot.

enriqueav avatar enriqueav commented on May 19, 2024

@keithstellyes
You may want to take a look at this:
https://github.com/enriqueav/gmplot/blob/master/gmplot/gmplot.py#L173

# Call to fit_bounds
# https://developers.google.com/maps/documentation/javascript/reference/map#Map.fitBounds
gmap.fit_bounds(north, east, south, west)

from gmplot.

keithstellyes avatar keithstellyes commented on May 19, 2024

Right as you said that I found this PR and got it working:

2b5b2d6

However that code in that PR is slightly bugged in that SW is supposed to go first, NE.

Thanks either way though! Appreciate it :)

from gmplot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.