Pi and More

09.05.10

Using different map types in AGTL on Maemo

AGTL, the Advanced Geocaching Tool on Maemo, has the ability to provide the user with map views of different sources. Since Version 0.5.1 you can add new map types. And this is how:
  1. First, make sure you can edit the file /home/user/.agtl/config on your phone. You can do this either by using ssh/scp or directly on the phone, using xterm and vim or some other text editor.
  2. Next, get some tile URLs. As this is an inofficial way to access the google tile servers, it is not documented. However, you can find a lot of map tile URLs in the Maep source code. Looking at line 2510 of the code, just below case OSM_GPS_MAP_SOURCE_GOOGLE_SATELLITE: you can see the URL. Now take this (or any other) URL, replace #R with 1, and #X, #Y and #Z with %(x), %(y) and %(zoom). We also need a file prefix, which is used to identify the stored map tiles on the phone. These can be found in the same file, line 2435 and following.
  3. Open the AGTL config file and look at the list of map providers. Each map provider consists of a block formatted like this:
    [
        "OpenCycleMaps", 
        {
            "prefix": "OpenCycleMap", 
            "remote_url": "http://andy.sandbox.cloudmade.com/tiles/cycle/%(zoom)d/%(x)d/%(y)d.png"
        }
    ]
    and these blocks are comma separated.
  4. Add a new block to the list, for example by copying this template (or use any of the existing ones):
    [
        "NAME", 
        {
            "prefix": "PREFIX", 
            "remote_url": "URL"
        }
    ]
    Add the missing values (NAME, PREFIX and URL). You can use any NAME you like, but go for a short one if you're using more than three map sources.
  5. Double check your braces. Double check that each block is separted from the preceding and following block by a comma (spaces and tabs don't matter at all).
  6. Now start AGTL and check if the map tiles load.
  7. If AGTL doesn't start anymore, you probably messed up the file. Check it again. If you want to give up, just delete the file. AGTL will create a fresh one on the next start. Remember to fill in your geocaching.com user data again.
  8. If the map tiles don't load, check the URL again.
Kommentare (neuste zuerst)
  • asd schreibt am 10.05.11 um 16:42 Uhr: Both spaced and adjacent forms wont work [ "GoogleMaps", { "prefix": "GoogleMaps", "remote_url": "http://mt1.google.com/vt/v=w2.97&x=%(x)&y=%(y)&z=%(zoom)" } ], [ "Google Satellite", { "prefix": "Google Satellite", "remote_url": "http://khm1.google.com/kh/v=51&x=%(x)&y=%(y)&z=%(zoom)" } ]
  • asd schreibt am 10.05.11 um 16:01 Uhr: Source code you mention is not accessible Why dont you just send the proper way to view google maps .. if you are concerned mail me private and i'll post it on my blog, than people could finally find what they are looking for after reading a post
Kommentar schreiben
  • Bugs in AGTL bitte hier melden.
    Please report any bugs in AGTL here.
  • Wer eine Antwort erwartet, sollte eine echte E-Mail-Adresse angeben.
    If you expect a reply from me, please provide a working e-mail address.
  • Ich kann keine individuelle Problemlösung zu Websicherheit oder regulären Ausdrücken geben!
Name:
Website: http:// optional
E-Mail: wird nicht veröffentlich
Spam-Check: 10 weniger 5 ergibt