×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    3

    Help with PyS60 Google Maps API

    Hi everybody.

    I am using pys60 to create an application for a client.

    Now, I need to show a google map in the screen. I have found the PyS60 Google Maps API documentation and code and it´s supposed that this code does everything for you.

    I thought that I only needed to copy the code and do some changes to work it but it doesn´t.

    Everything works fine except when I need to get the image.

    When I´m trying to do this: gImage = gmap.retrieveStaticImage(320, 240, 51.510605, -0.130728, 8, "png32")

    I get an error and I don´t know why because I can´t see the error´s text. Also I have tested all the programm and I am sure that line is the problem.

    There is not a lot of information about this API so I would like to know if someone could help me because I don´t know what can I do.

    My gps code is:

    elif self.current_tab==locale('tab.google'):
    appuifw2.app.body = self.google_display
    try:
    gmap = GoogleMaps('Secret')
    gAddress = gmap.geocodeAddress("Leicester Square, London")
    tMap = gmap.adjust(gAddress[0],gAddress[1],100,0,8)
    gImage = gmap.retrieveStaticImage(320, 240, tMap[1],tMap[0], 8, "png32")
    appuifw.note(u"It works")
    except:appuifw.note(u"It doesn´t")

    With that code, the program fails but if I do the same code without gImage line, it works.

    The rest of the PyS60 Google Maps API code is here: http://wiki.forum.nokia.com/index.ph...oogle_Maps_API.

    Thank you for everything and sorry for my English, I am Spanish.

  2. #2
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: Help with PyS60 Google Maps API

    maison,

    I found a problem in the code and fixed it. Please, check out the article again.

    Instead:

    Code:
    if platform[:5]=='linux':
        tmp_file = open(self.tmp_file)
    else:
        tmp_file = graphics.open(self.tmp_file)
    return tmp_file
    Use:

    Code:
    return graphics.Image.open(self.tmp_file)
    Just wondering what "Reviewer Approved" means ...

    Best regards,

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    3

    Re: Help with PyS60 Google Maps API

    Quote Originally Posted by marcelobarrosalmeida View Post
    maison,

    I found a problem in the code and fixed it. Please, check out the article again.

    Instead:

    Code:
    if platform[:5]=='linux':
        tmp_file = open(self.tmp_file)
    else:
        tmp_file = graphics.open(self.tmp_file)
    return tmp_file
    Use:

    Code:
    return graphics.Image.open(self.tmp_file)
    Just wondering what "Reviewer Approved" means ...

    Best regards,
    Thank you very much. Now I can see the map.

    If you don´t mind I have another question. I need to show in the map two points. One of them it´s my position that I think I can get from my gps data but do you know if I can show two points in the same map?

    Thanks!

  4. #4
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: Help with PyS60 Google Maps API

    Quote Originally Posted by maison1985 View Post
    Thank you very much. Now I can see the map.

    If you don´t mind I have another question. I need to show in the map two points. One of them it´s my position that I think I can get from my gps data but do you know if I can show two points in the same map?

    Thanks!
    Maison,

    As you can see, the GoogleMaps class is just a wrapper to generate URL requests and save responses. Unfortunately I don't know Google Maps API but after skimming the API docs it seems that this job is done by GPoint(), available via javascript. I dont know how to do it in Python only.

    Related project: http://code.google.com/p/pymaps/

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    3

    Re: Help with PyS60 Google Maps API

    Quote Originally Posted by marcelobarrosalmeida View Post
    Maison,

    As you can see, the GoogleMaps class is just a wrapper to generate URL requests and save responses. Unfortunately I don't know Google Maps API but after skimming the API docs it seems that this job is done by GPoint(), available via javascript. I dont know how to do it in Python only.

    Related project: http://code.google.com/p/pymaps/
    Ok, thank you very much for your information.

    Regards!

Similar Threads

  1. PC Suite error: (Code: Init IMediaControl2) HELP?!
    By chunkyspudmonkey in forum General Development Questions
    Replies: 30
    Last Post: 2014-07-15, 05:44
  2. J2ME Google Maps API java.lang.SecurityException error
    By elaltaico in forum Mobile Java General
    Replies: 7
    Last Post: 2009-11-09, 06:00
  3. S60 API Partnering Program
    By Nokia Ron in forum News and Announcements
    Replies: 9
    Last Post: 2008-04-16, 18:28
  4. [announce] RaccoonOnMap: Raccoon + Google Maps
    By talakosk in forum Mobile Web Server
    Replies: 18
    Last Post: 2007-05-21, 14:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×