Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/openlayers/openlayers
Browse files Browse the repository at this point in the history
Conflicts:
	tests/list-tests.html
  • Loading branch information
marcjansen committed Aug 17, 2012
2 parents b86394b + f6adcd2 commit df19317
Show file tree
Hide file tree
Showing 78 changed files with 1,733 additions and 315 deletions.
22 changes: 21 additions & 1 deletion build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions examples/fullScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
}),
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 <a href='http://openstreetmap.org/'>OpenStreetMap</a>"
})
],
controls: [
Expand Down
7 changes: 4 additions & 3 deletions examples/kml-pointtrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ function init() {
var fid, points = [], feature;
for (var i=0, len=e.features.length; i<len; i++) {
feature = e.features[i];
if (feature.fid !== fid || i === len-1) {
fid = feature.fid;
if ((fid && feature.fid !== fid) || i === len-1) {
this.addNodes(points, {silent: true});
points = [];
} else {
points.push(feature);
}
points.push(feature);
fid = feature.fid;
}
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions examples/mapquest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var map = new OpenLayers.Map({
"http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png"
],
{
attribution: "Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
attribution: "Data, imagery and map information provided by <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a>, <a href='http://www.openstreetmap.org/' target='_blank'>Open Street Map</a> and contributors, <a href='http://creativecommons.org/licenses/by-sa/2.0/' target='_blank'>CC-BY-SA</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
transitionEffect: "resize"
}
),
Expand All @@ -24,7 +24,7 @@ var map = new OpenLayers.Map({
"http://oatile4.mqcdn.com/naip/${z}/${x}/${y}.png"
],
{
attribution: "Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
attribution: "Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a>. Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency. <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
transitionEffect: "resize"
}
)
Expand All @@ -33,4 +33,4 @@ var map = new OpenLayers.Map({
zoom: 1
});

map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.LayerSwitcher());
2 changes: 1 addition & 1 deletion examples/mobile-drawing.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="style.mobile.css" type="text/css">
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
<script src="../lib/OpenLayers.js?mobile"></script>
<script src="mobile-drawing.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/mobile-jq.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css">
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
<link rel="stylesheet" href="style.mobile.css" type="text/css">
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
<link rel="stylesheet" href="style.mobile-jq.css" type="text/css">
<script src="../lib/OpenLayers.js?mobile"></script>
<script src="mobile-base.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/mobile-layers.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="style.mobile.css" type="text/css">
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
<script src="../lib/OpenLayers.js?mobile"></script>
<script src="mobile-layers.js"></script>
<style>
Expand Down
2 changes: 1 addition & 1 deletion examples/mobile-navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Mobile Navigation Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
<link rel="stylesheet" href="style.mobile.css" type="text/css" />
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="../lib/OpenLayers.js?mobile"></script>
<script type="text/javascript" src="mobile-navigation.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/mobile-sencha.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>OpenLayers with Sencha Touch</title>
<script src="../lib/OpenLayers.js?mobile"></script>
<link rel="stylesheet" href="style.mobile.css" type="text/css">
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
<link rel="stylesheet" href="http://cdn.sencha.io/touch/1.1.0/resources/css/sencha-touch.css">
<script src="http://cdn.sencha.io/touch/1.1.0/sencha-touch.js"></script>
<script src="mobile-sencha.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions examples/mobile-wmts-vienna.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ var map;
var doc = request.responseText,
caps = format.read(doc);
fmzk = format.createLayer(caps, OpenLayers.Util.applyDefaults(
{layer:"fmzk", requestEncoding:"REST", transitionEffect:"resize"}, defaults
{layer:"fmzk", transitionEffect:"resize"}, defaults
));
aerial = format.createLayer(caps, OpenLayers.Util.applyDefaults(
{layer:"lb", requestEncoding:"REST", transitionEffect:"resize"}, defaults
{layer:"lb", transitionEffect:"resize"}, defaults
));
labels = format.createLayer(caps, OpenLayers.Util.applyDefaults(
{layer:"beschriftung", requestEncoding:"REST", className:"nofade", isBaseLayer: false},
{layer:"beschriftung", className:"nofade", isBaseLayer: false},
defaults
));
map.addLayers([fmzk, aerial, labels]);
Expand Down
2 changes: 1 addition & 1 deletion examples/mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="style.mobile.css" type="text/css">
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
<script src="../lib/OpenLayers.js?mobile"></script>
<script src="mobile.js"></script>
<style>
Expand Down
32 changes: 32 additions & 0 deletions examples/osm-marker-popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers OSM and Google Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
<script src="../lib/OpenLayers.js"></script>
<script src="osm-marker-popup.js"></script>
</head>
<body onload="init()">
<h1 id="title">OSM with Marker and Popup</h1>
<p id="shortdesc">
Demonstrate use of an OSM layer with a marker and a popup.
</p>
<div id="tags">
openstreetmap osm marker popup
</div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
A common use case for OpenLayers is to display a marker at a
location on the map, and add some information in a popup. It
is also easy to add a tooltip with a short description.
See the <a href="osm-marker-popup.js" target="_blank">
osm-marker-popup.js source</a> to see how this is done.
</p>
</div>
</body>
</html>
39 changes: 39 additions & 0 deletions examples/osm-marker-popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
var map;
function init() {

// The overlay layer for our marker, with a simple diamond as symbol
var overlay = new OpenLayers.Layer.Vector('Overlay', {
styleMap: new OpenLayers.StyleMap({
externalGraphic: '../img/marker.png',
graphicWidth: 20, graphicHeight: 24, graphicYOffset: -24,
title: '${tooltip}'
})
});

// The location of our marker and popup. We usually think in geographic
// coordinates ('EPSG:4326'), but the map is projected ('EPSG:3857').
var myLocation = new OpenLayers.Geometry.Point(10.2, 48.9)
.transform('EPSG:4326', 'EPSG:3857');

// We add the marker with a tooltip text to the overlay
overlay.addFeatures([
new OpenLayers.Feature.Vector(myLocation, {tooltip: 'OpenLayers'})
]);

// A popup with some information about our location
var popup = new OpenLayers.Popup.FramedCloud("Popup",
myLocation.getBounds().getCenterLonLat(), null,
'<a target="_blank" href="http://openlayers.org/">We</a> ' +
'could be here.<br>Or elsewhere.', null,
true // <-- true if we want a close (X) button, false otherwise
);

// Finally we create the map
map = new OpenLayers.Map({
div: "map", projection: "EPSG:3857",
layers: [new OpenLayers.Layer.OSM(), overlay],
center: myLocation.getBounds().getCenterLonLat(), zoom: 15
});
// and add the popup to it.
map.addPopup(popup);
}
6 changes: 2 additions & 4 deletions examples/strategy-cluster-threshold.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@
function init() {
map = new OpenLayers.Map('map');
var base = new OpenLayers.Layer.WMS("OpenLayers WMS",
["http://t3.tilecache.osgeo.org/wms-c/Basic.py",
"http://t2.tilecache.osgeo.org/wms-c/Basic.py",
"http://t1.tilecache.osgeo.org/wms-c/Basic.py"],
{layers: 'satellite'}
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: 'basic'}
);

var style = new OpenLayers.Style({
Expand Down
3 changes: 2 additions & 1 deletion examples/wfs-states.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ <h1 id="title">WFS United States (GeoServer) Example</h1>
<div id="docs">
<p>
This example shows the basic use of a vector layer with the
WFS protocol.
WFS protocol, and shows how to switch between a WMS and a vector
layer at a certain scale.
</p>
<p>
See the <a href="wfs-states.js" target="_blank">wfs-states.js
Expand Down
6 changes: 6 additions & 0 deletions examples/wfs-states.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ function init() {
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: "basic"}
),
new OpenLayers.Layer.WMS("States WMS",
"http://demo.opengeo.org/geoserver/wms",
{layers: "topp:states", format: "image/png", transparent: true},
{maxScale: 15000000}
),
new OpenLayers.Layer.Vector("States", {
minScale: 15000000,
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://demo.opengeo.org/geoserver/wfs",
Expand Down
8 changes: 4 additions & 4 deletions examples/wmts-capabilities.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
<h1 id="title">Web Map Tile Service (WMTS) Capabilities Parsing</h1>
<div id="tags">
wmts, capabilities, getcapabilities
</div>
</div>
<p id="shortdesc">
The WMTS Capabilities format allows for parsing of capabilities
documents from OGC Web Map Tile Service (WMTS) version 1.0.0
documents from OGC Web Map Tile Service (WMTS) version 1.0.0
implementations.
</p>

<div id="map" class="smallmap"></div>

<div id="docs">
<p>
This example creates an OpenLayers.Layer.WMTS layer to based
Expand Down
15 changes: 7 additions & 8 deletions examples/wmts-capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ OpenLayers.ProxyHost = "/proxy/?url=";
var map, format;

function init() {

format = new OpenLayers.Format.WMTSCapabilities({
/**
* This particular service is not in compliance with the WMTS spec and
* is providing coordinates in y, x order regardless of the CRS. To
* work around this, we can provide the format a table of CRS URN that
* should be considered y, x order. These will extend the defaults on
* work around this, we can provide the format a table of CRS URN that
* should be considered y, x order. These will extend the defaults on
* the format.
*/
yx: {
Expand Down Expand Up @@ -38,22 +38,21 @@ function init() {
isBaseLayer: false
});
map.addLayer(layer);
},
},
failure: function() {
alert("Trouble getting capabilities doc");
OpenLayers.Console.error.apply(OpenLayers.Console, arguments);
}
});

map = new OpenLayers.Map({
div: "map",
projection: "EPSG:900913"
});
});

var osm = new OpenLayers.Layer.OSM();

map.addLayer(osm);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(-13677832, 5213272), 13);

}
3 changes: 2 additions & 1 deletion lib/OpenLayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
jsFiles = [
"OpenLayers/BaseTypes/Class.js",
"OpenLayers/Util.js",
"OpenLayers/Util/vendorPrefix.js",
"OpenLayers/Animation.js",
"OpenLayers/BaseTypes.js",
"OpenLayers/BaseTypes/Bounds.js",
Expand Down Expand Up @@ -414,4 +415,4 @@
/**
* Constant: VERSION_NUMBER
*/
OpenLayers.VERSION_NUMBER="Release 2.12-rc5";
OpenLayers.VERSION_NUMBER="Release 2.13 dev";
14 changes: 4 additions & 10 deletions lib/OpenLayers/Animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* full text of the license.
*
* @requires OpenLayers/SingleFile.js
* @requires OpenLayers/Util/vendorPrefix.js
*/

/**
Expand All @@ -19,11 +20,8 @@ OpenLayers.Animation = (function(window) {
* Property: isNative
* {Boolean} true if a native requestAnimationFrame function is available
*/
var isNative = !!(window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame);
var requestAnimationFrame = OpenLayers.Util.vendorPrefix.js(window, "requestAnimationFrame");
var isNative = !!(requestAnimationFrame);

/**
* Function: requestFrame
Expand All @@ -36,11 +34,7 @@ OpenLayers.Animation = (function(window) {
* element - {DOMElement} Optional element that visually bounds the animation.
*/
var requestFrame = (function() {
var request = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
var request = window[requestAnimationFrame] ||
function(callback, element) {
window.setTimeout(callback, 16);
};
Expand Down
Loading

0 comments on commit df19317

Please sign in to comment.