Hi,
I am workin me into the api.
following problem:
Throws "nokia.maps.routing.WaypointParameterList is not a function" exception....Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript" charset="UTF-8" src="http://api.maps.nokia.com/2.2.0/jsl.js?with=all"></script> <script type="text/javascript" charset="UTF-8" src="jquery.js"></script> <title>lala</title> </head> <body> <script type="text/javascript"> /* Set authentication token and appid * WARNING: this is a demo-only key * please register on http://api.developer.nokia.com/ * and obtain your own developer's API key */ nokia.Settings.set( "appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set( "authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); var router = new nokia.maps.routing.Manager(); // create a route manager; // The function onRouteCalculated will be called when a route was calculated var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); alert('OK'); } else if (value == "failed") { alert("The routing request failed."); } }; /* We create on observer on router's "state" property so the above created * onRouteCalculated we be called once the route is calculated */ router.addObserver("state", onRouteCalculated); // Create waypoints var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(52.51652540955727, 13.380154923889933)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(52.52114106145058, 13.40921934080231)); /* Properties such as type, transportModes, options, trafficMode can be * specified as second parameter in performing the routing request. * * See for the mode options the "nokia.maps.routing.Mode" section in the developer's guide */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }]; // Calculate the route (and call onRouteCalculated afterwards) router.calculateRoute(waypoints, modes); </script> </body> </html>
Whats my fault ?

Reply With Quote

