Michael
Michael

Reputation: 2598

handling google map markers in qTip2

I'm trying to create an internal admin interface to quickly add locations to events using qTip and google maps. Here's a simplified fiddle: http://jsfiddle.net/mykel_suthertun/RWtRe/

It currently works, minus two bugs:

  1. Markers are duplicated every time the qTip is opened. (Solved. See comment below.)
  2. It can't currently handle opening a map with no map center or marker defined.

Re: #1 - To see what I mean, click the pin icon on the right. Click off. Click to open it again. There are two markers in the same spot now. It should only create it once.

I assume this is because I have the marker being created in the qTip's "show" event and not in "render". When I moved it to "render" I ran into errors getting the map to display at all.

Re: #2 - To see this bug, just click any of the target icons. I just need it to open a default map state if no marker or center is defined. How would I adjust my code to handle this?

Upvotes: 1

Views: 643

Answers (1)

Michael
Michael

Reputation: 2598

Final fiddle.

There's some terribly inefficient JavaScript in there (duplicated functions, etc), but it currently runs and does everything I needed it to. I added a couple other features in there since the original as well. Hope this helps someone out.

Upvotes: 0

Related Questions