Skip to content

Extract maptiler's map ids #926

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

Merged
merged 3 commits into from
Jul 20, 2023
Merged

Conversation

julioromano
Copy link

Maptiler custom map ids are only useable by the account that create them. So if we hardcode them forkers won't be able to use the maps even if the bring in their own api key (because they can't access our maps with their api key).

Requires to set our map ids in local.properties for local development:

services.maptiler.lightMapId=9bc819c8-e627-474a-a348-ec144fe3d810
services.maptiler.darkMapId=dea61faf-292b-4774-9660-58fcef89a7f3

@julioromano julioromano requested a review from a team as a code owner July 19, 2023 15:41
@julioromano julioromano self-assigned this Jul 19, 2023
@julioromano julioromano requested review from ganfra and csmith and removed request for a team and ganfra July 19, 2023 15:41
@github-actions
Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link:

Copy link
Contributor

@csmith csmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to pass our custom styles in through CI now, too, right? I guess they don't need to be secrets, but they'll still need to be set in ENV vars in the workflows

name = "maptiler_dark_map_id",
value = System.getenv("ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID")
?: readLocalProperty("services.maptiler.darkMapId")
?: "basic-v2" // fall back to maptiler's default map.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basic-v2-dark?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH indeed it works but it was not shown in maptiler's dashboard. How did you figure it out?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit buried: https://www.maptiler.com/maps/dark/ has a "Use Basic Dark" link and the style ID is in the URL. (I think I'd seen it before, otherwise I wouldn't have known to gone hunting there!)

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (f7e7339) 56.61% compared to head (0fa3faf) 56.61%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #926   +/-   ##
========================================
  Coverage    56.61%   56.61%           
========================================
  Files          968      968           
  Lines        24583    24583           
  Branches      4987     4987           
========================================
  Hits         13917    13917           
  Misses        8457     8457           
  Partials      2209     2209           
Impacted Files Coverage Δ
.../android/features/location/api/internal/MapUrls.kt 85.71% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@csmith csmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just needs env vars adding for the CI builds

Marco Romano added 2 commits July 20, 2023 13:19
Maptiler custom map ids are only useable by the account that create them. So if we hardcode them forkers won't be able to use the maps even if the bring in their own api key (because they can't access our maps with their api key).

Requires to set our map ids in `local.properties` for local development:
```
services.maptiler.lightMapId=9bc819c8-e627-474a-a348-ec144fe3d810
services.maptiler.darkMapId=dea61faf-292b-4774-9660-58fcef89a7f3
```
@julioromano julioromano force-pushed the julioromano/extractMapTilerUrl branch from 181c917 to 0ad33ca Compare July 20, 2023 11:21
@julioromano
Copy link
Author

We'll need to pass our custom styles in through CI now, too, right? I guess they don't need to be secrets, but they'll still need to be set in ENV vars in the workflows

Done!

@julioromano julioromano force-pushed the julioromano/extractMapTilerUrl branch from 0ad33ca to 0fa3faf Compare July 20, 2023 11:34
@julioromano julioromano mentioned this pull request Jul 20, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -27,6 +27,10 @@ jobs:
- name: Configure gradle
uses: gradle/[email protected]
- name: Create app bundle
env:
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, did I miss one? Nice catch!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's been added very recently

@julioromano julioromano merged commit e8e4542 into develop Jul 20, 2023
@julioromano julioromano deleted the julioromano/extractMapTilerUrl branch July 20, 2023 12:29
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.

2 participants