Permalink
Browse files

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

  • Loading branch information...
2 parents b247031 + 7126d63 commit 5a73529da559ff0e44bf9506bdd00701f3b53c0b @tschaub tschaub committed Mar 3, 2013
Showing with 746 additions and 327 deletions.
  1. +5 −1 bin/generate-exports.py
  2. +8 −5 css/ol.css
  3. +3 −3 examples/anchored-elements.js
  4. +3 −3 examples/canvas-tiles.js
  5. +47 −0 examples/epsg-4326.html
  6. +56 −0 examples/epsg-4326.js
  7. +6 −6 examples/side-by-side.js
  8. +2 −2 examples/two-layers.js
  9. +2 −1 examples/wms-custom-proj.js
  10. +1 −1 examples/wms.js
  11. +6 −0 externs/proj4js.js
  12. +0 −1 src/objectliterals.exports
  13. +4 −3 src/ol/control/mousepositioncontrol.js
  14. +2 −2 src/ol/control/zoomcontrol.js
  15. +3 −2 src/ol/geolocation.js
  16. +6 −6 src/ol/imageurlfunction.js
  17. +5 −0 src/ol/map.js
  18. +57 −0 src/ol/math.js
  19. +4 −3 src/ol/parser/ogc/wmtscapabilities_v1_0_0.js
  20. +8 −6 src/ol/projection.exports
  21. +81 −207 src/ol/projection.js
  22. +23 −0 src/ol/projection/common.js
  23. +98 −0 src/ol/projection/epsg3857.js
  24. +43 −0 src/ol/projection/epsg4326.js
  25. +4 −4 src/ol/source/bingmapssource.js
  26. +5 −3 src/ol/source/singleimagewmssource.js
  27. +7 −4 src/ol/source/tiledwmssource.js
  28. +4 −4 src/ol/source/tilejsonsource.js
  29. +2 −1 src/ol/source/xyzsource.js
  30. +5 −5 src/ol/tilegrid/xyztilegrid.js
  31. +7 −6 src/ol/tileurlfunction.js
  32. +3 −2 src/ol/view2d.js
  33. +2 −2 test/spec/ol/extent.test.js
  34. +10 −8 test/spec/ol/layer/layer.test.js
  35. +134 −0 test/spec/ol/math.test.js
  36. +30 −29 test/spec/ol/projection.test.js
  37. +3 −3 test/spec/ol/source/tilesource.test.js
  38. +4 −3 test/spec/ol/tilegrid.test.js
  39. +13 −1 test/spec/ol/tileurlfunction.test.js
  40. +40 −0 test/spec/ol/xyztilegrid.test.js
@@ -203,7 +203,11 @@ def main(argv):
symbol = Symbol(name, True, export_as)
objects[name] = symbol
if not export_as:
- requires.add(name)
+ components = m.group('name').split('.')
+ if re.match(r'[A-Z]', components[-1]):
+ requires.add(name)
+ else:
+ requires.add('.'.join(components[:-1]))
continue
raise RuntimeError(line)
View
@@ -63,14 +63,17 @@
.ol-zoom a:hover {
background: rgba(0,60,136,0.7);
}
-@media only screen and (max-width:600px) {
- .ol-zoom a:hover {
- background: rgba(0,60,136,0.5);
- }
-}
+
.ol-zoom-in {
border-radius: 2px 2px 0 0;
}
+.ol-zoom-in:before {
+ content: "+";
+}
+
.ol-zoom-out {
border-radius: 0 0 2px 2px;
}
+.ol-zoom-out:before {
+ content: "\2212";
+}
@@ -5,10 +5,10 @@ goog.require('ol.AnchoredElement');
goog.require('ol.Collection');
goog.require('ol.Coordinate');
goog.require('ol.Map');
-goog.require('ol.Projection');
goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.layer.TileLayer');
+goog.require('ol.projection');
goog.require('ol.source.MapQuestOpenAerial');
@@ -35,7 +35,7 @@ var map = new ol.Map({
// Vienna label
var vienna = new ol.AnchoredElement({
map: map,
- position: ol.Projection.transformWithCodes(
+ position: ol.projection.transformWithCodes(
new ol.Coordinate(16.3725, 48.208889), 'EPSG:4326', 'EPSG:3857'),
element: document.getElementById('vienna')
});
@@ -49,7 +49,7 @@ map.addEventListener('click', function(evt) {
var coordinate = evt.getCoordinate();
popup.getElement().innerHTML =
'Welcome to ol3. The location you clicked was<br>' +
- ol.Coordinate.toStringHDMS(ol.Projection.transformWithCodes(
+ ol.Coordinate.toStringHDMS(ol.projection.transformWithCodes(
coordinate, 'EPSG:3857', 'EPSG:4326'));
popup.setPosition(coordinate);
});
@@ -1,10 +1,10 @@
goog.require('ol.Collection');
goog.require('ol.Coordinate');
goog.require('ol.Map');
-goog.require('ol.Projection');
goog.require('ol.RendererHint');
goog.require('ol.View2D');
goog.require('ol.layer.TileLayer');
+goog.require('ol.projection');
goog.require('ol.source.DebugTileSource');
goog.require('ol.source.OpenStreetMap');
goog.require('ol.tilegrid.XYZ');
@@ -16,7 +16,7 @@ var layers = new ol.Collection([
}),
new ol.layer.TileLayer({
source: new ol.source.DebugTileSource({
- projection: ol.Projection.getFromCode('EPSG:3857'),
+ projection: ol.projection.getFromCode('EPSG:3857'),
tileGrid: new ol.tilegrid.XYZ({
maxZoom: 22
})
@@ -26,7 +26,7 @@ var layers = new ol.Collection([
var webglMap = new ol.Map({
view: new ol.View2D({
- center: ol.Projection.transformWithCodes(
+ center: ol.projection.transformWithCodes(
new ol.Coordinate(-0.1275, 51.507222), 'EPSG:4326', 'EPSG:3857'),
zoom: 10
}),
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
+ <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
+ <link rel="stylesheet" href="style.css" type="text/css">
+ <style type="text/css">
+ html, body, #map {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+ }
+ #text {
+ position: absolute;
+ top: 8px;
+ right: 8px;
+ z-index: 20000;
+ background-color: white;
+ padding: 0 0.5em 0.5em 0.5em;
+ border-radius: 4px;
+ }
+ @media only screen and (max-width: 600px) {
+ #text {
+ display: none;
+ }
+ }
+ </style>
+ <title>EPSG:4326 example</title>
+ </head>
+ <body>
+ <div id="map">
+ <div id="text">
+ <h1 id="title">EPSG:4326 example</h1>
+ <div id="shortdesc">Example of a epsg-4326 map.</div>
+ <div id="docs">
+ <p>See the
+ <a href="epsg-4326.js" target="_blank">epsg-4326.js source</a>
+ to see how this is done.</p>
+ </div>
+ </div>
+ </div>
+ <div id="tags">epsg4326</div>
+ <script src="loader.js?id=epsg-4326" type="text/javascript"></script>
+ </body>
+</html>
View
@@ -0,0 +1,56 @@
+goog.require('goog.debug.Console');
+goog.require('goog.debug.Logger');
+goog.require('goog.debug.Logger.Level');
+goog.require('ol.Collection');
+goog.require('ol.Coordinate');
+goog.require('ol.Map');
+goog.require('ol.RendererHint');
+goog.require('ol.View2D');
+goog.require('ol.layer.TileLayer');
+goog.require('ol.projection');
+goog.require('ol.source.TiledWMS');
+
+
+if (goog.DEBUG) {
+ goog.debug.Console.autoInstall();
+ goog.debug.Logger.getLogger('ol').setLevel(goog.debug.Logger.Level.INFO);
+}
+
+var epsg4326 = ol.projection.getFromCode('EPSG:4326');
+
+// We give the single image source a set of resolutions. This prevents the
+// source from requesting images of arbitrary resolutions.
+var projectionExtent = epsg4326.getExtent();
+var maxResolution = Math.max(
+ projectionExtent.maxX - projectionExtent.minX,
+ projectionExtent.maxY - projectionExtent.minY) / 256;
+var resolutions = new Array(10);
+for (var i = 0; i < 10; ++i) {
+ resolutions[i] = maxResolution / Math.pow(2.0, i);
+}
+
+var layers = new ol.Collection([
+ new ol.layer.TileLayer({
+ source: new ol.source.TiledWMS({
+ url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
+ crossOrigin: null,
+ params: {
+ 'LAYERS': 'basic',
+ 'FORMAT': 'image/jpeg'
+ },
+ projection: epsg4326
+ })
+ })
+]);
+
+var map = new ol.Map({
+ layers: layers,
+ // The OSgeo server does not set cross origin headers, so we cannot use WebGL
+ renderers: [ol.RendererHint.CANVAS, ol.RendererHint.DOM],
+ target: 'map',
+ view: new ol.View2D({
+ projection: epsg4326,
+ center: new ol.Coordinate(0, 0),
+ zoom: 2
+ })
+});
@@ -4,14 +4,14 @@ goog.require('goog.debug.Logger.Level');
goog.require('ol.Collection');
goog.require('ol.Coordinate');
goog.require('ol.Map');
-goog.require('ol.Projection');
goog.require('ol.RendererHint');
goog.require('ol.View2D');
goog.require('ol.animation');
goog.require('ol.control.MousePosition');
goog.require('ol.easing');
goog.require('ol.interaction.Keyboard');
goog.require('ol.layer.TileLayer');
+goog.require('ol.projection');
goog.require('ol.source.MapQuestOpenAerial');
@@ -21,9 +21,9 @@ if (goog.DEBUG) {
}
-var LONDON = ol.Projection.transformWithCodes(
+var LONDON = ol.projection.transformWithCodes(
new ol.Coordinate(-0.12755, 51.507222), 'EPSG:4326', 'EPSG:3857');
-var MOSCOW = ol.Projection.transformWithCodes(
+var MOSCOW = ol.projection.transformWithCodes(
new ol.Coordinate(37.6178, 55.7517), 'EPSG:4326', 'EPSG:3857');
var layer = new ol.layer.TileLayer({
@@ -44,7 +44,7 @@ var domMap = new ol.Map({
var domMousePosition = new ol.control.MousePosition({
coordinateFormat: ol.Coordinate.toStringHDMS,
- projection: ol.Projection.getFromCode('EPSG:4326'),
+ projection: ol.projection.getFromCode('EPSG:4326'),
target: document.getElementById('domMousePosition'),
undefinedHTML: '&nbsp;'
});
@@ -61,7 +61,7 @@ if (webglMap !== null) {
var webglMousePosition = new ol.control.MousePosition({
coordinateFormat: ol.Coordinate.toStringHDMS,
- projection: ol.Projection.getFromCode('EPSG:4326'),
+ projection: ol.projection.getFromCode('EPSG:4326'),
target: document.getElementById('webglMousePosition'),
undefinedHTML: '&nbsp;'
});
@@ -78,7 +78,7 @@ if (canvasMap !== null) {
var canvasMousePosition = new ol.control.MousePosition({
coordinateFormat: ol.Coordinate.toStringHDMS,
- projection: ol.Projection.getFromCode('EPSG:4326'),
+ projection: ol.projection.getFromCode('EPSG:4326'),
target: document.getElementById('canvasMousePosition'),
undefinedHtml: '&nbsp;'
});
@@ -2,10 +2,10 @@ goog.require('ol.BingMapsStyle');
goog.require('ol.Collection');
goog.require('ol.Coordinate');
goog.require('ol.Map');
-goog.require('ol.Projection');
goog.require('ol.RendererHint');
goog.require('ol.View2D');
goog.require('ol.layer.TileLayer');
+goog.require('ol.projection');
goog.require('ol.source.BingMaps');
goog.require('ol.source.TileJSON');
@@ -29,7 +29,7 @@ var webglMap = new ol.Map({
renderer: ol.RendererHint.WEBGL,
target: 'webglMap',
view: new ol.View2D({
- center: ol.Projection.transformWithCodes(
+ center: ol.projection.transformWithCodes(
new ol.Coordinate(-77.93255, 37.9555), 'EPSG:4326', 'EPSG:3857'),
zoom: 5
})
@@ -12,6 +12,7 @@ goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.layer.ImageLayer');
goog.require('ol.layer.TileLayer');
+goog.require('ol.projection');
goog.require('ol.source.SingleImageWMS');
goog.require('ol.source.TiledWMS');
@@ -24,7 +25,7 @@ if (goog.DEBUG) {
var epsg21781 = new ol.Projection('EPSG:21781', ol.ProjectionUnits.METERS,
// Validity extent from http://spatialreference.org
new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864));
-ol.Projection.addProjection(epsg21781);
+ol.projection.addProjection(epsg21781);
// We give the single image source a set of resolutions. This prevents the
// source from requesting images of arbitrary resolutions.
View
@@ -32,7 +32,7 @@ var layers = new ol.Collection([
})
]);
var map = new ol.Map({
- renderer: ol.RendererHint.DOM,
+ renderer: ol.RendererHint.CANVAS,
layers: layers,
target: 'map',
view: new ol.View2D({
View
@@ -55,6 +55,12 @@ Proj4js.Proj = function(srsCode, opt_callback) {};
/**
* @type {string}
*/
+Proj4js.Proj.prototype.axis;
+
+
+/**
+ * @type {string}
+ */
Proj4js.Proj.prototype.title;
@@ -130,7 +130,6 @@
@exportObjectLiteralProperty ol.source.TiledWMSOptions.urls Array.<string>|undefined
@exportObjectLiteral ol.tilegrid.TileGridOptions
-@exportObjectLiteralProperty ol.tilegrid.TileGridOptions.extent ol.Extent|undefined
@exportObjectLiteralProperty ol.tilegrid.TileGridOptions.origin ol.Coordinate|undefined
@exportObjectLiteralProperty ol.tilegrid.TileGridOptions.origins Array.<ol.Coordinate>|undefined
@exportObjectLiteralProperty ol.tilegrid.TileGridOptions.resolutions !Array.<number>
@@ -15,6 +15,7 @@ goog.require('ol.Pixel');
goog.require('ol.Projection');
goog.require('ol.TransformFunction');
goog.require('ol.control.Control');
+goog.require('ol.projection');
@@ -71,7 +72,7 @@ ol.control.MousePosition = function(mousePositionOptions) {
* @private
* @type {ol.TransformFunction}
*/
- this.transform_ = ol.Projection.identityTransform;
+ this.transform_ = ol.projection.identityTransform;
/**
* @private
@@ -166,10 +167,10 @@ ol.control.MousePosition.prototype.updateHTML_ = function(pixel) {
if (!goog.isNull(pixel)) {
if (this.renderedProjection_ != this.mapProjection_) {
if (goog.isDef(this.projection_)) {
- this.transform_ = ol.Projection.getTransform(
+ this.transform_ = ol.projection.getTransform(
this.mapProjection_, this.projection_);
} else {
- this.transform_ = ol.Projection.identityTransform;
+ this.transform_ = ol.projection.identityTransform;
}
this.renderedProjection_ = this.mapProjection_;
}
@@ -30,13 +30,13 @@ ol.control.Zoom = function(zoomOptions) {
var inElement = goog.dom.createDom(goog.dom.TagName.A, {
'href': '#zoomIn',
'class': 'ol-zoom-in'
- }, '+');
+ });
goog.events.listen(inElement, eventType, this.handleIn_, false, this);
var outElement = goog.dom.createDom(goog.dom.TagName.A, {
'href': '#zoomOut',
'class': 'ol-zoom-out'
- }, '\u2212');
+ });
goog.events.listen(outElement, eventType, this.handleOut_, false, this);
var element = goog.dom.createDom(
@@ -9,6 +9,7 @@ goog.require('goog.math');
goog.require('ol.Coordinate');
goog.require('ol.Object');
goog.require('ol.Projection');
+goog.require('ol.projection');
/**
@@ -75,8 +76,8 @@ ol.Geolocation.prototype.disposeInternal = function() {
ol.Geolocation.prototype.handleProjectionChanged_ = function() {
var projection = this.getProjection();
if (goog.isDefAndNotNull(projection)) {
- this.transformCoords_ = ol.Projection.getTransform(
- ol.Projection.getFromCode('EPSG:4326'), projection);
+ this.transformCoords_ = ol.projection.getTransform(
+ ol.projection.getFromCode('EPSG:4326'), projection);
if (!goog.isNull(this.position_)) {
this.set(ol.GeolocationProperty.POSITION,
this.transformCoords_(this.position_));
Oops, something went wrong. Retry.

0 comments on commit 5a73529

Please sign in to comment.