javascript - Is it possible to use an single image from an array of images in an Maps InfoWindow? -
i have following functions specify , deliver output of array of images retrieved library database through api (initially given addresses in json format).
function processimages(index, troveitem){ for(var in availableimages){ if(troveitem.identifier[0].value.indexof(availableimages[i].url_pattern) >= 0){ console.log("trove url "+troveitem.identifier[0].value+" pattern: "+availableimages[i]["url_pattern"]); availableimages[i].numimages++; availableimages.totalimages++; availableimages[i]["images"].push(troveitem.identifier[0].value); } } } //// function printimages(){ $("#output").append("<h3>image search results</h3>"); for(var in availableimages){ if(availableimages[i]["url_pattern"]=="nla.gov.au" && availableimages[i]["numimages"]>0){ printnlaimages(); } } ///// function printnlaimages(){ $("#output").append("<h3>national library of australia</h3><p>" +availableimages["nla"]["numimages"]+" images found <a href='http://" +availableimages["nla"]["url_pattern"]+"'>" +availableimages["nla"]["url_pattern"]+"</a></p>"); (var in availableimages["nla"]["images"]){ $("#output").append("<img src='"+availableimages["nla"]["images"][i]+"-v'>"); } }
now outputs <div>
id "output".
there way can make first array item of these images a? variable? or can use within <img>
tag of google maps api infowindow content string?
possible, , best way go if so?
Comments
Post a Comment