Hello!
That is my first try to develope a viewer to show the tiles of openstreetmaps. I hope that there are others, who can support this project.
I have tested it on my HTC HD2 with WVGA (480x800) and 1Ghz-chip. It runs fast enough, but I don't know, how it works on slower devices or different screensolutions.
In the first version, the map viewer has the following features:
- works with offline maptiles, which I have dowloaded with the PDATilemanager of corwin42, written in basic4ppc: AmberHome
- shows the map over the whole screen
- works in vertical and horizontal mode
- let scroll the map with the finger
- scrolls the map with navigation-buttons
- supports different zoomlevels
- set the map to the startposition
The next steps, I want to develope are:
- load maptiles from the tileserver, if they are not on the device
- shows an centered icon on a gps-position (latitude and longitude)
I think, that the code could be optimized, but i'm still working. The only problem, which I have yet is, that the application will be stopped from the android-os, if it is activated again or the device will be rotate. Perhaps, someone can find the mistake.....
To test the app, you have to download the maptiles which you want to have and save them in the root of the external-sdcard under "/osm/..". In Sub Init, you can set the zoomlevel and the starttiles:
I will now try to load the mapiles from a tile-server. If there is someone who had an example to load a map tile from
it's easier for me, because i haven't worked with the http-lib until yet.
rgds
That is my first try to develope a viewer to show the tiles of openstreetmaps. I hope that there are others, who can support this project.
I have tested it on my HTC HD2 with WVGA (480x800) and 1Ghz-chip. It runs fast enough, but I don't know, how it works on slower devices or different screensolutions.
In the first version, the map viewer has the following features:
- works with offline maptiles, which I have dowloaded with the PDATilemanager of corwin42, written in basic4ppc: AmberHome
- shows the map over the whole screen
- works in vertical and horizontal mode
- let scroll the map with the finger
- scrolls the map with navigation-buttons
- supports different zoomlevels
- set the map to the startposition
The next steps, I want to develope are:
- load maptiles from the tileserver, if they are not on the device
- shows an centered icon on a gps-position (latitude and longitude)
I think, that the code could be optimized, but i'm still working. The only problem, which I have yet is, that the application will be stopped from the android-os, if it is activated again or the device will be rotate. Perhaps, someone can find the mistake.....
To test the app, you have to download the maptiles which you want to have and save them in the root of the external-sdcard under "/osm/..". In Sub Init, you can set the zoomlevel and the starttiles:
B4X:
Sub Init
Zoomlevel=15
Label2.Text=Zoomlevel
'StartTiles are the left and top-side of the moving map'
StartTileX=16929
StartTileY=10969
...
...
I will now try to load the mapiles from a tile-server. If there is someone who had an example to load a map tile from
B4X:
'URLs (Examples)
'OSM Mapnik http://tile.openstreetmap.org/12/2047/1362.png
'OSM Osmarender/Tiles@Home http://tah.openstreetmap.org/Tiles/tile/12/2047/1362.png
'OSM Cycle Map http://andy.sandbox.cloudmade.com/tiles/cycle/12/2047/1362.png
it's easier for me, because i haven't worked with the http-lib until yet.
rgds