PATRIK27 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Mini-map should be an overlay? #124

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There is obviously a lot of overlap between the main map and the mini-map, but 
it would be much cleaner if we implement the mini-map as an overlay rather than 
intertwined with the OpenStreetMapView. They can share the same tileprovider, 
and there just needs to be a sync mechanism between the two.

Thoughts?

Original issue reported on code.google.com by kurtzm...@gmail.com on 16 Dec 2010 at 3:08

GoogleCodeExporter commented 8 years ago
This can probably be done - either by creating an additional MapView or by 
creating a TilesOverlay and drawing it during the onDraw in the overlay. The 
biggest problem is manipulating the projection, and some changes to allow mock 
projections would be helpful to get this done.

Original comment by kurtzm...@gmail.com on 5 Jan 2011 at 4:05

GoogleCodeExporter commented 8 years ago

Original comment by kurtzm...@gmail.com on 5 Jan 2011 at 4:05

GoogleCodeExporter commented 8 years ago
This has been implemented. Any comments before I remove the old minimap from 
the MapView class?

Original comment by kurtzm...@gmail.com on 10 Jan 2011 at 12:19

GoogleCodeExporter commented 8 years ago
It's nice to see the mini-map working again!  And better than before!

I have a comment though.  There used to be a zoom difference between the main 
map and the mini-map.  So for example if the difference was 3 and the main map 
was zoom 9 then the mini-map would be zoom 6.

Another comment - perhaps a more difficult one - double-tapping on the mini-map 
zooms somewhere, but not to the point where you double-tapped.

Original comment by neilboyd on 10 Jan 2011 at 10:04

GoogleCodeExporter commented 8 years ago
Neil - there absolutely should be a zoom difference of three (set by 
ZOOM_LEVEL_DIFFERENCE). On my phone, I can definitely see that the tiles in the 
mini-map are zoomed out from the main map. But also make sure that your main 
map is zoomed in a bit so you can see the difference. At zoom level 0, the mini 
map will be at zoom level 0 also (since it can't zoom out any more). Let me 
know if you see differently.

Double-clicking on the mini-map is going to register as a zoom-in to the point 
on the main map, not a zoom-in on the mini-map. That might be able to be 
implemented, but I think it makes more sense the way it is. I actually hope to 
add better click, double-click, and long-click support to the overlays at some 
point, which would help the situation if we wanted to change the behavior.

I hope everyone enjoys the mini-map. It doesn't look like a lot of code, but it 
was a *lot* of work to do. I definitely have a much better understanding of 
that section of the code now, so that's a good thing!

Original comment by kurtzm...@gmail.com on 11 Jan 2011 at 3:32

GoogleCodeExporter commented 8 years ago
Okay, I can see a difference, although it only looks like 1.  I think the 
previous version had it as a parameter though.

Something else I noticed - similar to the double-tap thing - dragging the 
mini-map actually drags the main map.

Perhaps you could make the outstanding issues that I mentioned as new issues - 
they're not worth holding this one up for. Or I could do it if you prefer.

Anyway, I can imagine that it was a lot of work - well done!

For reference, this also fixes issue 10, issue 30, issue 69.

Original comment by neilboyd on 11 Jan 2011 at 9:28

GoogleCodeExporter commented 8 years ago
You're right - actions in the area of the mini-map shouldn't trigger things on 
the main map. It's an overlay and it should manage events in it's area. At a 
minimum it will consume these events and not respond to them. This will prevent 
situations like having an itemized item overlay underneath a mini-map overlay 
and having clicks on the mini-map trigger events to a hidden item underneath 
the mini-map.

It would be interesting to be able to scroll and zoom on the mini-map and have 
it change the main map, but I think that will be difficult. It's up to you if 
you want to add a new ticket for something like that. I'll add the ability to 
change the zoom difference, which is definitely needed.

Original comment by kurtzm...@gmail.com on 12 Jan 2011 at 2:35

GoogleCodeExporter commented 8 years ago
Okay - the mini-map no longer responds to clicks, double-clicks, or 
long-clicks. I also made everything configurable - zoom difference, height, 
width, padding. Much better.

(we might want to create an overlay manager class to handle overlay interaction)

Original comment by kurtzm...@gmail.com on 12 Jan 2011 at 4:56

GoogleCodeExporter commented 8 years ago
This is complete and appears to be working well, so it can be closed.

Original comment by kurtzm...@gmail.com on 20 Jan 2011 at 5:17