Permalink
Browse files

Merge branch 'master' of github.com:crschmidt/oam

  • Loading branch information...
2 parents df7ae49 + deb803f commit 09a89c1efeceb934342fdcc71e943469fec73d13 Schuyler Erle committed Oct 16, 2010
@@ -0,0 +1,4 @@
+Name: OL Boxes
+Description: A simple app showing coverage of OAM images.
+URL: http://crschmidt.net/dl/olboxes/
+License: Public Domain
@@ -0,0 +1,52 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>OAM: Boxes</title>
+ <link rel="stylesheet" href="http://openlayers.org/api/theme/default/style.css" type="text/css" />
+ <script src="http://openlayers.org/api/OpenLayers.js"></script>
+ <script type="text/javascript">
+ var map, layer;
+ var OAMFormat = OpenLayers.Class(OpenLayers.Format.JSON, {
+ 'read': function(json,filter) {
+ if (typeof json == "string") {
+ obj = OpenLayers.Format.JSON.prototype.read.apply(this,
+ [json, filter]);
+ } else {
+ obj = json;
+ }
+ if(!obj) {
+ OpenLayers.Console.error("Bad JSON: " + json);
+ }
+ var features = [];
+ for (i = 0; i < obj.images.length; i++) {
+ var image = obj.images[i];
+ var bounds = OpenLayers.Bounds.fromArray(image.bbox);
+ var f = new OpenLayers.Feature.Vector(bounds.toGeometry());
+ features.push(f);
+ }
+ return features;
+ }
+ });
+
+ function init(){
+
+ map = new OpenLayers.Map( 'map' );
+ layer = new OpenLayers.Layer.OSM("OSM");
+ map.addLayer(layer);
+ layer = new OpenLayers.Layer.Vector("", {
+ strategies: [new OpenLayers.Strategy.Fixed()],
+ protocol: new OpenLayers.Protocol.HTTP({
+ url: "http://oam.osgeo.org/api/image/?archive=1",
+ format: new OAMFormat()
+ })});
+ map.addLayer(layer);
+ layer.events.register("loadend", layer, function() {
+ layer.map.zoomToExtent(layer.getDataExtent())
+ });
+ map.zoomToMaxExtent();
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <div id="map" class="smallmap" style="width:100%; height: 100%"></div>
+ </body>
+</html>
View
@@ -7,16 +7,16 @@ clearinghouse for the OpenAerialMap imagery data.
The core object in the imagery index is an :ref:`image`. There are two types
of images -- an Archive image, and a Processed image.
- * Archive Image: This is designed to be metadata about a file which
- has not been processed for OAM, but which could be processed either by
- tools or by a human. This might mean that the imagery is only available
- in a compressed format, or is in an unusual projection. Generally
- speaking, this is the case for imagery provided over the web by
- most government agencies.
-
- * Processed Image: A processed image is an image which has been specifically
- created for OAM, or fits the needs of an OAM client well. For more details,
- see :ref:`optimized`.
+* Archive Image: This is designed to be metadata about a file which
+ has not been processed for OAM, but which could be processed either by
+ tools or by a human. This might mean that the imagery is only available
+ in a compressed format, or is in an unusual projection. Generally
+ speaking, this is the case for imagery provided over the web by
+ most government agencies.
+
+* Processed Image: A processed image is an image which has been specifically
+ created for OAM, or fits the needs of an OAM client well. For more details,
+ see :ref:`optimized`.
The default for images which are uploaded to OpenAerialMap is to be archive
images. To change this, set the archive flag of the image to False when
@@ -135,4 +135,6 @@ def json_response(request, obj):
elif request.GET.has_key('handler'):
data = "%s(%s);" % (request.GET['handler'], data)
- return HttpResponse(data)
+ r = HttpResponse(data)
+ r['Access-Control-Allow-Origin'] = "*"
+ return r

0 comments on commit 09a89c1

Please sign in to comment.