×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Nokia Developer Expert
    Join Date
    May 2012
    Location
    Chicago
    Posts
    1

    BaseMap from maps.nokia.com for Maps API

    The default "Map View" basemap used with the Maps API for developers is very different from the basemap seen at maps.nokia.com. What is the reason for this, and is there any way to access THAT basemap in my app instead?

    Example:
    http://i45.tinypic.com/msj7tw.png

    Thanks!
    Jim

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

    Re: BaseMap from maps.nokia.com for Maps API

    The "cool pink" base map will be used automatically if you upgrade your application to use API 2.2.x or higher. Assuming you are using Nokia Maps 2.0.x or 2.1.x , This should just be a matter of altering the URL of the library you have loaded. The change in the middle digit indicates a potential code break, so you will have to update your script elsewhere as necessary.

    Assuming you are using 2.1.x upgrade path is as follows:

    Replace :
    Code:
    <script type="text/javascript" charset="UTF-8" src="http://api.maps.nokia.com/2.1.0/jsl.js"> 
    </script>
    with:
    Code:
    <script type="text/javascript" charset="UTF-8" src="http://api.maps.nokia.com/2.2.0/jsl.js">
     </script>
    and replace the old authentication code:
    Code:
    nokia.maps.util.ApplicationContext.set(
     {"appId": "YOUR APPID", "authenticationToken": "YOUR TOKEN"});
    with:
    Code:
     nokia.Settings.set( "appId", "YOUR APPID"); 
    nokia.Settings.set( "authenticationToken", "YOUR TOKEN");
    Goecoding and Reverse geocoding
    The main item which have changed in the new release is the fact that search is purely the responsibility of places in the new API. This should improve search results, but does mean a code break has occurred. If you use geocoding or Reverse geocoding then you'll need to alter the following:

    Change:
    Code:
    var manager = new nokia.maps.search.Manager();
    
    var onManagerStateChange = function (observedManager, key, value) {
    	var location = observedManager.locations[0];
    ...etc
    }
    
    manager.addObserver("state", onManagerStateChange);
    manager.geocode(addresses[i]);
    To:
    Code:
     var searchManager = nokia.places.search.manager;
    searchManager.geoCode({
    		searchTerm: addresses[i],
    		onComplete: function (data, requestStatus, requestId) {
    			var location = data.location;
    ...etc
    		}
    	});
    for full details look at the difference between


    If you are still using the old Ovi Maps library, you'll also need to replace any instances of ovi.mapsapi in the code with nokia.maps since from 2.0.x onwards all objects are created in a different namespace, as well.

Similar Threads

  1. Is there a way to convert Maps Data from Nokia Maps 3 to be compatible with N Maps 2
    By dimchopicha in forum General Development Questions
    Replies: 6
    Last Post: 2011-01-09, 17:50
  2. Navigation route coordinates from Nokia Maps or Ovi Maps
    By selimsolmaz in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2010-03-04, 10:02
  3. Replies: 3
    Last Post: 2010-03-03, 10:25

Posting Permissions

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