Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,359,801
Community Members
 
Community Events
168
Community Groups

How to display an image from the database in google maps infowindow?

here is my code for the contentString for the infoWindow

<script>
.
.
.
var contentstring = '<div id="content">'+
'<div id="siteNotice">'+
'<img src="images/img5.jpg" height="100" width="100" />' +
'</div>'+
'<h1 id="firstHeading" class="firstHeading">Uluru</h1>'+
'<div id="bodyContent">'+
'<p><b>Uluru</b>, also referred to as <b>Ayers Rock</b>, is a large ' +
'sandstone rock formation in the southern part of the '+
'Northern Territory, central Australia. It lies 335 km (208 mi) '+
'south west of the nearest large town, Alice Springs; 450 km '+
'(280 mi) by road. Kata Tjuta and Uluru are the two major '+
'features of the Uluru - Kata Tjuta National Park. Uluru is '+
'sacred to the Pitjantjatjara and Yankunytjatjara, the '+
'Aboriginal people of the area. It has many springs, waterholes, '+
'rock caves and ancient paintings. Uluru is listed as a World '+
'Heritage Site.</p>'+
'<p>Attribution: Uluru, <a href="http://en.wikipedia.org/w/index.ph…
'</a>http://en.wikipedia.org/w/index.php?title=Uluru</a> '+
'(last visited June 22, 2009).</p>'+
'</div>'+
'</div>';
function placeMarker(location) {
var marker = new google.maps.Marker({
position: location,
map: map,
title: 'Uluru (Ayers Rock)'
});
var infowindow = new google.maps.InfoWindow({
minWidth:800,
content: contentstring //'Latitude: ' + location.lat() + '<br>Longitude: ' + location.lng()
});
infowindow.open(map,marker);
//deleting a marker on right click...................................…
google.maps.event.addListener(marker, 'rightclick', function(event) {
marker.setMap(null);
});
markers.push(marker);
}

google.maps.event.addDomListener(windo… 'load', initialize);
.
.
.
.
.

</script>
the contentString is just a demo part. i want to display an image in the first div in contentString from the database. can anyone tell me what can i do to make it right.....

1 answer

0 votes

How is any of this relevant to the Atlassian product stack? You may want to try stackoverflow.com instead.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Off-topic

Don't F&*% the planet.

Over the weekend, Atlassian ran a New York Times ad calling on business leaders to join us in committing to a net zero future through the Science-Based Targets Initiative. As part of our gl...

1,638 views 10 55
Read article

Atlassian Community Events