×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    53

    google maps by get method of http, displaying them and showing navigation on screen

    HI,

    This is urgent.....

    I have downloaded a gps appa from the link
    http://wiki.forum.nokia.com/index.ph...Api_in_Symbian

    It downloads a google map and displays on the screen.

    I have to locate my position on that map with a graphics icon.
    and move that icon with key presses. also redownload other portions of the map and redraw to screen .

    the parameter to the get method in socket connection is
    //Prefix of google URL to retrieve Map
    // %S, %S will be replaced by latitude and longitude values respectively by the values retrieved from the method GetGPSInfoL
    _LIT(KGoogleMapURL,"http://maps.google.com/staticmap?center=%S,%S&format=jpg&zoom=8&size=240x320&key=");

    It displays a map on the screen. But I want to show my location on the screen. I guess my position will be marked by the centre of the screen. There I have to draw a rectangle. Then I have to
    move the rectangle with handling key events, I guess.I need a confirmation if I am right.
    But I want to download a largar part of the map. Clip onto the central rectangle.put the remaining into buffer.
    browse through that map on each movement. Display the other parts if required. i guess the better option would be to keep my position always in centre and mark a rectangle there. show all previous positions through a pre-allocated icon. redraw the clips of the main imgae with each key event.
    I tried to download a larger map by changing the get request as follows->
    _LIT(KGoogleMapURL,"http://maps.google.com/staticmap?center=%S,%S&format=jpg&zoom=8&size=1000x1000&key=");
    that is changing the size variable in the query string to 1000x 1000 and remaining part staying the same. But nothing gets displayed in the screen.
    withe the size 240x320 a google map is displayed.


    how to solve this.

    so I have 3 problems->
    1> how 2 get the larger map with size 1000x1000(this will be downloaded as jpg file)
    2> how to clip a part (240x320) and display on screen
    3>how to redraw the next clipping when the icon moves
    Last edited by sanee; 2008-09-26 at 08:22.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: google maps by get method of http, displaying them and showing navigation on scre

    1> how 2 get the larger map with size 1000x1000(this will be downloaded as jpg file)
    Does the method you've tried not download anything?

    2> how to clip a part (240x320) and display on screen
    Convert the JPEG to a CFbsBitmap with CImageDecoder and then draw the appropriate part to your grapics context with:
    virtual void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource,const TRect& aSourceRect)
    which is a method belonging to the graphics context.

    That's one way to do it. I think you could also create a CFbsBitGc and manipulate that.

    3>how to redraw the next clipping when the icon moves
    Look at the methods available in the graphics contexts.

    Hope that helps,
    Sorcery

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    53

    Re: google maps by get method of http, displaying them and showing navigation on scre

    size 1000x1000
    with this size , the mobile is not showing anything, only a blanc screen.
    but works with size 240x320


    I tried the url on internet explorer
    http://maps.google.com/staticmap?cen...2EqtccgujgzKwA


    in the windows explorer, also the same problem continues.
    http://maps.google.com/staticmap?cen...2EqtccgujgzKwA


    when i type this in the explorer, it throws an error

    Bad Request
    Your client has issued a malformed or illegal request

    Any solution to this???????

  4. #4
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    53

    Re: google maps by get method of http, displaying them and showing navigation on scre

    ok,
    i have done some findings

    the size works ou only for some specific combinations
    one is
    240x320

    another is 512x512

    I need no know what other combinations can I use.

    Also the zooming and unzooming options are adjusted by some values to the zoom parameters

    the latitude and longitude values are also specific.

    they do not work for all values..

    where can I get theses values????????

    some other help is there in the site
    http://code.google.com/apis/maps/doc...on/staticmaps/
    but thats not enough for me.


    also the image downloaded is with co-ordinates specified in the query string as the centre. I need to know also the cordinates of the 4 corners of the rectangular image. so that I can find the centre co-ordinates of the centres of other 8 images surrounding this particular image. Download them in advance into 8 different buffers and show clipping of those parts with key movements.

  5. #5
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: google maps by get method of http, displaying them and showing navigation on scre

    Hi,

    Read the documentation at the link you have provided carefully. It has all the answers you need.

    For example:
    Images may be retrieved in sizes up to 640 by 640 pixels. The size parameter takes a string with two values separated by the x character. 640x640 is the largest image size allowed. Note that the center parameter, combined with the size parameter implicitly defines the coverage area of the map image.
    There is your size restriction, that's why 1000x1000 doesn't work.

    I would also suggest for your use case that you try using the markers option rather than center and zoom.

    I hope that helps enough. I can't go much further without doing it for you.

    Sorcery

  6. #6
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    53

    Re: google maps by get method of http, displaying them and showing navigation on scre

    sorry,

    its a huge article.
    I did not notice that
    I did not scroll down.

    Reading it.......

Posting Permissions

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