0

I'm using OpenStreetMap with JMapViewer and trying to zoom my map onto a street level view of central London, but I can't zoom in my map.

I have tried using code like this:

map().setCenter(new Point(900, 600))
map().setZoom(50);
map().setDisplayPosition(200,200, 4)

However, I can only zoom onto central London successfully with code like this:

map().setZoom(10);
map().setCenter(new Point(131000, 87150));
map().setZoom(12);

Why did I need to set the zoom multiple times to get the zooming to work?

Is it possible to limit the number of zoom levels? I've found this non-Java specific method of doing so, but not a Java specific implementation of limiting zoom levels.

Emily Mabrey
  • 1,528
  • 1
  • 12
  • 29
MTA
  • 739
  • 2
  • 9
  • 29
  • Any error or so? Does anything happen at all? – kwoxer Nov 19 '15 at 21:08
  • @kwoxer I modified the question. Thanks – MTA Nov 20 '15 at 12:30
  • I never used jmapviewer. If you want guys like me to have a look on it, please create a fiddle. Otherwhise it is not probably that you can any help. Thanks. – kwoxer Nov 20 '15 at 15:08
  • @kwoxer what is fiddle? how can i use it? could you please give me a reference I tried searching online but its not clear to me. Thanks. – MTA Nov 20 '15 at 19:03
  • http://jsfiddle.net/ is site for creating content that is running all in the browser. You can add CSS, HTML and JS just in your browser. At the end you share the running version via link here on SO. There are several alternatives like JSBin this is up to you which one you choose. – kwoxer Nov 20 '15 at 19:29
  • but i'm trying to use openstreetmap with java for a desktop application, not using a browser – MTA Nov 20 '15 at 19:39
  • I get something similar with `BingAerialTileSource`; apparently, the Bing attribution data is not yet loaded. – trashgod Nov 21 '15 at 10:32

0 Answers0