Permalink
Browse files

Merge branch 'master' of github.com:openlayers/ol3 into vector

  • Loading branch information...
2 parents 4e3f984 + fc9bfe8 commit a7737150fef7b8200049728e59df684f6f68fc1c @tschaub tschaub committed Jan 25, 2013
Showing with 1,692 additions and 569 deletions.
  1. +2 −2 css/ol.css
  2. +6 −6 examples/{overlay-and-popup.html → anchored-elements.html}
  3. +5 −5 examples/{overlay-and-popup.js → anchored-elements.js}
  4. +1 −1 examples/side-by-side.html
  5. +52 −15 examples/side-by-side.js
  6. +1 −1 examples/two-layers.html
  7. +4 −0 examples/two-layers.js
  8. +0 −3 examples/wms-custom-proj.js
  9. +8 −3 readme.md
  10. +62 −33 src/objectliterals.exports
  11. +7 −0 src/ol/anchoredelement.exports
  12. +318 −0 src/ol/anchoredelement.js
  13. +33 −46 src/ol/animation.js
  14. +7 −7 src/ol/control/attributioncontrol.js
  15. +1 −0 src/ol/control/mousepositioncontrol.js
  16. +37 −0 src/ol/easing.js
  17. +4 −3 src/ol/extent.js
  18. +4 −2 src/ol/framestate.js
  19. +12 −0 src/ol/interaction/condition.js
  20. +2 −0 src/ol/map.exports
  21. +109 −32 src/ol/map.js
  22. +1 −0 src/ol/mapbrowserevent.js
  23. +0 −5 src/ol/overlay/overlay.exports
  24. +0 −210 src/ol/overlay/overlay.js
  25. +3 −38 src/ol/renderer/canvas/canvasmaprenderer.js
  26. +6 −2 src/ol/renderer/canvas/canvastilelayerrenderer.js
  27. +1 −0 src/ol/renderer/dom/dommaprenderer.js
  28. +5 −2 src/ol/renderer/dom/domtilelayerrenderer.js
  29. +53 −9 src/ol/renderer/layerrenderer.js
  30. +16 −70 src/ol/renderer/maprenderer.js
  31. +70 −20 src/ol/renderer/webgl/webglmaprenderer.js
  32. +5 −2 src/ol/renderer/webgl/webgltilelayerrenderer.js
  33. +1 −0 src/ol/source/bingmapssource.js
  34. +1 −0 src/ol/source/debugtilesource.exports
  35. +22 −16 src/ol/source/debugtilesource.js
  36. +22 −7 src/ol/source/imagetilesource.js
  37. +1 −1 src/ol/source/source.js
  38. +1 −0 src/ol/source/tiledwmssource.js
  39. +13 −0 src/ol/source/tilesource.js
  40. +486 −0 src/ol/structs/linkedmap.js
  41. +58 −0 src/ol/tilecache.js
  42. +2 −2 src/ol/tilegrid/xyztilegrid.js
  43. +160 −24 src/ol/tilequeue.js
  44. +1 −0 src/ol/tileurlfunction.js
  45. +1 −0 src/ol/view.js
  46. +4 −2 src/ol/view2d.js
  47. +1 −0 test/ol.html
  48. +15 −0 test/spec/ol/extent.test.js
  49. +68 −0 test/spec/ol/tilequeue.test.js
View
@@ -78,8 +78,8 @@
}
}
.ol-zoom-in {
- border-radius: 4px 4px 0 0;
+ border-radius: 2px 2px 0 0;
}
.ol-zoom-out {
- border-radius: 0 0 4px 4px;
+ border-radius: 0 0 2px 2px;
}
@@ -80,7 +80,7 @@
margin-left: -13px;
}
</style>
- <title>Overlay example</title>
+ <title>Anchored elements example</title>
</head>
<body>
<div id="map">
@@ -89,16 +89,16 @@
<!-- Popup -->
<div class="overlay arrow_box" id="popup"></div>
<div id="text">
- <h1 id="title">Overlay example</h1>
- <div id="shortdesc">Demonstrates Overlays.</div>
+ <h1 id="title">Anchored elements example</h1>
+ <div id="shortdesc">Demonstrates anchored elements.</div>
<div id="docs">
<p>See the
- <a href="overlay-and-popup.js" target="_blank">overlay-and-popup.js source</a>
+ <a href="anchored-elements.js" target="_blank">anchored-elements.js source</a>
to see how this is done.</p>
</div>
</div>
</div>
- <div id="tags">overlay, popup, mapquest, openaerial</div>
- <script src="loader.js?id=overlay-and-popup" type="text/javascript"></script>
+ <div id="tags">anchored elements, overlay, popup, mapquest, openaerial</div>
+ <script src="loader.js?id=anchored-elements" type="text/javascript"></script>
</body>
</html>
@@ -1,12 +1,12 @@
goog.require('goog.debug.Console');
goog.require('goog.debug.Logger');
goog.require('goog.debug.Logger.Level');
+goog.require('ol.AnchoredElement');
goog.require('ol.Collection');
goog.require('ol.Coordinate');
goog.require('ol.Map');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
-goog.require('ol.overlay.Overlay');
goog.require('ol.source.MapQuestOpenAerial');
@@ -31,15 +31,15 @@ var map = new ol.Map({
});
// Vienna label
-var vienna = new ol.overlay.Overlay({
+var vienna = new ol.AnchoredElement({
map: map,
- coordinate: ol.Projection.transformWithCodes(
+ position: ol.Projection.transformWithCodes(
new ol.Coordinate(16.3725, 48.208889), 'EPSG:4326', 'EPSG:3857'),
element: document.getElementById('vienna')
});
// Popup showing the position the user clicked
-var popup = new ol.overlay.Overlay({
+var popup = new ol.AnchoredElement({
map: map,
element: document.getElementById('popup')
});
@@ -49,5 +49,5 @@ map.addEventListener('click', function(evt) {
'Welcome to ol3. The location you clicked was<br>' +
ol.Coordinate.toStringHDMS(ol.Projection.transformWithCodes(
coordinate, 'EPSG:3857', 'EPSG:4326'));
- popup.setCoordinate(coordinate);
+ popup.setPosition(coordinate);
});
@@ -45,7 +45,7 @@ <h1 id="title">Side-by-side example</h1>
</tr>
<tr>
<td>Rotate:</td>
- <td><code>Alt</code>+drag, <code>r</code> to reset</td>
+ <td><code>Alt+Shift</code>+drag, <code>r</code> to reset</td>
</tr>
<tr>
<td>Brightness/contrast:</td>
View
@@ -107,45 +107,76 @@ keyboardInteraction.addCallback('H', function() {
layer.setHue(layer.getHue() + (Math.PI / 5));
});
keyboardInteraction.addCallback('j', function() {
- var bounce = ol.animation.createBounce(2 * view.getResolution());
+ var bounce = ol.animation.createBounce({
+ resolution: 2 * view.getResolution()
+ });
domMap.addPreRenderFunction(bounce);
webglMap.addPreRenderFunction(bounce);
canvasMap.addPreRenderFunction(bounce);
});
keyboardInteraction.addCallback('l', function() {
- var panFrom = ol.animation.createPanFrom(view.getCenter());
+ var panFrom = ol.animation.createPanFrom({
+ source: view.getCenter(),
+ easing: ol.easing.elastic
+ });
domMap.addPreRenderFunction(panFrom);
webglMap.addPreRenderFunction(panFrom);
canvasMap.addPreRenderFunction(panFrom);
view.setCenter(LONDON);
});
keyboardInteraction.addCallback('L', function() {
- var start = Date.now();
+ var start = goog.now();
var duration = 5000;
- var bounce = ol.animation.createBounce(
- 2 * view.getResolution(), duration, start);
- var panFrom = ol.animation.createPanFrom(view.getCenter(), duration, start);
- var spin = ol.animation.createSpin(duration, 2, start);
+ var bounce = ol.animation.createBounce({
+ resolution: 2 * view.getResolution(),
+ start: start,
+ duration: duration
+ });
+ var panFrom = ol.animation.createPanFrom({
+ source: view.getCenter(),
+ start: start,
+ duration: duration
+ });
+ var spin = ol.animation.createSpin({
+ turns: 2,
+ start: start,
+ duration: duration
+ });
var preRenderFunctions = [bounce, panFrom, spin];
domMap.addPreRenderFunctions(preRenderFunctions);
webglMap.addPreRenderFunctions(preRenderFunctions);
canvasMap.addPreRenderFunctions(preRenderFunctions);
view.setCenter(LONDON);
});
keyboardInteraction.addCallback('m', function() {
- var panFrom = ol.animation.createPanFrom(view.getCenter(), 1000);
+ var panFrom = ol.animation.createPanFrom({
+ source: view.getCenter(),
+ duration: 1000,
+ easing: ol.easing.bounce
+ });
domMap.addPreRenderFunction(panFrom);
webglMap.addPreRenderFunction(panFrom);
canvasMap.addPreRenderFunction(panFrom);
view.setCenter(MOSCOW);
});
keyboardInteraction.addCallback('M', function() {
- var start = Date.now();
+ var start = goog.now();
var duration = 5000;
- var bounce = ol.animation.createBounce(
- 2 * view.getResolution(), duration, start);
- var panFrom = ol.animation.createPanFrom(view.getCenter(), duration, start);
- var spin = ol.animation.createSpin(duration, -2, start);
+ var bounce = ol.animation.createBounce({
+ resolution: 2 * view.getResolution(),
+ start: start,
+ duration: duration
+ });
+ var panFrom = ol.animation.createPanFrom({
+ source: view.getCenter(),
+ start: start,
+ duration: duration
+ });
+ var spin = ol.animation.createSpin({
+ turns: -2,
+ start: start,
+ duration: duration
+ });
var preRenderFunctions = [bounce, panFrom, spin];
domMap.addPreRenderFunctions(preRenderFunctions);
webglMap.addPreRenderFunctions(preRenderFunctions);
@@ -172,13 +203,19 @@ keyboardInteraction.addCallback('vV', function() {
layer.setVisible(!layer.getVisible());
});
keyboardInteraction.addCallback('x', function() {
- var spin = ol.animation.createSpin(2000, 2);
+ var spin = ol.animation.createSpin({
+ turns: 2,
+ duration: 2000
+ });
domMap.addPreRenderFunction(spin);
webglMap.addPreRenderFunction(spin);
canvasMap.addPreRenderFunction(spin);
});
keyboardInteraction.addCallback('X', function() {
- var spin = ol.animation.createSpin(2000, -2);
+ var spin = ol.animation.createSpin({
+ turns: -2,
+ duration: 2000
+ });
domMap.addPreRenderFunction(spin);
webglMap.addPreRenderFunction(spin);
canvasMap.addPreRenderFunction(spin);
View
@@ -21,7 +21,7 @@ <h1 id="title">Two-layer example</h1>
<tr>
<th>DOM</th>
<th>WebGL</th>
- <th>Canvas</th>
+ <th>Canvas <a id="canvas-export" href="#" download="map.jpeg">export map as jpeg</a></th>
</tr>
<tr>
<td><div id="domMap" class="map"></div></td>
View
@@ -48,3 +48,7 @@ var canvasMap = new ol.Map({
});
canvasMap.bindTo('layers', webglMap);
canvasMap.bindTo('view', webglMap);
+
+goog.events.listen(goog.dom.getElement('canvas-export'), 'click', function(e) {
+ e.target.href = canvasMap.getRenderer().getCanvas().toDataURL('image/jpeg');
+});
@@ -52,9 +52,6 @@ var layers = new ol.Collection([
]);
var map = new ol.Map({
- // By setting userProjection to the same as projection, we do not need
- // proj4js because we do not need any transforms.
- userProjection: epsg21781,
layers: layers,
renderers: ol.RendererHints.createFromQueryData(),
target: 'map',
View
@@ -2,13 +2,18 @@
[![Travis CI Status](https://secure.travis-ci.org/openlayers/ol3.png)](http://travis-ci.org/#!/openlayers/ol3)
-## Build it
-Run make:
+## Hosted Examples
+
+The examples are hosted on GitHub (as GitHub pages). See http://openlayers.github.com/ol3/master/examples/.
+
+## Build OpenLayers 3
+
+Run build.py:
$ ./build.py
-## Run the examples in debug mode
+## Run examples locally
Run the [Plovr](http://plovr.com/) web server with:
View
@@ -1,3 +1,55 @@
+@exportObjectLiteral ol.MapOptions
+@exportObjectLiteralProperty ol.MapOptions.controls ol.Collection|undefined
+@exportObjectLiteralProperty ol.MapOptions.doubleClickZoom boolean|undefined
+@exportObjectLiteralProperty ol.MapOptions.dragPan boolean|undefined
+@exportObjectLiteralProperty ol.MapOptions.interactions ol.Collection|undefined
+@exportObjectLiteralProperty ol.MapOptions.keyboard boolean|undefined
+@exportObjectLiteralProperty ol.MapOptions.keyboardPanOffset number|undefined
+@exportObjectLiteralProperty ol.MapOptions.layers ol.Collection|undefined
+@exportObjectLiteralProperty ol.MapOptions.mouseWheelZoom boolean|undefined
+@exportObjectLiteralProperty ol.MapOptions.mouseWheelZoomDelta number|undefined
+@exportObjectLiteralProperty ol.MapOptions.renderer ol.RendererHint|undefined
+@exportObjectLiteralProperty ol.MapOptions.renderers Array.<ol.RendererHint>|undefined
+@exportObjectLiteralProperty ol.MapOptions.shiftDragZoom boolean|undefined
+@exportObjectLiteralProperty ol.MapOptions.target Element|string
+@exportObjectLiteralProperty ol.MapOptions.view ol.IView|undefined
+@exportObjectLiteralProperty ol.MapOptions.zoomDelta number|undefined
+
+@exportObjectLiteral ol.View2DOptions
+@exportObjectLiteralProperty ol.View2DOptions.center ol.Coordinate|undefined
+@exportObjectLiteralProperty ol.View2DOptions.maxResolution number|undefined
+@exportObjectLiteralProperty ol.View2DOptions.numZoomLevels number|undefined
+@exportObjectLiteralProperty ol.View2DOptions.projection ol.Projection|string|undefined
+@exportObjectLiteralProperty ol.View2DOptions.resolution number|undefined
+@exportObjectLiteralProperty ol.View2DOptions.resolutions Array.<number>|undefined
+@exportObjectLiteralProperty ol.View2DOptions.rotation number|undefined
+@exportObjectLiteralProperty ol.View2DOptions.zoom number|undefined
+@exportObjectLiteralProperty ol.View2DOptions.zoomFactor number|undefined
+
+@exportObjectLiteral ol.animation.BounceOptions
+@exportObjectLiteralProperty ol.animation.BounceOptions.resolution number
+@exportObjectLiteralProperty ol.animation.BounceOptions.start number|undefined
+@exportObjectLiteralProperty ol.animation.BounceOptions.duration number|undefined
+@exportObjectLiteralProperty ol.animation.BounceOptions.easing function(number):number|undefined
+
+@exportObjectLiteral ol.animation.PanFromOptions
+@exportObjectLiteralProperty ol.animation.PanFromOptions.source ol.Coordinate
+@exportObjectLiteralProperty ol.animation.PanFromOptions.start number|undefined
+@exportObjectLiteralProperty ol.animation.PanFromOptions.duration number|undefined
+@exportObjectLiteralProperty ol.animation.PanFromOptions.easing function(number):number|undefined
+
+@exportObjectLiteral ol.animation.SpinOptions
+@exportObjectLiteralProperty ol.animation.SpinOptions.turns number
+@exportObjectLiteralProperty ol.animation.SpinOptions.start number|undefined
+@exportObjectLiteralProperty ol.animation.SpinOptions.duration number|undefined
+@exportObjectLiteralProperty ol.animation.SpinOptions.easing function(number):number|undefined
+
+@exportObjectLiteral ol.animation.ZoomFromOptions
+@exportObjectLiteralProperty ol.animation.ZoomFromOptions.resolution number
+@exportObjectLiteralProperty ol.animation.ZoomFromOptions.start number|undefined
+@exportObjectLiteralProperty ol.animation.ZoomFromOptions.duration number|undefined
+@exportObjectLiteralProperty ol.animation.ZoomFromOptions.easing function(number):number|undefined
+
@exportObjectLiteral ol.control.AttributionOptions
@exportObjectLiteralProperty ol.control.AttributionOptions.map ol.Map|undefined
@exportObjectLiteralProperty ol.control.AttributionOptions.target Element|undefined
@@ -23,34 +75,22 @@
@exportObjectLiteralProperty ol.layer.LayerOptions.source ol.source.Source
@exportObjectLiteralProperty ol.layer.LayerOptions.visible boolean|undefined
-@exportObjectLiteral ol.MapOptions
-@exportObjectLiteralProperty ol.MapOptions.controls ol.Collection|undefined
-@exportObjectLiteralProperty ol.MapOptions.doubleClickZoom boolean|undefined
-@exportObjectLiteralProperty ol.MapOptions.dragPan boolean|undefined
-@exportObjectLiteralProperty ol.MapOptions.interactions ol.Collection|undefined
-@exportObjectLiteralProperty ol.MapOptions.keyboard boolean|undefined
-@exportObjectLiteralProperty ol.MapOptions.keyboardPanOffset number|undefined
-@exportObjectLiteralProperty ol.MapOptions.layers ol.Collection|undefined
-@exportObjectLiteralProperty ol.MapOptions.mouseWheelZoom boolean|undefined
-@exportObjectLiteralProperty ol.MapOptions.mouseWheelZoomDelta number|undefined
-@exportObjectLiteralProperty ol.MapOptions.renderer ol.RendererHint|undefined
-@exportObjectLiteralProperty ol.MapOptions.renderers Array.<ol.RendererHint>|undefined
-@exportObjectLiteralProperty ol.MapOptions.shiftDragZoom boolean|undefined
-@exportObjectLiteralProperty ol.MapOptions.target Element|string
-@exportObjectLiteralProperty ol.MapOptions.view ol.IView|undefined
-@exportObjectLiteralProperty ol.MapOptions.zoomDelta number|undefined
-
-@exportObjectLiteral ol.overlay.OverlayOptions
-@exportObjectLiteralProperty ol.overlay.OverlayOptions.coordinate ol.Coordinate|undefined
-@exportObjectLiteralProperty ol.overlay.OverlayOptions.element Element|undefined
-@exportObjectLiteralProperty ol.overlay.OverlayOptions.map ol.Map|undefined
-@exportObjectLiteralProperty ol.overlay.OverlayOptions.positioning Array.<string>|undefined
+@exportObjectLiteral ol.AnchoredElementOptions
+@exportObjectLiteralProperty ol.AnchoredElementOptions.element Element|undefined
+@exportObjectLiteralProperty ol.AnchoredElementOptions.map ol.Map|undefined
+@exportObjectLiteralProperty ol.AnchoredElementOptions.position ol.Coordinate|undefined
+@exportObjectLiteralProperty ol.AnchoredElementOptions.positioning ol.AnchoredElementPositioning|undefined
@exportObjectLiteral ol.source.BingMapsOptions
@exportObjectLiteralProperty ol.source.BingMapsOptions.culture string|undefined
@exportObjectLiteralProperty ol.source.BingMapsOptions.key string
@exportObjectLiteralProperty ol.source.BingMapsOptions.style ol.BingMapsStyle
+@exportObjectLiteral ol.source.DebugTileSourceOptions
+@exportObjectLiteralProperty ol.source.DebugTileSourceOptions.extent ol.Extent|undefined
+@exportObjectLiteralProperty ol.source.DebugTileSourceOptions.projection ol.Projection|undefined
+@exportObjectLiteralProperty ol.source.DebugTileSourceOptions.tileGrid ol.tilegrid.TileGrid|undefined
+
@exportObjectLiteral ol.source.StamenOptions
@exportObjectLiteralProperty ol.source.StamenOptions.flavor string|undefined
@exportObjectLiteralProperty ol.source.StamenOptions.provider string
@@ -76,14 +116,3 @@
@exportObjectLiteral ol.tilegrid.XYZOptions
@exportObjectLiteralProperty ol.tilegrid.XYZOptions.maxZoom number
-
-@exportObjectLiteral ol.View2DOptions
-@exportObjectLiteralProperty ol.View2DOptions.center ol.Coordinate|undefined
-@exportObjectLiteralProperty ol.View2DOptions.maxResolution number|undefined
-@exportObjectLiteralProperty ol.View2DOptions.numZoomLevels number|undefined
-@exportObjectLiteralProperty ol.View2DOptions.projection ol.Projection|string|undefined
-@exportObjectLiteralProperty ol.View2DOptions.resolution number|undefined
-@exportObjectLiteralProperty ol.View2DOptions.resolutions Array.<number>|undefined
-@exportObjectLiteralProperty ol.View2DOptions.rotation number|undefined
-@exportObjectLiteralProperty ol.View2DOptions.zoom number|undefined
-@exportObjectLiteralProperty ol.View2DOptions.zoomFactor number|undefined
@@ -0,0 +1,7 @@
+@exportClass ol.AnchoredElement ol.AnchoredElementOptions
+
+@exportSymbol ol.AnchoredElementPositioning
+@exportProperty ol.AnchoredElementPositioning.BOTTOM_LEFT
+@exportProperty ol.AnchoredElementPositioning.BOTTOM_RIGHT
+@exportProperty ol.AnchoredElementPositioning.TOP_LEFT
+@exportProperty ol.AnchoredElementPositioning.TOP_RIGHT
Oops, something went wrong.

0 comments on commit a773715

Please sign in to comment.