I'm trying to use google maps with dart, according to this web site:
https://pub.dartlang.org/packages/google_maps
And i'm getting this error:
Exception: Class 'GElement' has no instance method '[]'.
NoSuchMethodError: method not found: '[]'
Receiver: Instance of 'GElement'
Arguments: ["maps"] (package:google_maps/src/generated/core/base/lat_lng.dart:24)
My source code for .dart is:
import 'dart:html';
import 'package:polymer/polymer.dart';
import 'package:google_maps/google_maps.dart';
@CustomTag('rifidi-map')
class RifidiMap extends PolymerElement {
RifidiMap.created() : super.created() {
main();
}
void main() {
final mapOptions = new MapOptions()
..zoom = 8
..center = new LatLng(-34.397, 150.644)
..mapTypeId = MapTypeId.ROADMAP
;
final map = new GMap(querySelector("#map_canvas"), mapOptions);
}
}
The .HTML file has the import to use the script:
http://maps.googleapis.com/maps/api/js?sensor=false
The versions I'm currently using are:
Dart editor: versión 1.8.3
gogle_maps dart dependency: >=2.0.7 <3.0.0
polymer dart dependency: >=0.15.0 <0.16.0
Does anyone have a working workspace that can share with me to see how to implement a google maps polymer component using dart? Thanks
http://maps.googleapis.com/maps/api/js?sensor=false
– Antigascript
tag at the top of yourindex.html
to confirm it's even the problem. – Antiga