1
votes

Heyo, i´m using gmap3 and i want to click on a cluster and set the map´s center to that position with zoom.

like ?

cluster:{
    radius: 20,
    events:{ // events trigged by clusters
      click:function(cluster){
            var map = $(this).gmap3("get");
            map.panTo($(cluster).getPosition());
            map.setZoom(18);
            destin = $(cluster).getPosition();;
}

but it causes


TypeError: $(...).getPosition is not a function


any help? can´t figure out tryed alot, hope it´s not impossible, the gmap3 forum seems a bit spammed too

thanks in advance for any hint

1

1 Answers

2
votes

use:

cluster.main.getPosition()

instead of

 $(cluster).getPosition()