Hello,
when following coding of my Application
is called I get an error "Uncaught TypeError: Cannot read property 'Display' of undefined ".Code:var mapElement = document.getElementById("myID"); map = new nokia.maps.map.Display(mapElement, { components : [ new nokia.maps.map.component.Behavior(), new nokia.maps.map.component.ZoomBar(), new nokia.maps.map.component.Overview(), new nokia.maps.map.component.TypeSelector(), new nokia.maps.map.component.ScaleBar() ], // initial center and zoom level of the map center : [ 52.51, 13.4 ], zoomLevel : 10 });
I only get this error, when I try to load the API on runtime:
myCallback is reached. But map is undefined. I also tried to work with the Features.load method to enforce another call back before I start accessing the map object but here I never got an callback:Code:var script = document.createElement("script"); script.type = "text/javascript"; script.charset="utf-8"; script.async = true; script.onload = myCallback; script.src = "http://api.maps.nokia.com/2.2.3/jsl.js?with=all"; document.head.appendChild(script);
Code:nokia.Features.load({"map": "auto"}, function(){alert("123");}, function(){alert("321");});
When I replace this with a static script tag in HTML head, everything works fine:
But I prefer to do this on the fly. Any idea what I made wrong?Code:<script src="http://api.maps.nokia.com/2.2.3/jsl.js?with=all" type="text/javascript"> </script>

Reply With Quote

