Location Permissions for web browser and for web apps like Squadrats

Comments

13 comments

  • Avatar
    Gerard van Rijn

    The GPS becomes active when there is movement.

    0
    Comment actions Permalink
  • Avatar
    Marcus Mason

    I too love Squadrats. In the meantime, until available on the browser, this App works a treat. It even has a toggle for on/off grids and captured tile colours. Hope this helps:

    https://support.hammerhead.io/hc/en-us/community/posts/33781427970971-Wanted-Statshunters-for-Hammerhead

    1
    Comment actions Permalink
  • Avatar
    Gregory Gregory

    Thanks @Gerard, but.. that doesn't matter anymore. I forgot that Karoo 3 is not Karoo 2 and it does not have a SIM card to be online and download squadrats data via a browser durning ride :)

    @Marcus, this extension cannot work with no internet. So, the only possibility is an extension that can download and save in the Karoo's memory information about squares from the squadrats (or statshunters) account, and then overlay it on the live map while driving. I have to try Timklge extension. Maybe it works as I think, however squadrats is better, lighter and have more possibilities than statshunters.

     

    0
    Comment actions Permalink
  • Avatar
    Gerard van Rijn

    @Gregory Gregory Consider using a hotspot.

    0
    Comment actions Permalink
  • Avatar
    Gregory Gregory

    @Gerard i think it is a not good idea for my phone batterry and long rides :) I did not use hotspot even when I had Karoo 2 (I used sim card). Extension with offline squadrats data will be better.

    1
    Comment actions Permalink
  • Avatar
    Leo Schweizer

    @Gregory Gregory there is an extension now that does this - I built it because I wanted this myself: https://github.com/leoschweizer/karoo-squadrats

    It's not extensively tested yet so I'm happy about any feedback :)

    2
    Comment actions Permalink
  • Avatar
    Gregory Gregory

    Thanks @Leo! I will test it!

    0
    Comment actions Permalink
  • Avatar
    Gregory Gregory

    Hi Leo,

    I tried to gathering my token but i don't saw address like in the manual:

    "Click on any of the .pbf requests and look at its URL. Note down the token and timestamp:"

    https://tiles2.squadrats.com/abcDEF123xyz/trophies/1754233411401/12/2081/1367.pbf
                                 ^^^^^^^^^^^^          ^^^^^^^^^^^^^
                                    TOKEN                TIMESTAMP
    

    All what I see is come from 'planet.squadrats.com' and 'tiles-beta.squadrats.com'. None of them contain anything like the above token in the manual :(

    eg.

    https://planet.squadrats.com/planet/regions/x/y/z/w.pbf

    or 

    https://tiles-beta.squadrats.com/xxx-28characters-xxx/trophies-earth/xxx-13char-xxx/x/y/z.pbf

    I changed the chars to xxx, x, y, z, w.

    So, I tried to use this second one address and 28 characters as token and 13 characters as a timestamp. Test result - credentials are valid! :)

    I updated cache of course but I don't see squadratinhos on the map. Zoom in/out with no result. I changed switch 'Show squadratinhons' from left to right and no result, no squadratinhos visible :( I am not sure this switch, because on the left pos is it grey, on the right pos purple-gray, which pos is ON? Some time something showed for a split second but I don't know is squadratinhos or not.

    Edit:

    Works! Sometimes all Squadratinhos disappeare but works! After today ride, I wanted to update cache but server error 500, probably timestamp not valid.

    0
    Comment actions Permalink
  • Avatar
    Leo Schweizer

    @Gregory glad you managed to get it working! Yes the tile URL changed with the launch of the new Squadrats Pro Beta, I will update my readme on occasion to also include it.

    Regarding Squadratinhos not showing there are two things to keep in mind:

    1) Due to limitations of the Karoo extension mechanism, I can only draw Squadrats based on the current GPS location and map zoom level, but the visible map section is not exposed to extension developers. So I draw around the current location with some scroll buffer, but if you scroll away from your current location manually, nothing will have been drawn for those areas.

    2) Squadrationhos are only shown for higher zoom levels, and currently this is not aligned with the three standard zoom levels on the Karoo 2 (I don't know if those are the same on Karoo 3). I should probably change this. So if you only change zoom level by hardware button presses, you wouldn't see Squadratinhos on the lowest zoom level.

    If you have disappearances of Squadratinhos not explained by those limitations it would be good to know.

    Regarding the timestamp expiry, I don't know this for sure yet, but my suspicion is that the timestamp becomes invalid every time you collect new Squadrats or Squadratinhos.

    0
    Comment actions Permalink
  • Avatar
    Marcus Mason

    I have no idea where to get the User Token on Squadrat. Please assist. Danke.

    0
    Comment actions Permalink
  • Avatar
    Gregory Gregory

    Hi @Marcus,

    as in description but after last squadrats release, the address is different (step 6 below).

    1. Open squadrats.com in the browser on PC. I use FireFox.
    2. Login and open the map.
    3. Press F12 (programmers console).
    4. Open tab 'network'.
    5. Reload the page.
    6. Find a request 'tiles-beta.squadrats.com' and click it.
    7. In the right panel choose 'headers'.
    8. You will see something like this 'https://tiles-beta.squadrats.com/xxxxxxxxxxxxxxx/trophies-earth/tttttttttttttttttttt/8/143/83.pbf'
    9. xxxxxxxxxxxxxxxx - is your token. ttttttttttttttttttttttt - timestamp.
    10. Copy it to the extension settings - rewrite rather :)
    11. If you rewrote it correctly, the connection test will give the result 'credentials ok' and you will be able to load the tiles on the cache tab.

    As I see the token should be constant in the future. Only timestamp is different everytime.

    0
    Comment actions Permalink
  • Avatar
    Gregory Gregory

    @Leo I don't know, but today, over 6 hours ago (before the previous post), I updated the cache and I've been logged in the entire time (on PC web browser). Now I ran a connection test in the extension and it says 'credentials ok'. After it, I logged out from squadrats and the test still ok. Probably squadrats server remember this.

    I believe the next step you will take will be to directly log in to your squadrats account directly in the extension :)
    Fingers crossed!

    0
    Comment actions Permalink
  • Avatar
    Leo Schweizer

    @Gregory direct login is unlikely to happen (at least as long as I support Karoo 2) because the Squadrats login page doesn't work on the WebView that ships with Karoo 2. The good news is that I found a way to eliminate the need for the user-provided timestamp alltogether, so you should now be done after a one-time setup.

    I've created a new thread now for the extension, let's continue the discussion there: https://support.hammerhead.io/hc/en-us/community/posts/49516816785179-Squadrats-Map-Overlay

    0
    Comment actions Permalink

Please sign in to leave a comment.