开发者

google maps custom control position - BOTTOM_RIGHT not working

开发者 https://www.devze.com 2023-02-15 01:47 出处:网络
I made a c开发者_如何学Pythonustom control in google maps and i\'m trying to position it on the BOTTOM_RIGHT corner of the screen. When the page initially loads for the first time it is placed correct

I made a c开发者_如何学Pythonustom control in google maps and i'm trying to position it on the BOTTOM_RIGHT corner of the screen. When the page initially loads for the first time it is placed correctly and works fine. However as soon as I drag the map, the control is moved to center of the screen. Any ideas on what might be wrong?

Perhaps i could add a listener on dragstart and replace the control every time? Not sure how to do this though...

  var leyendDiv = document.createElement('DIV');
  var leyendControl = new LeyendControl(leyendDiv);
  leyendDiv.index = 1;
  map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(leyendDiv);

any advice is very much appreciate it!


This was fixed today, 30 June 2011, by the update to Google Maps Api V3. Change log is here: http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog


Even though the page in v3 changelog said its fixed. http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog

as of Nov 8, 2012, its broken again. the best we can do at the moment is to use BOTTOM_CENTER

I think Google doesn't want to block the Terms of use link on the bottom right.


Here is the solution:-

map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(leyendDiv);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号