cybersthang / gmaps-utility-library-dev

Automatically exported from code.google.com/p/gmaps-utility-library-dev
0 stars 0 forks source link

Click on marker always pan's to, even when its very far away #110

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a lot of markers with a reference
2. Trigger a click event on a marker outside the viewport

What is the expected output? What do you see instead?

The map moves to the specified point, if the marker is too far, dont pan to
the marker.

I've seen the map pan for like 1 minute. That is no fun. I think there
should be a maximum of panning. The code i used internally to fix it:

ExtInfoWindow.prototype.repositionMap_ = function(){
...
...
...
  if (panX != 0 || panY != 0 && this.map_.getExtInfoWindow() != null ) {
      if( (panY < -500 || panY > 500) && (panX < -500 || panX > 500)  ) {
        this.map_.setCenter(this.marker_.getPoint());
      }else {
        this.map_.panBy(new GSize(panX,panY));
      }
  }
};

Please comment.

Original issue reported on code.google.com by bbr...@gmail.com on 14 May 2009 at 11:57

GoogleCodeExporter commented 8 years ago
Fixed in R 996 in dev-svn

Original comment by bbr...@gmail.com on 15 May 2009 at 10:28