var panoramioLayer; function initialize() { var map = new google.maps.Map(document.getElementById("map"), { zoom: 3, center: new google.maps.LatLng(33.8869, 9.5375), mapTypeId: google.maps.MapTypeId.ROADMAP }); panoramioLayer = new google.maps.panoramio.PanoramioLayer(); panoramioLayer.setMap(map); } function getTaggedPhotos() { var tagFilter = document.getElementById('tag').value; panoramioLayer.setTag(tagFilter); }
<html> <head> <title>Google Maps API v3 Example: Panoramio Layer Tag search</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=panoramio"></script> <script type="text/javascript"> </script> </head> <body onload="initialize()"> <div style="height: 30px; width: 530px" align="center"> <input id="tag" type="textbox"> <input type="button" value="Search" onclick="getTaggedPhotos()"> </div> <div id="map" style="height: 200px; width: 530px"></div> </body> </html>