Created
June 3, 2015 15:20
-
-
Save Szpadel/e3c4450bfb765dbfbb30 to your computer and use it in GitHub Desktop.
Adds css classes to google maps popups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
function styleAllBoxes() { | |
var cnt = $('.gm-style-iw'); | |
cnt.each(function(index){ | |
styleBox($(cnt[index])); | |
}); | |
} | |
function styleBox(item) { | |
var cnt = item.parent(); | |
var close = cnt.children().last().addClass('gm-info-close'); | |
var box = cnt.children('div').first(); | |
box.addClass('gm-info-box'); | |
var bg = box.children().last(); | |
bg.addClass('gm-background'); | |
var arrow = box.children().last().prev().find('div>div'); | |
arrow.addClass('gm.info-arrow'); | |
} | |
var map = $('.gm-style').on('DOMNodeInserted', styleAllBoxes); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment