0

i am trying to load more markers when the map is dragged and i'm not sure how to get the current bounds.

var map = $('#map');
map.gmap().bind('init', function(evt, map) {
    $(map).dragend(function(){
        console.log('a');
    });
});

i need to somehow get the current bounds inside the dragend callback and load more markers..

notice that i am using jQuery UI Map v3 and not Google Maps Api v3 witch is a bit different in the way it calls different methods

anyone has any ideas, i can't find this in the wiki?

thanks

Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107
Patrioticcow
  • 26,422
  • 75
  • 217
  • 337

1 Answers1

0
  • variant #1 (using the addEventListener-method of the plugin)
        $(function() { 
          $('#map_canvas')
            .gmap()
              .bind('init', function(evt, map) {
                  $(map)
                    .addEventListener('dragend',function(){
                                        console.log('a');
                                      });
                    });
        });
  • variant #2(using the addEventListener-method of the google-Maps-API)
    $(function() { 
      $('#map_canvas')
        .gmap()
          .bind('init', function(evt, map) {
              google.maps.event.addListener(map,'dragend',function(){
                                    console.log('b');
                                  });
                });
    });
Dr.Molle
  • 116,463
  • 16
  • 195
  • 201