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 navigation app link in status card #1273

Merged
merged 3 commits into from
Sep 23, 2024
Merged

Add navigation app link in status card #1273

merged 3 commits into from
Sep 23, 2024

Conversation

dough29
Copy link
Contributor

@dough29 dough29 commented Sep 23, 2024

Hello,

I often need to reach the position of my trackers but I prefer to use Waze.

Before, I had to open the link for Google Maps, copy latlon coordinates, open Waze manually and paste the coordinates.

With this query we add a "Waze" entry to the status card menu:

image

This will trigger the Waze app to open on the smartphone.

I have successfully tested this locally with an Android phone.

@tananaev
Copy link
Member

I don't think it makes sense to hardcode something like this. Waze is not ubiquitous enough. Maybe a better option is a customizable menu option there where you can provide a custom URL with location placeholder.

btw you should only add English string.

@dough29
Copy link
Contributor Author

dough29 commented Sep 23, 2024

Thanks for your quick review.

Ok, I can spend a little more time making it customizable 👍

@dough29
Copy link
Contributor Author

dough29 commented Sep 23, 2024

Could you give me an idea how I could interpret a specific format in the attribute string so that I can replace it with latitude and longitude values ​​🤔

I should create custom user and server attributes like:

  • state.session.server.attributes.navigationAppLink
  • state.session.server.attributes.navigationAppTitle
  • state.session.user.navigationAppLink
  • state.session.user.navigationAppTitle

navigationAppLink should have a value like "https://www.waze.com/ul?ll=${position.latitude}%2C${position.longitude}" but I don't know how to handle the position.latitude and position.longitude in the string so that they are replaced with their value.

@tananaev
Copy link
Member

Two attributes is probably enough. I recommend just navigationAppLink and navigationAppTitle.

The link can include placeholders. For example https://example.com?lat={latitude}&lon={longitude}. And then you just replace those placeholders when you format the URL.

@dough29
Copy link
Contributor Author

dough29 commented Sep 23, 2024

Ok, navigationAppLink and navigationAppTitle should be in server attributes or only for user attributes?

@tananaev
Copy link
Member

They should be in useCommonUserAttributes.js. That way they will apply to both server and user.

@dough29 dough29 changed the title Add Waze in status card Add navigation app link in status card Sep 23, 2024
@tananaev tananaev merged commit 87b7407 into traccar:master Sep 23, 2024
1 check passed
@tananaev
Copy link
Member

Merged, 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.

2 participants