anhtuanmai / osmdroid

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

Split and modularlize MyLocation and Compass overlay #383

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The MyLocationOverlay class has been kicking around since 2008. It has grown to 
add a lot of functionality but it has become a mess. I'd like to do the 
following:

1. Split the overlay into two separate overlays - one to handle the MyLocation 
stuff and one to handle the Compass stuff.
2. Make the location data (for MyLocation) and bearing data (for Compass) be 
provided by an interface to make it much more modular. Implement the two 
current data providers - GPS for MyLocation and internal compass sensor for 
Compass.

Essentially the new classes would have the same functionality while being much 
more extensible and cleaner.

Original issue reported on code.google.com by kurtzm...@gmail.com on 1 Nov 2012 at 6:25

GoogleCodeExporter commented 8 years ago
Patch attached - note that it depends on the safe canvas drawing patch in 221 
(but that could easily be reversed if necessary).

Original comment by kurtzm...@gmail.com on 2 Nov 2012 at 3:52

Attachments:

GoogleCodeExporter commented 8 years ago
I was going to do something similar in issue 284 but didn't get round to doing 
anything

Original comment by neilboyd on 3 Nov 2012 at 11:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I just realized I never included the CompassOverlay. Here is the updated patch. 
Apply in the overlay package folder.

Original comment by kurtzm...@gmail.com on 14 Nov 2012 at 3:34

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1138.

Original comment by kurtzm...@gmail.com on 3 Jan 2013 at 7:43

GoogleCodeExporter commented 8 years ago
Hi,

By the chance of my location / compass changes it would be convenient to have 
them more extendable.
One example: we cannot change the my location bitmaps from extending classes - 
we have to change the osmdroid code. Right now the mPersonBitmap and 
mDirectionArrowBitmap are protected but also final.

Thanks.

Original comment by devemu...@gmail.com on 4 Jan 2013 at 12:20

GoogleCodeExporter commented 8 years ago
Write your own ResourceProxy and you can supply your own Drawables for person 
and direction_arrow. That is what the ResourceProxy is (sort-of) for.

Original comment by kurtzm...@gmail.com on 4 Jan 2013 at 2:08

GoogleCodeExporter commented 8 years ago
I know and already use the ResourceProxy in other cases, but the mPersonHotspot 
is final and calculate position of icon's feet. In case I want the 
mPersonHotspot to be at icon's center?

Original comment by devemu...@gmail.com on 4 Jan 2013 at 2:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
You can still change the mPersonHotspot. Just use its .set() methods to change 
the values.

Original comment by kurtzm...@gmail.com on 7 Jan 2013 at 6:55

GoogleCodeExporter commented 8 years ago
To what .set method are you referring to? I don't see any .set method for 
mPersonHotspot at MyLocationNewOverlay class.

Original comment by devemu...@gmail.com on 8 Jan 2013 at 9:12

GoogleCodeExporter commented 8 years ago
Sorry, I assumed you were extending the existing overlay class in which case 
you would have access to the mPersonHotspot. I added a setPersonHotspot() 
method to change the person hotspot.

Original comment by kurtzm...@gmail.com on 8 Jan 2013 at 5:44

GoogleCodeExporter commented 8 years ago
I just wanted to add the compass in place of mPerson and compass should move if 
you are standing still at some place and redirecting the device, could it be 
possible?

Original comment by min2bhan...@gmail.com on 21 May 2013 at 5:28