Rewrite: Getting map file info

59 views
Skip to first unread message

emux

unread,
Apr 24, 2013, 3:12:34 AM4/24/13
to mapsfo...@googlegroups.com
Hi Thilo,

At issue 424 you wrote that classes MapDatabase and MapFileInfo haven't changed at all at rewrite branch.

Now from what class can we get MapDatabase instance in order to call its public getMapFileInfo method?
At main branch we get it with mapView.getMapDatabase(), now it is created in TileRendererLayer and passed at DatabaseRenderer, being private.

Or from where can we get DatabaseRenderer class ? Again at main branch we get it with mapView.getDatabaseRenderer(), now it is private at TileRendererLayer.

The purpose of my questions is to read map file information, like start point / start zoom level / bounding box etc.
I think that now we can achieve this if we make ourselves a MapDatabase instance independently and open a map file in order to read its info, prior setting it to a map view.

Thanks.

Thilo Mühlberg

unread,
Apr 28, 2013, 7:23:35 AM4/28/13
to mapsfo...@googlegroups.com
The API of the whole rewrite branch - and that includes of course the
TileRendererLayer - is not yet final. Your ideas how it can be improved
are very welcome. The new layer based architecture makes it impossible
to keep the old API from the 0.3.0 version. Remember that you could
theoretically have multiple TileRendererLayers and each of them could
use a different map file, render them etc. Therefore having a
mapView.getDatabaseRenderer() method doesn't make sense any more.

Meanwhile you can always use the unchanged API of the map reader like
"MapDatabase().openFile(File).getMapFileInfo()" to retrieve the header
information for an arbitrary map file, as you already mentioned.

Greetings,
Thilo
> --
> You received this message because you are subscribed to the Google
> Groups "mapsforge-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mapsforge-de...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>


signature.asc
Reply all
Reply to author
Forward
0 new messages