-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Story] Customise maps provider #1722
Comments
@Johennes @julioromano should we do anything in this epic for this? |
@alfogrillo what you say sounds like customizing the map provider by changing the app source code? I think ideally, there'd be a way to control the map provider via the home server's |
Yep, we are quite ready for that.
I'm not sure how we can make this generic across all the map providers. Maybe we may change the MSC3488 to introduce map provider specific information? Example (.well-known) {
"m.tile_server": {
"map_tiler": {
"map_light_style_url": "https://www.example.com/style_light.json",
"map_dark_style_url": "https://www.example.com/style_dark.json",
"static_map_light_style_url": "https://www.example.com/static/style_light.json",
"static_map_dark_style_url": "https://www.example.com/staic/style_dark.json"
},
"google_maps": {
"some_url": "https://www.example.com/style.json"
}
},
"m.homeserver": {
"base_url": "https://matrix-client.matrix.org"
},
"m.identity_server": {
"base_url": "https://vector.im"
}
} |
Yes, we'd likely need to change this in the MSC, too. It currently only includes the tile server configuration via
Your idea of having different objects for different map providers in I think a general problem there is that e.g. MapTiler and Mapbox use different formats for the static maps endpoints. MapTiler uses
while Mapbox uses
So I think in addition to the URL to request we'd also need to know where to insert the various parameters. One slightly wild idea @julioromano and I had discussed a while ago was to add a URL template for the static maps endpoint in
whereas to use your Mapbox account, you could specify something like
The app could then replace all the various parameters (e.g. This isn't quite perfect though. It may not work for other static map providers and it definitely won't work when we add the geocoding API later because those return JSON that needs to be parsed differently for each provider. So that would probably only be a stopgap solution at best. The MSC also doesn't currently support different tile server URLs for light and dark mode which is a similar problem and might require changes to the existing |
I've updated the description above with what we aligned on in the weekly today. |
Open question: what do we do when there's no API key set? If we don't do anything, the existing error state allows you to retry the map load, but that will never work. Do we want to add a custom state for when the API key is missing? A placeholder image with text along the lines of "Viewing locations is not configured in this version"? |
Good find. Making the error explicit sounds like a good idea to me. It'll prevent us getting vague error reports about this from forkers later. |
As for the wording, I think we can probably keep it tech-y because it should not be a common error users see. @callumu do you have opinions? |
Could you clarify when the error would show and what it exactly says? I'm mainly confused about when it will show |
AFAIK the app requires a key to be set or it wont' build. So at runtime there will always be one. |
@callumu it would never show in the apps we release, just if someone makes a version themselves and doesn't add their own mapbox key. So, say, an open source contributor testing/using their changes, or someone creating their own branded version of EX. If we're going with technical wording it'd be something like "Mapbox API key must be configured when building the app".
If that's the case I think we should change it as part of this ticket. It puts a massive barrier in the way of anyone trying to make an open source contribution 😱 |
Disabling or changing the feature when there's no API key adds unnecessary effort to our tasks and adds more points of failure, so perhaps it makes sense to still use our current api key as default and don't worry about our maptiler until we have reason to. cc: @Johennes |
I agree. We ideally shouldn't require people to set up a map provider just to contribute to the app. At the same time, building in special UI to cover for a case that should never happen in production also feels wasteful. What if we disabled all map rendering entirely when no API key is set? This would mean not showing the location button in the composer menu and rendering location events in the timeline using their textual fallback. |
That's precisely what I had in mind when referring to "adds unnecessary effort to our tasks" :) |
Okay that wording sounds good then |
That actually feels more complicated 😁. We'd have to expose the "Are maps configured?" state in a bunch of places (timeline items factory, composer actions, etc). Showing a custom error on top of the existing elements is a small, self contained change. IMO it's well worth it to make the open source experience much better. (If I was trying to patch an open source app and it made me go and get an API key from a third party, I'd either just give up or hack out that API key entirely.) |
I'm starting to lean on you side Chris :) Such an approach seems sensible enough. @Johennes what d'you think? |
Agreed, if we think this is little risk and overhead, let's do the error messaging instead. 👍 |
@kittykat no clue how to test that… |
@alfogrillo ^ can you help? |
Not really a user story :) Should have been marked as a tech task. |
Hopefully Marco clarified already. |
It's been done AFAIK (at least on android) but not in the "super easy" way that was at first envisioned. |
Agreed, this doesn't need signoff from us |
What do you mean by that? On EXI map tiler urls are still hard coded. |
Static map loading is behind an interface, we provide one implementation for maptiler's static map api but 3rd party devs can create additional implementations if they want. |
That's the same on EXI. |
Same here, so the platforms are on par. |
Size estimate
M
Dependencies
Acceptance criteria
.well-known
because this doesn't cover static maps and will likely require a holistic redesign laterOther
Out of scope
Subtasks
Android
iOS
Other
The text was updated successfully, but these errors were encountered: