Pregunta

I have written this code in Dart

window.navigator.geolocation.getCurrentPosition((Geoposition position) {
    window.alert(position.coords.latitude.toString());
});

When I run it in Dantium or Google Chrome it works fine, but if I try running this in Firefox, I get this JavaScript error

Timestamp: 15/11/12 21:36:19
Error: TypeError: getCurrentPosition$1 is not a function

This is wierd as if I just wrote this using html5 JavaScript

if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
}

function showPosition(position) {
    var latlon=position.coords.latitude+","+position.coords.longitude;
    alert(latlon);
}

It works perfectly fine in Firefox.

The Firefox version is 16.0.2, Dart Editor version is 0.2.3_r14669 and Dart SDK version is 0.2.3.0_r14669.

Is this a bug or am I doing something wrong?

EDIT:

It was a bug http://code.google.com/p/dart/issues/detail?id=6733&q=getCurrentPosition&colspec=ID%20Type%20Status%20Priority%20Area%20Milestone%20Owner%20Summary, but it is marked as fixed now, by @Pete Blois shown below.

¿Fue útil?

Solución

Issue has been fixed, as well as an issue causing it to not work on IE10.

Otros consejos

Please file a bug, and we'll get it taken care of. Thanks!

http://dartbug.com/new

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top