×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    39

    intuitive location display

    Hi

    I would like to have a more intuitive location on the presence site of MWS. A link to GoogleMaps or to display the coordinates would be nice. My wife can not really understand 5x.2607, 6.x203
    I have seen that a blog in the MWS blog refers to https://demo.mymobilesite.net/.py?application=-13
    for a demo. Unfortunatelly, this mobsite is typically offline, at least when I looked at it.
    I would like to update my mobsite, and I believe I need to work on Webserver\htdocs\Web_Applications\Presence\Viewer\index.psp
    Is there any proposal how to do that, means which sourcecode to add?

    Thx, ueffchen
    E70, GPS LD-3W
    E71

  2. #2
    Regular Contributor
    Join Date
    Apr 2008
    Location
    Charlotte, NC, USA
    Posts
    79

    Re: intuitive location display

    What you can do to that page is to wrap the code for the coordinates in a URL link that points to Google/Yahoo/Live Maps and then that would show her exactly where you are.

    Example of that on my site here.
    Of course, if there is no data populated there, then the link will go no where.

    The HTML for that just looks like this:

    HTML Code:
    <a href="http://maps.google.com/maps?f=q&hl=en&geocode=&q=Unknown (using assisted GPS)&ie=UTF8&iwloc=addr">**the geocode from MWS**</a>
    I've not yet played with this long enough to actually pull up a map, but it should be pretty much the same kind of passing a parameter into the page and then using whatever API for the mapping service to just show a map on that page.
    Last edited by ARJWright; 2008-09-16 at 19:44.
    http://antoinerjwright.com - an MWS hosted site

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    20

    Re: intuitive location display

    Hi.

    If static map image is enough for you, try out the following. The mentioned file "Web server\htdocs\Web_Applications\Presence\Viewer\index.psp" is the correct one to edit.

    Add and initialise new text variable somewhere in the beginning, for example after the other initialisations (method_texts and unknown_texts). Pay attention to indentation as this is Python code.

    Code:
    map_image = ''
    After these rows

    Code:
    location = "%.4f, %.4f" % (latitude, longitude)
    location += " " + ( method_texts[pos_method] % horizontal_accuracy )
    add new row

    Code:
    map_image = '<img border="0" alt="map" src="http://maps.google.com/staticmap?size=300x300&maptype=mobile&markers=%.4f,%.4f&zoom=10"/>' % (latitude, longitude)
    to set your coordinates into a image link in the case your location is known. You can adjust the image size (now 300x300) and zoom level (now 10) to suit your own preferences.

    Last after these rows

    Code:
    <dt><%=INFO_TITLE_COORDINATES%></dt>
    <dd><%=location%></dd>
    add one more row

    Code:
    <dd><%=map_image%></dd>
    to display the map.

    In this example I used Google, but there are also lots of different map providers and different ways to show your coordinates on the map. These static maps should be visible both in computer and mobile device browsers.

  4. #4
    Registered User
    Join Date
    May 2007
    Posts
    39

    Re: intuitive location display

    Works, perfect!
    Only thing I would like to have is zoom in/out capabilities, put that's something to look at later.

    -ueffchen
    E70, GPS LD-3W
    E71

  5. #5
    Registered User
    Join Date
    May 2007
    Posts
    39

    Re: intuitive location display

    One more question: is it possible to store the current (last) location, so if the handset can not get CellID/GPS coordinates, it just returns the last available location?

    -ueffchen
    E70, GPS LD-3W
    E71

  6. #6
    Registered User
    Join Date
    Dec 2003
    Posts
    20

    Re: intuitive location display

    If the static image is not enough, you could change the image to be a link to dynamic map with panning&zooming option.

    Then the row would be like this:

    Code:
    map_image = '<a href="http://maps.google.com/maps?q=%.4f,%.4f&z=13"><img border="0" alt="map" src="http://maps.google.com/staticmap?size=300x300&maptype=mobile&markers=%.4f,%.4f&zoom=10"/>' % (latitude, longitude, latitude, longitude)
    Initial zoom level is now set to 13. That can be naturally whatever you like. If you want another type of map, after z=13 just add &t=k for satellite or &t=p for terrain map. And as always, the above is just one way of doing this.

    To answer your other question, it is possible to show your last known position, but it is not that straightforward. These suggested modifications are just showing the available data in a different way, but here you would need to manipulate the data as well.

    If you would like to create your own script/application for this feature there is a good method in PyS60: last_position(). You can also store the position yourself. For example write it to some file with time stamp always when you get it and then in those cases that you don't, just read it from the file.

Similar Threads

  1. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  2. Nokia N-Series Complete Model Line-Up
    By Dopod in forum General Development Questions
    Replies: 6
    Last Post: 2008-07-22, 20:16
  3. s60 3rd ed emulator crash
    By Kimau in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-06-18, 22:12
  4. where is python location on mobile phone
    By lb213_2000 in forum Symbian
    Replies: 1
    Last Post: 2007-11-05, 08:56

Posting Permissions

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