Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Dec 2012

    Basic routing not working?

    I've been trying to get routing to work with this new API and for some reason it just doesn't seem to get past even creating a manager.

    The code is very basic so I can't really see what could go wrong.

    <!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">
    		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    		<title>Nokia Maps API Example</title>
    		<script src="http://api.maps.nokia.com/2.2.3/jsl.js" type="text/javascript" charset="utf-8"></script>
    		<div id="mapContainer" style="width:600px; height:400px;"></div>
    		<script type="text/javascript">
    			nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); 
    			nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ");
    			var map = new nokia.maps.map.Display(
    				document.getElementById("mapContainer"), {
    					'zoomLevel': 10,
    					'center': [52.51, 13.4] 
    				var router = new nokia.maps.routing.Manager();
    The above code will give me the following error in Firefox 17
    TypeError: nokia.maps.routing.Manager is not a constructor
    And in Internet Explorer 8
    TypeError: Object expected
    The routing example found here only seems to produce a route in IE while FF gets a routing request failed, is routing bugged at the moment or did I miss something in my code?

    What's going on?

  2. #2
    Regular Contributor
    Join Date
    Aug 2011

    Re: Basic routing not working?

    Your problem lies with the following line:

    <script src="http://api.maps.nokia.com/2.2.3/jsl.js" type="text/javascript" charset="utf-8"></script>
    The routing library is not loaded by default see: http://developer.here.net/docs/maps_...kage-detection

    You'll need to add "all" or "directions" at the end as shown:
    <!-- By default we add ?with=all to load every package available, it's better to change this parameter to your use case. Options ?with=maps|positioning|places|placesdata|directions|datarendering|all -->
    <script type="text/javascript" charset="UTF-8" src="http://api.maps.nokia.com/2.2.3/jsl.js?with=all"></script>
    This will load the routing module allowing you to create a routing manager.

  3. #3
    Registered User
    Join Date
    Dec 2012

    Re: Basic routing not working?

    Thanks, that got it working beautifully.

Similar Threads

  1. Audio Routing API
    By marsiliano in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2011-04-08, 12:04
  2. Audio Routing API
    By ayaloz in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2008-02-27, 21:02
  3. routing address
    By vfoxter in forum Series 40 & S60 Platform Feedback Archive
    Replies: 0
    Last Post: 2006-11-15, 08:14
  4. Routing
    By aidj in forum General Messaging
    Replies: 1
    Last Post: 2002-11-12, 06:01

Posting Permissions

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