I want to use an HTML div as an information window in Google Maps
Here is the fiddle
Relevant Source
$(document).ready(function(){
var params = {'lat':$('#map_canvas').data('lat'),'long':$('#map_canvas').data('long')};
google.maps.event.addDomListener(window, 'load', initialize(params));
});
function initialize(coordinates) {
var mapOptions = {
center: new google.maps.LatLng(coordinates.lat,coordinates.long),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP,
};
var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
var infoWindow = new google.maps.InfoWindow({
content: $('#infowindow1').html(),
position:new google.maps.LatLng(coordinates.lat,coordinates.long),
});
var marker = new google.maps.Marker({
position: new google.maps.LatLng(coordinates.lat,coordinates.long),
map: map,
});
infoWindow.open(map);
marker.setMap(map);
}
I want to use the styled div as an information window instead of putting it up as a separate fixed div.
Any suggestions?