dburles / meteor-google-maps

🗺 Meteor package for the Google Maps Javascript API v3
https://atmospherejs.com/dburles/google-maps
MIT License
196 stars 48 forks source link

All blank with no error message #124

Closed NanIsNotANum closed 8 years ago

NanIsNotANum commented 8 years ago

Hi @dburles ,

I installed your package, and follow your tutorial, but the map just doesnt show up @@ since theres no error message at, I would like to know if you can take a look and give me some suggestion?

Heres my code:

in template html file

{{> googleMap name="exampleMap" options=exampleMapOptions}}

in .css file

body, html { height: 100%; width: 100%; } .map-container { width: 100%; height: 100%; }

in .js file **Template.hello.onCreated(function helloOnCreated() { GoogleMaps.load({key:"my key"}); GoogleMaps.ready('exampleMap', function(map) {

  // Add a marker to the map once it's ready

    var marker = new google.maps.Marker({
    position: map.options.center,
    map: map.instance
});

}); }); Template.hello.helpers({

   exampleMapOptions: function() {
  // Make sure the maps API has loaded
  // Map initialization options

    return {
        center: new google.maps.LatLng(-37.8136, 144.9631),
        zoom: 13
    };
 }

});**

Thanks a lot :)

dburles commented 8 years ago

Did you wrap the map template in <div class="map-container"></div>?

NanIsNotANum commented 8 years ago

Hello, I forgot to attach the part, but Yes I do wrap the template in

!

dburles commented 8 years ago

I'd suggest to try run this https://github.com/dburles/meteor-google-maps-demo and compare it with your own app for any differences that may be causing the problem

NanIsNotANum commented 8 years ago

Hi there, I tried to compare with the demo code and my code, I didnt see how I could improve my code. However, these days after I edited my code from other parts, the map works! but unfortunately I still have no idea which other parts were blocking the map. I will report you once I am sure. I will close the issue for now. Thanks a lot for the help!