×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    1

    Launching the OVI maps app with a location marker from a Web Runtime app.

    I'm trying to launch the OVI maps app outside of the WRT app I'm building (so two apps would be open on the phone) and I want it to launch with a location marker on the map.

    From other posts I have seen two ways of doing this.


    The first was using a URL.

    services://C2A?C2Aid=2305&Version=1.0&2305=Landmark(lat=60.1783853&long=24.795528&name=Espoo%20Museum%20of%20Modern%20Art%20(EMMA))

    This worked on one of my X6 phones but wouldn't work on any of my other S60 5th edition phones. Does anyone know who to find a C2Aid on the fly in the background of the app? I'm guessing the C2Aid has some relation to the maps application.


    The second was by searching for the maps app using device.getServiceObject("Service.AppManager", "IAppManager"); and looping through the results for the maps app.

    I could then launch the maps app using so.IAppManager.LaunchApp(criteria); which takes an app's uid and also a CmdLine parameter. Does anyone know what you would need to type in the CmdLine parameter to get a location and marker on the app? I've tried combining the Landmark stuff from the URL method (see above) with this method but couldn't get it to work.


    Another post I saw mentioned creating a Landmark using the Service.Landmarks api and then exporting the landmark from database to xml. But I can't find anyway of exporting to xml using javascript from a WRT app and I can't see how to use the xml to launch the maps app with a landmark.


    Any other suggestions would be very welcome.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    Warsaw, Poland
    Posts
    104

    Re: Launching the OVI maps app with a location marker from a Web Runtime app.

    Hi,

    You may also consider writing some middleware software (a simple python/symbian web server) that will provide some additional functionality (e.g. in your case do sth with landmarks - like you wrote ealier "export them from database to xml" or sth else). You can then call such new functionality from WRT by using local server URL (e.g. http://localhost:1234/myservice?lat=...long=24.795528) that e.g. can return some data through HTTP, save data to a file, etc.

    Hope it helps
    Last edited by jack44; 2010-08-30 at 11:46.

  3. #3
    Registered User
    Join Date
    May 2009
    Location
    Rome
    Posts
    268

    Re: Launching the OVI maps app with a location marker from a Web Runtime app.

    this is a code snippet to export a single landmark from database


    Code:
    var lmService1 = device.getServiceObject("Service.Landmarks", "IDataSource");        
    function exportLandmark(id,dst){
        var data = new Object();
        data.DestinationFile = dst;
        data.MimeType = 'application/vnd.nokia.landmarkcollection+xml';
        data.IdList = [ id ];
        var criteria = new Object();
        criteria.Type = 'Landmark';
        criteria.Data = data;
        try{
            var result = lmService1.IDataSource.Export(criteria);
            if (result.ErrorCode==0 || result.ErrorCode==1010){
    
            }else{
                alert("exportLandmarks " +result.ErrorCode+" "+result.ErrorMessage);
            }
        }catch(e){
            alert ("exportLandmarks: " + e);
        }
    }
    Hope it helps
    Last edited by lucarocchi; 2010-08-31 at 12:25.

Similar Threads

  1. Replies: 2
    Last Post: 2002-07-02, 05:53

Posting Permissions

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