×

Discussion Board

Results 1 to 5 of 5

Hybrid View

  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    6

    Showing Maneuver List for the Routing Between two Points

    Hey,
    What would the best way to approach showing a maneuver list between two way points with a button to toggle between the map view and the maneuvers . Any help would be much appreciated or sample of how to go about getting this done.


    Thanks
    Dre

  2. #2
    Nokia Developer Moderator
    Join Date
    Aug 2011
    Location
    Berlin
    Posts
    288

    Re: Showing Maneuver List for the Routing Between two Points

    Quote Originally Posted by drewizkid View Post
    Hey,
    What would the best way to approach showing a maneuver list between two way points with a button to toggle between the map view and the maneuvers .
    The simplest way would be to use the default routing page:


    Code:
     
    nokia.mh5.assetsPath = "../../lib/";
    nokia.mh5.app.embed({
                appId: "YOUR APP ID",
                appCode: "YOUR TOKEN",
                hideAddressBar: true,
                
              layouts: ["myLayout"],
                
                myLayout	: {
                    controller: nokia.mh5.app.controller,
                    pages: [ "route"], 	
    
                    route: nokia.mh5.app.commonLayout.route
                }
            });
    If you need to start from a specified point, just add data to the from and to fields.

    Code:
    route: function(event) {
    		nokia.mh5.app.controller.updateHistoryEntry();
    		        var geolocation = nokia.mh5.geolocation;
    			nokia.mh5.app.controller.route({
    				    from: geolocation.available && {
    				      name: nokia.mh5.i18n("currentLocation"),
    				      latitude: geolocation.latitude,
    				      longitude: geolocation.longitude
    				    },
    				    to: event.data
    		});
    }

  3. #3
    Registered User
    Join Date
    Jun 2013
    Posts
    6

    Re: Showing Maneuver List for the Routing Between two Points

    Thanks for the snippet.
    EDIT: I want to make this view headless, and pass the waypoints in for the To and From locations. On the view I want to show the route maneuvers list with a button to toggle to the map. What is the best way to create this layout?
    Last edited by drewizkid; 2013-06-30 at 15:58.

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2012
    Posts
    65

    Re: Showing Maneuver List for the Routing Between two Points

    Hello,

    you can create a page and define your list, map and toggle button as children of the page:

    Code:
    nokia.mh5.app.embed({
                appId: "MY_APPID",
                appCode: "MY_APPCODE",
                layouts: ["phoneLayout"],
                phoneLayout: {
                    controller: nokia.mh5.app.controller,
                    pages: ["landing"],
                    landing: {
                        children: ["map", "list", "toggle"],
                        map: {
                            control: nokia.mh5.components.Map,
                            visible: false
                        },
                        list: {
                            control: nokia.mh5.ui.List,
                            itemClass: HERE IS YOUR LIST ITEM CLASS
                        },
                        toggle: {
                            control: nokia.mh5.ui.Button,
                            cssClass: "mh5_Button mh5_toggleButton",
                            icon: "HERE YOUR ICON PATH",
                            onClick: function() {
                                var page = this.parent;
                                page.map.visible = !page.map.visible;
                                page.list.visible = !page.list.visible;
                            }
                        }
                    }
                },
                getLayout: function() {
                    return "phoneLayout";
                }
            });

  5. #5
    Registered User
    Join Date
    Jun 2013
    Posts
    6

    Re: Showing Maneuver List for the Routing Between two Points

    I am currently using the route adapter to retrieve the route between my waypoints. What would be the most efficient way to bind my route results to the layout you provided below?

Similar Threads

  1. Add list after showing form (hack for lwuit s40 list bug)
    By xuanphung001 in forum Mobile Java General
    Replies: 2
    Last Post: 2013-04-24, 03:15
  2. need help : How to get a List of all Access Points in J2me ?
    By yaser_nss in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2011-02-12, 10:01
  3. How to get the list of Internet access points(iap)
    By dnsmm in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2009-06-05, 08:29
  4. [Moved] Not Showing Access points options in E61i while creating a connection
    By Changeme123 in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2008-10-03, 06:18
  5. Replies: 2
    Last Post: 2008-04-24, 09:15

Posting Permissions

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