diff --git a/build/build.py b/build/build.py
index 0ca2a74a0e..da539a29ab 100755
--- a/build/build.py
+++ b/build/build.py
@@ -60,6 +60,15 @@ def build(config_file = None, output_file = None, options = None):
print "\nAbnormal termination."
sys.exit("ERROR: %s" % E)
+ if options.amdname:
+ options.amdname = "'" + options.amdname + "',"
+ else:
+ options.amdname = ""
+
+ if options.amd == 'pre':
+ print "\nAdding AMD function."
+ merged = "define(%sfunction(){%sreturn OpenLayers;});" % (options.amdname, merged)
+
print "Compressing using %s" % use_compressor
if use_compressor == "jsmin":
minimized = jsmin.jsmin(merged)
@@ -101,6 +110,14 @@ def build(config_file = None, output_file = None, options = None):
else: # fallback
minimized = merged
+ if options.amd == 'post':
+ print "\nAdding AMD function."
+ minimized = "define(%sfunction(){%sreturn OpenLayers;});" % (options.amdname, minimized)
+
+ if options.status:
+ print "\nAdding status file."
+ minimized = "// status: " + file(options.status).read() + minimized
+
print "\nAdding license file."
minimized = file("license.txt").read() + minimized
@@ -111,7 +128,10 @@ def build(config_file = None, output_file = None, options = None):
if __name__ == '__main__':
opt = optparse.OptionParser(usage="%s [options] [config_file] [output_file]\n Default config_file is 'full.cfg', Default output_file is 'OpenLayers.js'")
- opt.add_option("-c", "--compressor", dest="compressor", help="compression method: one of 'jsmin', 'minimize', 'closure_ws', 'closure', or 'none'", default="jsmin")
+ opt.add_option("-c", "--compressor", dest="compressor", help="compression method: one of 'jsmin' (default), 'minimize', 'closure_ws', 'closure', or 'none'", default="jsmin")
+ opt.add_option("-s", "--status", dest="status", help="name of a file whose contents will be added as a comment at the front of the output file. For example, when building from a git repo, you can save the output of 'git describe --tags' in this file. Default is no file.", default=False)
+ opt.add_option("--amd", dest="amd", help="output should be AMD module; wrap merged files in define function; can be either 'pre' (before compilation) or 'post' (after compilation). Wrapping the OpenLayers var in a function means the filesize can be reduced by the closure compiler using 'pre', but be aware that a few functions depend on the OpenLayers variable being present. Either option can be used with jsmin or minimize compression. Default false, not AMD.", default=False)
+ opt.add_option("--amdname", dest="amdname", help="only useful with amd option. Name of AMD module. Default no name, anonymous module.", default=False)
(options, args) = opt.parse_args()
if not len(args):
build(options=options)
diff --git a/examples/fullScreen.js b/examples/fullScreen.js
index dc8ed19d1a..754cabfadd 100644
--- a/examples/fullScreen.js
+++ b/examples/fullScreen.js
@@ -8,10 +8,12 @@ var map = new OpenLayers.Map({
div: "map",
layers: [
new OpenLayers.Layer.XYZ("OSM (with buffer)", urls, {
- transitionEffect: "resize", buffer: 2, sphericalMercator: true
+ transitionEffect: "resize", buffer: 2, sphericalMercator: true,
+ attribution: "Data CC-By-SA by OpenStreetMap"
}),
new OpenLayers.Layer.XYZ("OSM (without buffer)", urls, {
- transitionEffect: "resize", buffer: 0, sphericalMercator: true
+ transitionEffect: "resize", buffer: 0, sphericalMercator: true,
+ attribution: "Data CC-By-SA by OpenStreetMap"
})
],
controls: [
diff --git a/examples/kml-pointtrack.js b/examples/kml-pointtrack.js
index 47836f25fd..7d48ce360f 100644
--- a/examples/kml-pointtrack.js
+++ b/examples/kml-pointtrack.js
@@ -29,12 +29,13 @@ function init() {
var fid, points = [], feature;
for (var i=0, len=e.features.length; iMapQuest
",
+ attribution: "Data, imagery and map information provided by MapQuest, Open Street Map and contributors, CC-BY-SA
",
transitionEffect: "resize"
}
),
@@ -24,7 +24,7 @@ var map = new OpenLayers.Map({
"http://oatile4.mqcdn.com/naip/${z}/${x}/${y}.png"
],
{
- attribution: "Tiles Courtesy of MapQuest
",
+ attribution: "Tiles Courtesy of MapQuest. Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency.
",
transitionEffect: "resize"
}
)
@@ -33,4 +33,4 @@ var map = new OpenLayers.Map({
zoom: 1
});
-map.addControl(new OpenLayers.Control.LayerSwitcher());
\ No newline at end of file
+map.addControl(new OpenLayers.Control.LayerSwitcher());
diff --git a/examples/mobile-drawing.html b/examples/mobile-drawing.html
index 6a91152b89..0cb9c529f1 100644
--- a/examples/mobile-drawing.html
+++ b/examples/mobile-drawing.html
@@ -5,7 +5,7 @@
-
+
diff --git a/examples/mobile-jq.html b/examples/mobile-jq.html
index 470fd39d5d..5e16caaa68 100644
--- a/examples/mobile-jq.html
+++ b/examples/mobile-jq.html
@@ -8,7 +8,7 @@
-
+
diff --git a/examples/mobile-layers.html b/examples/mobile-layers.html
index dcb27645f9..d25867477a 100644
--- a/examples/mobile-layers.html
+++ b/examples/mobile-layers.html
@@ -5,7 +5,7 @@
-
+
+ image/png
+
+ Time
+ 20090101
+ 20090101
+
+
+ 21781
+
+
+
+
+ 21781
+ urn:ogc:def:crs:EPSG::21781
+
+ 0
+ 14285750.5715
+ 420000.0 350000.0
+ 256
+ 256
+ 1
+ 1
+
+
+ 8
+ 7142875.28575
+ 420000.0 350000.0
+ 256
+ 256
+ 1
+ 1
+
+
+ 12
+ 3571437.64288
+ 420000.0 350000.0
+ 256
+ 256
+ 2
+ 2
+
+
+
+
+
+-->
+
+
+
+
+