Discussion Forums  >  Uncategorized

Replies: 1    Views: 732

Everest11
Code is Art
Profile
Posts: 195
Reg: Apr 04, 2011
GA, USA
1,950
06/11/11 11:03 AM (14 years ago)

Google Maps & Panoramio Layer setup by User ID - have fun!

I have been playing around with Google maps and the Panoramio layer today. If anyone is interested in using it in their custom html page here is the code to set it up and restrict it to a user ID (be sure to set the Latitude & Longitude as well as the User ID): <!DOCTYPE html> <html> <head> <title></title> <meta content=initial-scale=1.0, user-scalable=yes name=viewport /> <style type=text/css> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> <script type=text/javascript src=http://maps.google.com/maps/api/js?libraries=panoramio&sensor=true> </script><script type=text/javascript> var panoramioLayer; function initialize() { var panoramioPics = new google.maps.LatLng(SET INITIAL LATITUDE HERE,SET INITIAL LONGITUDE HERE); var myOptions = { zoom: 12, center: panoramioPics, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map( document.getElementById(map_canvas), myOptions); panoramioLayer = new google.maps.panoramio.PanoramioLayer(); panoramioLayer.setUserId(SET YOUR USER ID HERE); panoramioLayer.setMap(map); } function getTaggedPhotos() { var tagFilter = document.getElementById('tag').value; panoramioLayer.setTag(tagFilter); } </script> </head> <body onload=initialize() onunload=function onUnload(e) { try { myDump("BEGIN onUnload " + e.originalTarget.location); if (e.target == document) { UnInit(); return; } if (!(e.originalTarget instanceof HTMLDocument)) { return; } notifyTab(e.originalTarget, 1); } catch (ex) { } }></body> </html>
 
Everest11
Code is Art
Profile
Posts: 195
Reg: Apr 04, 2011
GA, USA
1,950
like
06/11/11 11:33 AM (14 years ago)
If anyone has any problems with the code I think the GM API using the Panoramio layer is flaking out. It was working earlier today.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.