var map;
var infoBubble;
// Initial position of the map
var center = new google.maps.LatLng(-25.363882, 131.044922);
function initialize() {
// Map options
var mapOptions = {
zoom: 4,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
// Attach the map to the document
map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
// The marker
marker = new google.maps.Marker({
position: new google.maps.LatLng(-25.363882, 131.044922),
map: map,
title: 'marker7'
});
infoBubble = new InfoBubble({
maxWidth: 450,
minWidth: 450,
maxHeight: 165,
minHeight: 165,
backgroundColor: 'rgba(65,65,65,0.7)',
disableAnimation: true,
content: '<div><a class="dialog" href="https://maps.google.com/" target="_blank"></a></div>',
position: new google.maps.LatLng(-34.397, 150.644)
});
google.maps.event.addListener(marker, 'click', function () {
console.log('marker just clicked');
infoBubble.open(map, marker);
console.log('line after infoBubble.open');
google.maps.event.addListener(infoBubble, 'domready', function () {
console.log('inside domready function');
$.get('https://lh4.googleusercontent.com/-_Cox6aEnSkU/UQ_B0LK4khI/AAAAAAAAAzw/4H4dsWGPgeE/s150/go-button.png', function (myImage) {
console.log('just got the external image, now let\'s add something completely unrelated...');
$(".dialog").html('<img id="theImg" src="https://goo.gl/phmzis" />');
console.log('apparently that was added, but i don\'t see it on first click');
})
});
});
}
google.maps.event.addDomListener(window, 'load', initialize);
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.