开发者

randomize position of marker on google map

This problem has really troubled me and yet to have a solution.

I have a list of locations with latitude and longitude.

And each time i click on the button next, it suppose to auto open the infowindow of the location one by one each click. However, the infowindow and marker always open at the center. May I know how can I make the location of infowindow randomized instead of opening at the center of the map only? Is there any way I can hide the mark开发者_运维技巧er and set the beak of infowindow to the pointer of marker?

Thanks. Kinda urgent.


How are you opening your infoWindow? The open method on an infoWindow object takes a map parameter and an optional MVCObject parameter. If you specify the appropriate marker for the second parameter, then the info window will be attached to that marker.

N.B. I am assuming you are using the current Google Maps API v3. If you are using the v2 API, let us know.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜