dart - ReceivePortSync is not defined when using js.scrope -
i trying use dart.js call googlemap receive "breaking on exception: referenceerror: receiveportsync not defined". know exception?
import 'dart:html'; import 'dart:js'; import 'package:js/js.dart' js; import 'package:google_maps/google_maps.dart'; void main() { bindmap(); } void bindmap(){ js.scoped((){ final mapoptions = new mapoptions() ..zoom = 8 ..center = new latlng(-34.397, 150.644) ..maptypeid = maptypeid.roadmap ; final map = new gmap(query("#map_canvas"), mapoptions); }); }
you have add <script src="packages/browser/interop.js"></script>
in html file , add browser package in dependencies.
on code, can :
- avoid
js.scoped
not needed since few versions of js. - remove
import 'dart:js';
not needed.
finally can have @ the simple map example have up-to-date example.
Comments
Post a Comment