Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - TrulloF

#16
Quote from: voldapet on May 08, 2023, 21:30:09@TrulloF
We published the python script that can help with the conversion theme from "Custom Locus V3" style to official Mapsforge V4
https://github.com/asamm/lomaps-mapsforge/tree/main/theme-v3-to-v4-converter
The conversion is not 1:1 but it can help to remove not supported attributes or convert DP units to "pixels" in V4
Needed to install some additional modules (e.g. lxml), but then conversion worked without a problem. There are several typos in the readme, but it wasn't to hard to figure them out  ;).
#17
Quote from: voldapet on May 08, 2023, 21:30:09@TrulloF
We published the python script that can help with the conversion theme from "Custom Locus V3" style to official Mapsforge V4
https://github.com/asamm/lomaps-mapsforge/tree/main/theme-v3-to-v4-converter
The conversion is not 1:1 but it can help to remove not supported attributes or convert DP units to "pixels" in V4
Did most of it by hand in the meantime  :), but thanks for sharing.
#18
Quote from: Andrew Heard on May 09, 2023, 18:04:46
Quote from: TrulloF on May 09, 2023, 08:22:55I get lots of crashes in connection with point/track menu
very similar to me ;-(

PS. quick test - appears fixed in 4.16.0.3
Yes, seems to be fixed now. Great!
#19
I get lots of crashes in connection with point/track menu. If I chose a point and try to start navigation/guiding then it crashes. If I choose the same point from the map, it works. I get also crashes if I push the center on point button in point screen. Pretty unusable for me in this state...
#20
Quote from: voldapet on May 02, 2023, 21:23:37Well, I could provide the whole python script that was used for conversion from V3 to V4... if you are familiar with python.
That would be great! Thank you in advance for sharing.
#21
Quote from: voldapet on May 02, 2023, 08:38:03It seems I used several formulas based on the type of attribute. Is it possible for you to understand the following python code? (if not I can translate to the "human language" :)
I think I adjusted some values manually afterward anyway.

Code (python) Select
def process_dp_unit(soup):
    """"
    Remove the 'dp' units and re-compute the offset to pixels
    :param soup:
    """
    # simple remove dp for following without any computation
    attr_to_remove_dp = ['stroke-width', 'repeat-gap', 'r']
    for attr in attr_to_remove_dp:
        for tag in soup.select('[{}]'.format(attr)):
            value = tag[attr].replace('dp', '')
            tag[attr] = value

    # remove dp and round to int because symbol-with
    for tag in soup.select('[symbol-width]'):
        value_float = float(tag['symbol-width'].replace('dp', ''))
        tag['symbol-width'] = round(value_float * 1.5)
        #tag['symbol-width'] = 20

    # remove dp and resize dp at path-text
    for tag in soup.select('[font-size]'):
        value_float = float(tag['font-size'].replace('dp', ''))
        tag['font-size'] = round(1.4 * value_float)


def process_dy(soup):
    """"
    Remove the 'dp' units and re-compute the offset to pixels for dy attribute
    :param soup:
    """
    for tag in soup.select('[dy]'):
        value = tag['dy']
        if tag.name == 'line' or tag.name == 'pathText' or tag.name == 'lineSymbol':
            if 'dp' in value:
                value = float(value.replace('dp', ''))
                value = value / 4.3  #
                tag['dy'] = round(value, 1)

        if tag.name == 'caption':
            tag['dy'] = value.replace('dp', '')

        if tag.name == 'symbol':
            del tag['dy']
            tag['position'] = "above"

I'll have a look at it. Thanks. Seems to be a lot of effort anyway  :)
#22
Is there a formula to "translate" dp values to new numerics?
#23
Quote from: voldapet on May 01, 2023, 19:19:26@TrulloF
as mentioned above LoMaps V4 uses official Mapsforge renderer and it's needed to remove all tags that are not supported by Mapsforge.

I downloaded your theme and fixed some small issues like 'priority' in rule tag, 'repeat' can not be used for symbol, 'color' for symbol and 'country' attribute used for subways. I commented the subways section so please replace it with the symbol you want to use for subways
(the "fixed" theme in the attachment)
Thank you so much! It works and now I just need to adjust some stuff. You are my hero! Thank you for your efforts.
#24
Quote from: Menion on May 01, 2023, 08:33:27You may also share a theme-in-progress with me, I'll check if the app throws any errors in the background if you want.
Here you can find the theme. Adlerauge_v4.xml is the theme in question. Thank you in advance. https://1drv.ms/u/s!Av_dQw47TbThg7Z4aMWVjiWQkJdOIw?e=bkwbt3
#25
Quote from: john_percy on May 01, 2023, 00:54:05My usual mistake that results in a white map is losing a " mark in editing. Values have to be enclosed in a pair of quote marks with no forgiveness available! But I doubt that this is the problem in your case as your theme works as a v3 theme.
Thank you for your input. I'll double check that too, but usually xml validation finds these typos. I'm quite puzzled...
#26
Is a style menu mandatory (cat and stuff)? I don't use these in my theme.
#27
Quote from: john_percy on April 30, 2023, 18:34:57You didn't mention removing all mention of "dp"...

Sent from my moto g(6) plus using Tapatalk


Removed all dp instances, but still no luck... Anything else to try?
The locus theme checker doesn't throw any error.
#28
Quote from: john_percy on April 30, 2023, 18:34:57You didn't mention removing all mention of "dp"...

Sent from my moto g(6) plus using Tapatalk


Ok, thank you for the hint. That might be it.
#29
Quote from: john_percy on April 30, 2023, 09:23:07
Quote from: TrulloF on April 29, 2023, 22:26:05If I use the version edited for v4 in v3 maps it works as intended.
That shouldn't happen. The rendertheme preamble should mean that your v4 theme doesn't show up in the list of themes for v3 maps and vice versa.
Sorry for the misleading description. I changed the version in the header to let it show up for v3 maps, just to check if the theme is broken. It's not, at least for v3. In v4 it shows just a white screen and standard poi icons.
#30
Quote from: john_percy on April 29, 2023, 22:04:56Have you also changed the rendertheme tag near the start of the theme?
Something like
<rendertheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://mapsforge.org/renderTheme" xsi:schemaLocation="http://mapsforge.org/renderTheme https://raw.githubusercontent.com/mapsforge/mapsforge/master/resources/renderTheme.xsd" version="5" map-background="#F8F8F8" map-background-outside="#EEEEEE">
(This doesn't work in Tapatalk - use Webview.)

Copied that directly from the internal v4 Locus theme. Is there a how-to or faq available anywhere? If I use the version edited for v4 in v3 maps it works as intended.