staticmap icon indicating copy to clipboard operation
staticmap copied to clipboard

Added support for explicit-boundary blank maps

Open maxvonhippel opened this issue 9 years ago • 2 comments

You can now create blank maps by setting an explicit extent. To be clear, I have only added explicit extent support for blank maps. Non-blank ones are more difficult (and frankly not a feature I currently need), but if someone else wants to give it a go I'm sure it would be a good feature to have.

Here is an example, which I tested and which works:

_map = StaticMap(500, 500, url_template='http://a.tile.osm.org/{z}/{x}/{y}.png')
_map.set_extent(83.676659, 28.220671, 83.804604, 28.409901)
_img = _map.render(zoom=5)
_img.save("boxtest.png")

maxvonhippel avatar Dec 20 '16 18:12 maxvonhippel

(addresses issue 3 and 4)

maxvonhippel avatar Dec 20 '16 18:12 maxvonhippel

Thanks @maxvonhippel for this request, I haven't seen it earlier that's why I respond that late.

I can understand your use case and I am sure others will need this feature too. however I think there is an easier approach to accomplish it, with the features already implemented in this library.

Only a tiny change is needed see https://github.com/komoot/staticmap/pull/10

Do you think this would work out for you too?

christophlingg avatar Feb 15 '17 11:02 christophlingg