I am using google map v3 api, I would like to show an information bubble. For example, when I click a marker on any marker, the function will open the corresponding bubble. On the other hand, I would like to run the entire bubble with an external link. I believe that marker, 'click', function should be every function. I tried many examples, but I did not work.
Here are my test additions:
http://www.gercekustu.com/test/
Here is my code:
function getGoogleMap(Altitude, Latitude, Address) {
var image = 'icon.png';
var myOptions = {
zoom: 10,
center: new google.maps.LatLng(-33.9, 151.2),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("googleMap"), myOptions);
var locations = [
['Test içeriği5', -33.890542, 151.274856, 5],
['Test içeriği4', -33.923036, 151.259052, 4],
['Test içeriği3', -34.028249, 151.157507, 3],
['Test içeriği2', -33.80010128657071, 151.28747820854187, 2],
['Test içeriği1', -33.950198, 151.259302, 1]
];
for (var i = 0; i < locations.length; i++) {
var image = new google.maps.MarkerImage('icon.png',
new google.maps.Size(40, 34),
new google.maps.Point(0, 0),
new google.maps.Point(10, 34));
var location = locations[i];
var myLatLng = new google.maps.LatLng(location[1], location[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
icon: image,
title: location[0],
zIndex: location[3]
});
var infowindow = new google.maps.InfoWindow({
content: location[0],
position: myLatLng
});
google.maps.event.addListener(marker, 'click', function () {
infowindow.open(map);
});
}
infowindow.open(map);
}
thanks for the help