Discussion Board

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

    Unhappy unable to initialize nokia maps on webpage

    we are building a touristic portal which will have nokia maps integrated to display touristic units(hotel, motel...) based on browsing city. when ever i try to run any off the predefined examples in the javascript explorer i get this error in IE "SCRIPT5007: Unable to get value of the property ownerDocument': object is null or undefined map-js-p2d-dom.js, line 147 character 349" and "TypeError: a is null" in firefox. i set the appid and and token to the one given by my new app, but its not working. i also tried to set it to the demo one from the javascript explorer(pure copy/paste) and its still not working... i also tried to copy/paste in a plain html document on my pc and just run it from there but no luck same error...
    am i doing something wrong?

  2. #2
    Regular Contributor
    Join Date
    Aug 2011

    Re: unable to initialize nokia maps on webpage

    The problem you are having is in the code initializing the map. The <DIV> you are passing into the nokia.maps.map.Display does not exist.

    I can reproduce your error by taking the following working map and altering it as follows:

    Here is a working map (header AND styling removed for clarity) :
    		<div id="mapContainer"></div>
    		<script type="text/javascript">
    			nokia.Settings.set( "appId", "YOUR APP ID GOES HERE"); 
    			nokia.Settings.set( "authenticationToken", "YOUR AUTHENTICATION TOKEN GOES HERE");
    var mapContainer = document.getElementById("mapContainer");
    var DefaultLatitude = 52.516237;
    var DefaultLongitude = 13.377686;
    var defaultZoomLevel = 16;
    var mapOptions =
        baseMapType: nokia.maps.map.Display.NORMAL,
        center: new nokia.maps.geo.Coordinate(DefaultLatitude, DefaultLongitude),    
        zoomLevel: defaultZoomLevel,
        components: []
      var map = new nokia.maps.map.Display(mapContainer, mapOptions);

    If I change the reference to the mapContainer to a non-existant <DIV>

    var mapContainer = document.getElementById("NOTmapContainer");
    I get the TypeError: a is null http://api.maps.nokia.com/2.2.3/map-js-p2d-canvas.js Line 135 message in firefox.

  3. #3
    Registered User
    Join Date
    Dec 2012

    Re: unable to initialize nokia maps on webpage

    thank you for the reply. yes your example worked and comparing the one you supplied and the one i was trying to do i realized that i need to initialize nokia maps after the mapContainer. i had the script in the header and needed to put it after the map container was set. now its working perfectly. thank you again :)

Similar Threads

  1. unable to access webpage
    By sarayu in forum Symbian
    Replies: 5
    Last Post: 2007-07-26, 11:45
  2. Replies: 0
    Last Post: 2005-09-07, 08:48
  3. "Unable to initialize threads" when launching Nokia Series 60 Emulator
    By inverse in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-08-31, 10:58

Posting Permissions

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