×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    38

    Values are not getting for Root map functionality

    Hi,

    Please see the below code. Values are not getting for Route map functionality. The coordinate point values are not coming to this line "waypoints.addCoordinate(... so on..." . How those values will come?. I tried with cookies and lot of other aspects. If that values are came, then I'll replace 41.56366,28.28349 with lat,lon. Please rectify this problem.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Route - Nokia Maps API Example</title>
    <script src="http://api.maps.nokia.com/2.1.1/jsl.js" type="text/javascript" charset="utf-8"></script>
    </head>
    <body>
    <div id="map" style="width:600px; height:400px;"></div>
    <script type="text/javascript">
    
    var searchManager = new nokia.maps.search.Manager();
    searchManager.addObserver("state", function (observedManager, key, value) {
    // If the search has finished we can process the results
    if (value == "finished") {
    // We check that at least one location has been found
    if (observedManager.locations.length == 1) {
    // alert (observedManager.locations[0].displayPosition);
    var lat = observedManager.locations[0].displayPosition.latitude;
    var lon = observedManager.locations[0].displayPosition.longitude;
    } else {
    var lat = observedManager.locations[0].displayPosition.latitude;
    var lon = observedManager.locations[0].displayPosition.longitude;
    }
    } else if (value == "failed") {
    alert("The search request failed.");
    }
    });
    
    var proximity = {
    center: new nokia.maps.geo.Coordinate(28.51434, 77.01219),
    radius: 1500 // search radius defined in meters
    };
    
    var searchTerm = "berlin";
    searchManager.geocode(searchTerm, proximity);
    
    
    var map = new nokia.maps.map.Display(
    document.getElementById("map"), {
    components: [new nokia.maps.map.component.Behavior()],
    zoomLevel: 11,
    center: [28.51434, 77.01219]
    }
    );
    
    map.removeComponent(map.getComponentById("zoom.MouseWheel"));
    // Create a route controller
    var router = new nokia.maps.routing.Manager()
    // Create waypoints
    alert("Plz check from here. Below I kept Alert message for Lat/Lon value. Those values are not coming here.");
    //alert(lat);
    //alert(lon);
    var waypoints = new nokia.maps.routing.WaypointParameterList();
    waypoints.addCoordinate(
    new nokia.maps.geo.Coordinate(41.56366,28.28349)
    );
    waypoints.addCoordinate(
    new nokia.maps.geo.Coordinate(41.46366,28.08349)
    );
    var modes = [{
    type: "shortest",
    transportModes: ["car"],
    options: "avoidTollroad",
    trafficMode: "default"
    }];
    
    var onRouteCalculated = function (observedRouter, key, value) {
    if (value == "finished") {
    var routes = observedRouter.getRoutes();
    // Create the default map representation of a route
    var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container;
    map.objects.add(mapRoute);
    // Zoom to the bounding box of the route
    map.zoomTo(mapRoute.getBoundingBox(), false, "default");
    } else if (value == "failed") {
    alert("The routing request failed.");
    }
    };
    
    // Add the observer function to the router's "state" property
    router.addObserver("state", onRouteCalculated);
    
    // Calculate the route (and call onRouteCalculated afterwards)
    router.calculateRoute(waypoints, modes);
    </script>
    
    </body>
    </html>
    Last edited by jasfox; 2012-03-07 at 12:16. Reason: formatting

  2. #2
    Registered User
    Join Date
    Feb 2012
    Posts
    38

    Re: Values are not getting for Root map functionality

    Hi,
    Please reply soon... Its urgent..

  3. #3
    Regular Contributor
    Join Date
    Aug 2011
    Location
    Berlin
    Posts
    288

    Re: Values are not getting for Root map functionality

    Could you please stop repeating your question in multiple threads. There is already a reply to this.

    http://www.developer.nokia.com/Commu...l=1#post885188

  4. #4
    Registered User
    Join Date
    Feb 2012
    Posts
    38

    Re: Values are not getting for Root map functionality

    Thank you so much.

Similar Threads

  1. CCntFilter functionality
    By truf in forum Series 40 & S60 Platform Feedback Archive
    Replies: 2
    Last Post: 2008-05-24, 08:53
  2. Replies: 0
    Last Post: 2007-06-11, 06:04
  3. N80 IR Functionality
    By navin.sharma in forum General Development Questions
    Replies: 1
    Last Post: 2006-06-17, 12:15
  4. Setting path and root values manually after install
    By suppe79 in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2004-06-05, 20:46
  5. GPS functionality
    By sticky1 in forum Symbian
    Replies: 1
    Last Post: 2001-12-03, 20:11

Posting Permissions

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