waar19 / osmdroid

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

Need a way to specific CloudMade style dynamically #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It is possible to specify the CloudMade style in the attributes when loading 
the view from a layout xml, but there's no other way to specify it.  

There should be a way to dynamically change the CloudMade style id.

Probably the easiest way would be to add a method
IOpenStreetMapRendererInfo.setCloudMadeStyle(int style)

BUT, the tile storage needs to be changed to keep the styles separate otherwise 
the cached tiles will not necessarily match the current style.

Probably need to change
OpenStreetMapTileFilesystemProvider.buildPath
to use a new method renderer.getBasePath() instead of getName().
For all other renderers it will just return getName(), but for 
CloudmadeRenderer it will return getName() + "/" + styleId

Original issue reported on code.google.com by neilboyd on 4 Oct 2010 at 7:45

GoogleCodeExporter commented 9 years ago
Thanks neilboyd for reporting this...
I concur with the need for setCloudMadeStyle()

I encountered the caching of mixed tile styles when I changed cloudMadeStyle in 
the XML layout and reran my app

From my single user point of view, problem could be solved if an accessible 
class instance provided a method to flush tile cache or setCloudMadeStyle() did 
it. (Not sure if this is good solution since I don't know the internals of 
osmdroid.)

Original comment by olub...@gmail.com on 4 Oct 2010 at 2:02

GoogleCodeExporter commented 9 years ago
Could you please describe how to set specific CloudMade style for 
CloudmadeRenderer via XML layout?

Original comment by vitaliy....@gmail.com on 8 Oct 2010 at 2:07

GoogleCodeExporter commented 9 years ago
See the HowToUseJar wiki. neilboyd has answered this....

Original comment by olub...@gmail.com on 8 Oct 2010 at 2:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This issue was closed by revision r452.

Original comment by neilboyd on 3 Nov 2010 at 9:53

GoogleCodeExporter commented 9 years ago
neiboyd, 

Thanks!

Do I download the latest jar file or build a new one with this revision?

Original comment by olub...@gmail.com on 3 Nov 2010 at 2:03

GoogleCodeExporter commented 9 years ago
I've uploaded a new jar with the latest code

Original comment by neilboyd on 3 Nov 2010 at 3:28

GoogleCodeExporter commented 9 years ago
This doesn't seem to work any longer..  I have

    <org.osmdroid.views.MapView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
    renderer="CloudMadeStandardTiles"
        cloudmadeStyle="94371"        
        />

But it doesn't seem to be using anything other than the default.  Any ideas?

Original comment by ls3...@nyu.edu on 30 Apr 2013 at 6:38