NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

From Google Maps Android API v2, I understand that this can be done through this method:

LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (Location loc : allLocations) {
    LatLng position = new LatLng(loc.getLatitude(), loc.getLongitude());
    builder.include(position);
}

CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(builder.build(), someMarginValue);
map.moveCamera(cu);

However I can't seem to find a way to do this for OSMDroid. Is there a solution/ class to help determine the zoom level based on a set of locations?

I need the zoom level to be determined first as I am downloading a specific set of maptiles for offline display. However to do that I need to determine the right zoom level to download from the server first... Are there any algorithms out there that can determine this zoom level first?

asked 07 Feb '13, 11:00

lyk's gravatar image

lyk
41446
accept rate: 0%


Maybe the OSM wiki can help about Zoomlevels

permanent link

answered 07 Feb '13, 22:39

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Follow this question

By Email:

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

By RSS:

Answers

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:

×107
×13
×5

question asked: 07 Feb '13, 11:00

question was seen: 7,691 times

last updated: 07 Feb '13, 22:39

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum