Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an API to modify the rendering style at runtime #31

Closed
mapsforge opened this issue Nov 6, 2014 · 11 comments
Closed

Add an API to modify the rendering style at runtime #31

mapsforge opened this issue Nov 6, 2014 · 11 comments

Comments

@mapsforge
Copy link
Owner

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on July 30, 2010 09:04:45

Currently much of the rendering style is hard-coded and cannot be changed at runtime. But one of the strongest advantages of ad-hoc rendering is possibility to fully customize the rendering style (font sizes, colors, z-ordering, replace default POI symbols, hide certain elements, ...).

We therefore need to implement a mechanism like for example MapCSS ( http://wiki.openstreetmap.org/wiki/MapCSS ) and add an API to our map rendering component to control the rendering.

Original issue: http://code.google.com/p/mapsforge/issues/detail?id=31

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on December 24, 2010 16:56:52

Status: Started
Cc: dennie.kabul

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on January 28, 2011 00:20:12

Issue 64 has been merged into this issue.

Cc: muehlb...@inf.fu-berlin.de

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on January 28, 2011 00:21:09

Owner: dennie.kabul
Cc: -dennie.kabul

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From jjbross@gmail.com on June 16, 2011 13:22:54

Owner: thilo.mu...@gmail.com
Cc: -thilo.mu...@gmail.com

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on August 07, 2011 11:32:22

I have worked out a nice solution for this issue which works similar to the Osmarender styles (see http://wiki.openstreetmap.org/wiki/Osmarender/Rules ). I will commit everything in a few days, stay tuned ... :-)

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on August 28, 2011 10:23:16

I have committed my current working copy in revision r1383 . There are still some known bugs (like for example missing water areas) and the performance needs to be polished. But besides that it works already quite well. Rendering is now completely configurable via XML files, which are very similar to osmarender stylesheets (see: http://wiki.openstreetmap.org/wiki/Osmarender/Rules ).

All "early adopters" are invited to check out the new version and test it, so that we can locate and fix as many bugs as possible prior to the next release (which will most likely be called 0.3.0). A detailed wiki article describing the structure of the render theme XML files and the new MapView API will be published later.

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From LudwigBr...@gmail.com on September 13, 2011 03:11:29

I have had a play with r1405 and I have a suggestion that I believe will improve the usability of the XML configuration.

From my use case most changes in rendering style are small, they involve highlighting certain features or turning others off. In most cases therefore the XML for rendering is 95% identical, but there are large numbers of these small XML changes. This makes maintaining the XML files somewhat difficult and unwieldy.

My suggestion would be to have named rules that can be selectively turned on or off via an API.

For example, one change in the XML could be to turn off the rendering of buildings (a kind of nice feature that shows off OSM and the renderer, but somewhat useless actually for navigation and costly in processing). So a rule with names would look like this:

    <!-- building -->
    <rule name="building" enabled="yes" e="way" k="building" v="*">
        <area fill="#f3d6b6" stroke="#6a5a8e" stroke-width="0.2" />

        <rule e="way" k="*" v="*" zoom-min="17">
            <caption k="name" font-style="bold" font-size="10" fill="#4040ff" stroke="#ffffff" stroke-width="2.0" />
        </rule>
    </rule>

The additional API would allow to switch the rule on and off, based on its name, overriding the default in the XML.

The implementation could either involve a further check whether a rule is enabled (costly at runtime) or otherwise an active rule set could be compiled from the set of all rules when a change in configuration takes place.

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on September 17, 2011 03:07:32

I really like your idea as it would make it much easier to create "derived" render themes. However, it increases the complexity of parsing and optimizing render themes a lot, therefore i will not implement it right now but rather focus on stability and performance for the first release.

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on September 17, 2011 05:34:23

Issue 108 has been merged into this issue.

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From wms...@googlemail.com on September 22, 2011 23:51:52

Hi all,

the mapsforge is a very nice project! Can you look to "OSM MAP Composer". This is a Franwork to configure the tools for generate Garmin IMG files. Do you know "MAP Composer"? http://composer.waldpfa.de/index.php/MC/Composer It would be nice if you could marryd "mapsforge" with "OSM Composer"

@mapsforge

This comment has been minimized.

Copy link
Owner Author

@mapsforge mapsforge commented Nov 6, 2014

From thilo.mu...@gmail.com on January 15, 2012 07:02:01

Support for Garmin IMG files is a completely separate topic and not part of this issue. Please feel free to open a new issue and include the details about your feature request.

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.