Why not ask your question on the new OpenStreetMap Community Forum?

My map will have two markers for routing purpose, now how could i automatically zoom out to the center between those two markers? Is there any alternative approach to fitBounds in osmdroid(or is there fitBounds itself!!)?

Thanks in advance :)

asked 07 Jun '16, 14:14

Arun%20Gowtham's gravatar image

Arun Gowtham
accept rate: 0%

edited 07 Jun '16, 20:32

aseerel4c26's gravatar image

aseerel4c26 ♦

There is a solution on Stack Overflow. Basically you have to compute a bounding box by iterating over your markers and calculating min/max lat and lon. Then just call zoomToBoundingBox().

permanent link

answered 07 Jun '16, 16:58

scai's gravatar image

scai ♦
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 07 Jun '16, 14:14

question was seen: 4,861 times

last updated: 07 Jun '16, 20:32

powered by OSQA