0

I have an issue Nokia Here Maps (v2.5.3 and 2.5.4), one I have instantiated a map on the page I keep having Javascript error logged in my console:

Unable to get property 'length' of undefined or null reference file:http://js.api.here.com/se/2.5.4/base.js Line:218

I debugged and found this error was thrown after the "pointercancel" event, the code wants to loop on "event.changeTouches" but the entry "changedTouches" does not exists in the normalized event object.

To test this issue you just need Internet Explorer (10 or 11) on a touch screen.

Regards, David

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265
user2026247
  • 149
  • 2
  • 8

1 Answers1

0

Use event.originalEvent if you're using jQuery:

function(e) {
  var evt = e.originalEvent,
  var touch = evt.changedTouches[0];
  ...
}

A try/catch would also help:

try
  {
  for(var i=0; i < evt.changedTouches.length; i++){}
  }
catch(e)
  {
  location.hash = "event.changedTouches does not exist";
  }

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265