The Astronomy page demonstrates a cross-domain integration. I wanted to have a nice pan/zoom function and automatically build a gallery for some old astronomy images I had. A cross-domain AJAX call was used to:
The web template just needs a few lines of Javascript to perform the call and integrate the results. In this case JSONP was used since the web server and image/REST server are in different physical locations and domains.
This was just a simple example and more effort would be needed in a large scale deployment but it works as a nice example of using multiple servers/services to do what would be hard for each to do alone.
- Scan the desired images directory
- Create thumbnails using the image center and re-sizing / cropping it while maintaining aspect ratio. The thumbnails are cached.
- Any new images added will automatically get thumbnails created and appear in the gallery
- Build the HTML complete with Zoom abilities
- Return that to the caller (across any number of web pages or domains)
The web template just needs a few lines of Javascript to perform the call and integrate the results. In this case JSONP was used since the web server and image/REST server are in different physical locations and domains.
This was just a simple example and more effort would be needed in a large scale deployment but it works as a nice example of using multiple servers/services to do what would be hard for each to do alone.