zeta243 / osmdroid

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

Make MapView "all arguments" constructor public or protected #328

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Place a MapView in an XML resource. The MapView will be constructed using 
the standard XML two argument constructor which in turn calls the full 
constructor with defaults filled in. There's no way to override these defaults 
in a subclass because that constructor is private.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by stevenkr...@gmail.com on 3 Apr 2012 at 2:58

GoogleCodeExporter commented 9 years ago
If you use the Mapview in a resource then it's always going to use the two 
argument constructor.

If you want options then you want them made available via the attributes.

What attributes do you want added?

Original comment by neilboyd on 4 Apr 2012 at 5:22

GoogleCodeExporter commented 9 years ago
Hi thanks for the feedback. I'd like to subclass MapView and be able to call 

private MapView(final Context context, final int tileSizePixels,
                        final ResourceProxy resourceProxy, MapTileProviderBase tileProvider,
                        final Handler tileRequestCompleteHandler, final AttributeSet attrs) ;

from my subclass's constructor. The reason is that the subclass can then use my 
custom tileprovider/resourceproxy while getting instantiated from a layout XML. 
I don't see any other way to achieve that currently.

Original comment by stevenkr...@gmail.com on 4 Apr 2012 at 7:51

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1085.

Original comment by neilboyd on 5 Apr 2012 at 4:35