a14n / dart-google-maps

A library to use Google Maps JavaScript API v3 from Dart scripts.
Other
125 stars 63 forks source link

How to run the demo? #114

Closed BearnLee closed 1 year ago

BearnLee commented 1 year ago
<html>
    <head>
        <title>Drawing tools</title>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8">
        <style>
          html, body, #map-canvas {
            height: 100%;
            margin: 0px;
            padding: 0px
          }
        </style>
    </head>
    <body>
        <div id="map"></div>
        <script src="https://maps.googleapis.com/maps/api/js?key=key"></script>
        <script src="main.dart.js"></script>
    </body>
</html>
void main() {
  GMap(
    document.getElementById('map') as HtmlElement,
    MapOptions()
      ..center = LatLng(-34.397, 150.644)
      ..zoom = 8,
  );
}

Screen is white and showing nothing. is there any one can help me to solve the problem?

a14n commented 1 year ago

You can: