jshimko / meteor-geocomplete

Geocoding and Places Autocomplete Plugin
http://ubilabs.github.com/geocomplete/
44 stars 4 forks source link

map not showing up #2

Closed shkomg closed 9 years ago

shkomg commented 9 years ago

Hi,

it's partially working - i got geocomplete, but no map and marker (however I see that map div changes in html from empty div). May you pls help?

router.js

Router.onBeforeAction(function (){
GoogleMaps.load({libraries: 'places' });
this.next();   }, {only:['userProfile']});

template.js

Template.userProfile.events({
  'click #find': function (){
       event.preventDefault();                                
       $("#geocomplete").trigger('geocode');    
    }
});

Template.userProfile.rendered=function () {
   $("#geocomplete").geocomplete({map:".map_canvas"});
}; 

html.html

             <div class="input-group">
                <input class="form-control" id="geocomplete" type="text" autocomplete="off">
                <span class="input-group-btn">
                  <button class="btn btn-primary" id="find">FIND</button>
                 </span>                
              </div>                
            <div style="width:900px;height:900px;">
              <div class="map_canvas">                       
              </div>
           </div>
shkomg commented 9 years ago

@jshimko ok, it's working with some changes - anybody having troubles as I'm may now check working code here https://github.com/dburles/meteor-google-maps/issues/19