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

Resize text on the map #1877

Merged
merged 8 commits into from
Jun 5, 2020
Merged

Conversation

matkoniecz
Copy link
Member

@matkoniecz matkoniecz commented Jun 1, 2020

This PR makes two things - text now gets larger as one zooms in, it is now also respecting device text size settings.

Both are inspired by #1872

I admit that text now gets much larger on high zoom and I would not be surprised if it something disliked by @westnordost - in such case I may either retweaked to be subtler or entire "zoom in increases text" may be dropped (this mechanic is not a very noticeable but it actually appears in MAPS.ME, Google Maps, mapy.cz etc, so it is not something really weird).


Sadly, I found no way to just pass scaling factor into map style (as say global.text_size_scaling) and do everything else there.

I tried things like that in map style itself and all of them failed - maybe I am missing something but it seems that it needs to be done outside map style file.

    text_size: [[15, global.text_size_scaling], [16, global.text_size_scaling * 2]]
    text_size: function() { return [[15, '12px'], [16, '50px']];}
    text_size: [[15, 12 * global.text_size_scaling], [16, 13 * global.text_size_scaling], [17, 15 * global.text_size_scaling], [18, 17 * global.text_size_scaling], [19, 24 * global.text_size_scaling]]

In case of this passing I will open PR against map style repo to add note about text_size and language getting overwritten by SC.


My work on review that resulted in this pull request was sponsored by a NGI Zero Discovery grant

matkoniecz referenced this pull request in streetcomplete/streetcomplete-mapstyle Jun 1, 2020
@westnordost
Copy link
Member

westnordost commented Jun 2, 2020 via email

@matkoniecz matkoniecz marked this pull request as draft June 2, 2020 12:12
@matkoniecz
Copy link
Member Author

matkoniecz commented Jun 2, 2020

ENT8R streetcomplete/streetcomplete-mapstyle@5dcfd32#commitcomment-39604906 found a better solution - so it will be likely done by improving mapstyle (support for text scaling and scaling text) and once new version of mapstyle is merged then text scaling parameter will become available.

EDIT: the solution proposed by ENT8R seems to not work, but maybe I tested it in a wrong way

@westnordost
Copy link
Member

OK, waiting for @ENT8R to push to streetcomplete-mapstyle

@westnordost westnordost marked this pull request as ready for review June 2, 2020 18:35
@westnordost
Copy link
Member

So, only update of the map style is missing, right?

@matkoniecz
Copy link
Member Author

Yes, once map style is pulled in it should work (I can retest it again once that happens to avoid things like // as yaml comments).

@westnordost
Copy link
Member

westnordost commented Jun 4, 2020

Ok merged it to master (the theme update)

@matkoniecz
Copy link
Member Author

Retested, works, as far as I can see it can be merged.

@westnordost westnordost merged commit 2e7b6f9 into streetcomplete:master Jun 5, 2020
@westnordost
Copy link
Member

Good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants