开发者

Google maps marker not working on iphone

The Google map info window will not appear when I click on a marker using the iphone. The same code works on the desktop on Android.

I need the map hidden by default and then loaded in only when the user clicks the view map button as I want to keep the weight of the page down as this is for a mobile site.

The click event handler is being fired as I put an alert on it and it worked. I think it might be something to do with the order of the code when I attacked the click handlers, but thats a guess. Also, when I add draggable: true to the markers the bubble appears but I dont want the markers to be draggable.

I have set up a test page http://www.clawg.co.uk/nearby/testmap.html

A run through of this is:

  • I scan the DOM for
  • data attributes values which I use to create an array of data that will be used for info windows.
  • I create a button on the fly that will make the map appear when clicked
  • When the button is clicked t开发者_如何学运维he map api is loaded in if its not already available
  • The map is then loaded
  • The markers are positioned on the map


The default marker icons are too small for iphone 4 making them unclickable, so I used a custom marker that was 42x42 in size.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜