To get started with the Panoramio wrapper class simply clone the project from github:
git clone: https://github.com/anthony-mills/Panoramio.git
The layout of the github project is fairly straight forward with the main class being in Code/Panoramio.php. An example is also included in the code folder to give a very basic example of how to get started straight away with a minimum of options. The Docs folder contains automatically generated documentation of the class, its methods and their parameters.
Simply include the class in your code instantiate and then pass some parameters about your search:
<?php require_once('Code/Panoramio.php'); $panoramioClass = new panoramioAPI(); $panoramioClass->setRequiredLocation(-37.85676, 144.98249); $areaImages = $panoramioClass->getPanoramioImages(); ?>
The code above will return images local to St Kilda in Melbourne as I passed the coordinates for the suburb to the setRequiredLocation method. Some other useful methods are:
- setPanoramioSize – Set the size of the images returned.
- orderImages – Organise how images are returned, default is their upload date.
- getPanoramioImages – Actually get a set of images from the API. Pass a number as the parameter to limit the images returned.
The Panoramio wrapper class is open source and is free to be used, modified and redistributed under a GPL v3 licence.
Panoramio requires all images are required to display Panoramio’s name and logo. Please see their site for the full list of attribution requirements when using the class to pull images from their service.