问题
I've updated HereMaps JavaScript from 2.2.4 to 2.5.3 and the map has stopped working on Chrome (version 31.0.1650.57 m). Firefox and IE work as before.
On the console I see the message many times
Coroutine 'nokia.maps.map.render.p2d.Engine#_renderCo' aborted abnormally with exception base.js:158 TypeError: Cannot read property 'body' of undefined
Does anyone have a hint of what might be wrong?
Thanks.
回答1:
It is very difficult to answer your specific problem without seeing your code, but I am able to produce a similar error which may help you track down your issue.
If you are getting multiple error messages, then it is likely that the JavaScript library itself is calling something periodically. From the text of the error it likely that the library is running a Coroutine, which is usually used for threading within the application.
The error I can produce is in a callback - if I add an overlay to the map, and deliberately try to access a non-existent property within my code I can get:
Coroutine 'nokia.maps.map.render.p2d.Engine#_renderCo' aborted abnormally with exception base.js:158
TypeError: Cannot read property 'bar' of undefined
This was because I added a typo as follows:
I changed the reference from foo.something.bar
in the callback to foo.does_not_exist.bar
. So I guess somewhere in your callbacks you are referencing foo.something.body
in your callback - it could be in a listener for example.
Another possibility, is that you are switching directly to Display.SATELLITE
when you are creating the map - this is no longer allowed:
Taken from the News feed on developer.here.com:
Breaking changes with 2.5.3
The new rendering engine requires the map to be initialized asynchronously. If you want to change the center, zoom level or the base map type the API now requires the application to wait for the
"displayready"
event to be fired. This event is only fired once. Please refer to the developer's guide (section "Beyond the Basic Map Application ") for details.
来源:https://stackoverflow.com/questions/20094457/coroutine-nokia-maps-map-render-p2d-engine-renderco-aborted-abnormally-with-e