Creating overlays in rewrite branch

49 views
Skip to first unread message

Marcus Schmidke

unread,
Mar 21, 2013, 7:52:43 AM3/21/13
to mapsfo...@googlegroups.com
Hello Thilo,

could you mention a few words about overlay concept in rewrite branch?

As far as I can see in Rewrite.java, now every single Object, a Marker for example, is treated as an Layer on it's own.

Is this simply "work in progress", or is this a new conceptual idea?

The main branch was able to handle some thousand markers. Is, in rewrite branch, the Layer lightweight enough to handle this?

Regards,

Marcus.

Thilo Mühlberg

unread,
Mar 21, 2013, 3:31:36 PM3/21/13
to mapsfo...@googlegroups.com
You are right, overlays are a core feature in the rewrite branch. Like
everything else they are now implemented as layers so that you can
display them in any order together with the rest of your layers.
Actually there is no real difference between a layer and an overlay. By
design layers can be very lightweight objects.

You can find a small set of built-in overlay classes in the
"org.mapsforge.map.layer.overlay" package. To create a custom overlay
just extend the abstract Layer class and implement the draw() method.

The rewritten map library must not perform worse than the previous
version. As all potentially slow redrawing processes are moved to
separate threads, the GUI should always remain responsive. But if you
want to display thousands of overlay objects, you will sooner or later
need a proper spatial data structure like a quad-tree or an r-tree.

I cannot guarantee that the API will not change, everything you see is
still work in progress. But it should already be working, if you see any
bugs please report them.

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