Custom Position Non Custom Control Google Maps (v3 API)

后端 未结 4 1637
星月不相逢
星月不相逢 2021-01-22 04:59

I would like to be able to adjust the position of the map type control. I have it set to top right however I need to drop it by about 50 pixels. I read on custom controls you ca

4条回答
  •  忘掉有多难
    2021-01-22 05:24

    We hacked this. With the help of jQuery we label elements with a class or id based on their custom style elements when the map is first created. This allows us to do stuff like ('.zoom_controls').css('top', '50px') to move the zoom controls down.

    It's a hack that could break at any time but it works for us at v3.4. We'll revisit when it becomes an issue. I don't know why Google just don't put IDs in there.

    • Classes: https://gist.github.com/887917
    • IDs: https://gist.github.com/887918

提交回复
热议问题