Permalink
Browse files

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

Conflicts:
	src/objectliterals.exports
  • Loading branch information...
ahocevar committed Mar 12, 2013
2 parents b20a2ba + a0b1d74 commit fad036aa53a7b5c7c55dc4751318e643a36df28b
View
@@ -26,17 +26,8 @@
<div class="container-fluid">
<div class="row-fluid">
- <div class="span4">
- <h4>Canvas</h4>
- <div id="canvasMap" class="map"></div>
- </div>
- <div class="span4">
- <h4>WebGL</h4>
- <div id="webglMap" class="map"></div>
- </div>
- <div class="span4">
- <h4>DOM</h4>
- <div id="domMap" class="map"></div>
+ <div class="span12">
+ <div id="map" class="map"></div>
</div>
</div>
@@ -53,6 +44,8 @@ <h4 id="title">Canvas tiles example</h4>
</div>
+ </div>
+
<script src="loader.js?id=canvas-tiles" type="text/javascript"></script>
</body>
View
@@ -1,6 +1,6 @@
goog.require('ol.Coordinate');
goog.require('ol.Map');
-goog.require('ol.RendererHint');
+goog.require('ol.RendererHints');
goog.require('ol.View2D');
goog.require('ol.layer.TileLayer');
goog.require('ol.projection');
@@ -9,41 +9,25 @@ goog.require('ol.source.OpenStreetMap');
goog.require('ol.tilegrid.XYZ');
-var layers = [
- new ol.layer.TileLayer({
- source: new ol.source.OpenStreetMap()
- }),
- new ol.layer.TileLayer({
- source: new ol.source.DebugTileSource({
- projection: 'EPSG:3857',
- tileGrid: new ol.tilegrid.XYZ({
- maxZoom: 22
+var map = new ol.Map({
+ layers: [
+ new ol.layer.TileLayer({
+ source: new ol.source.OpenStreetMap()
+ }),
+ new ol.layer.TileLayer({
+ source: new ol.source.DebugTileSource({
+ projection: 'EPSG:3857',
+ tileGrid: new ol.tilegrid.XYZ({
+ maxZoom: 22
+ })
})
})
- })
-];
-
-var webglMap = new ol.Map({
+ ],
+ renderers: ol.RendererHints.createFromQueryData(),
+ target: 'map',
view: new ol.View2D({
center: ol.projection.transform(
new ol.Coordinate(-0.1275, 51.507222), 'EPSG:4326', 'EPSG:3857'),
zoom: 10
- }),
- layers: layers,
- renderer: ol.RendererHint.WEBGL,
- target: 'webglMap'
-});
-
-var domMap = new ol.Map({
- renderer: ol.RendererHint.DOM,
- target: 'domMap'
-});
-domMap.bindTo('layers', webglMap);
-domMap.bindTo('view', webglMap);
-
-var canvasMap = new ol.Map({
- renderer: ol.RendererHint.CANVAS,
- target: 'canvasMap'
+ })
});
-canvasMap.bindTo('layers', webglMap);
-canvasMap.bindTo('view', webglMap);
@@ -0,0 +1,54 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta 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="bootstrap/css/bootstrap.min.css" type="text/css">
+ <link rel="stylesheet" href="examples.css" type="text/css">
+ <link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" type="text/css">
+ <title>WMTS from capabilities example</title>
+ </head>
+ <body>
+
+ <div class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="brand" href="example-list.html">OpenLayers 3 Examples</a>
+ <ul class="nav pull-right">
+ <li><a href="https://github.com/openlayers/ol3"><i class="icon-github"></i></a></li>
+ <li><a href="https://twitter.com/openlayers"><i class="icon-twitter"></i></a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ <div class="container-fluid">
+
+ <div class="row-fluid">
+ <div class="span12">
+ <div id="map" class="map"></div>
+ </div>
+ </div>
+
+ <div class="row-fluid">
+
+ <div class="span4">
+ <h4 id="title">WMTS from capabilities example</h4>
+ <p id="shortdesc">Example of a WMTS source built from a WMTS getCapabilities response.</p>
+ <div id="docs">
+ <p>See the <a href="wmts-from-capabilities.js" target="_blank">wmts-from-capabilities.js source</a> to see how this is done.</p>
+ </div>
+ <div id="tags">wmts</div>
+ </div>
+
+ </div>
+
+ </div>
+
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.js" type="text/javascript"></script>
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/defs/EPSG21781.js" type="text/javascript"></script>
+ <script src="loader.js?id=wmts-from-capabilities" type="text/javascript"></script>
+
+ </body>
+</html>
@@ -0,0 +1,47 @@
+goog.require('ol.Coordinate');
+goog.require('ol.Extent');
+goog.require('ol.Map');
+goog.require('ol.RendererHints');
+goog.require('ol.View2D');
+goog.require('ol.layer.TileLayer');
+goog.require('ol.parser.ogc.WMTSCapabilities');
+goog.require('ol.projection');
+goog.require('ol.source.WMTS');
+
+
+var map, capabilities;
+var parser = new ol.parser.ogc.WMTSCapabilities();
+var projection = ol.projection.configureProj4jsProjection({
+ code: 'EPSG:21781',
+ extent: new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864)
+});
+
+var xhr = new XMLHttpRequest();
+xhr.open('GET', 'http://wmts.geo.admin.ch/1.0.0/WMTSCapabilities.xml', true);
+
+
+/**
+ * onload handler for the XHR request.
+ */
+xhr.onload = function() {
+ if (xhr.status == 200) {
+ capabilities = parser.read(xhr.responseXML);
+ var wmtsOptions = ol.source.WMTS.optionsFromCapabilities(
+ capabilities, 'ch.swisstopo.pixelkarte-farbe');
+ map = new ol.Map({
+ layers: [
+ new ol.layer.TileLayer({
+ source: new ol.source.WMTS(wmtsOptions)
+ })
+ ],
+ renderers: ol.RendererHints.createFromQueryData(),
+ target: 'map',
+ view: new ol.View2D({
+ center: projection.getExtent().getCenter(),
+ projection: projection,
+ zoom: 1
+ })
+ });
+ }
+};
+xhr.send();
View
@@ -0,0 +1,52 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta 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="bootstrap/css/bootstrap.min.css" type="text/css">
+ <link rel="stylesheet" href="examples.css" type="text/css">
+ <link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" type="text/css">
+ <title>WMTS example</title>
+ </head>
+ <body>
+
+ <div class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <a class="brand" href="example-list.html">OpenLayers 3 Examples</a>
+ <ul class="nav pull-right">
+ <li><a href="https://github.com/openlayers/ol3"><i class="icon-github"></i></a></li>
+ <li><a href="https://twitter.com/openlayers"><i class="icon-twitter"></i></a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ <div class="container-fluid">
+
+ <div class="row-fluid">
+ <div class="span12">
+ <div id="map" class="map"></div>
+ </div>
+ </div>
+
+ <div class="row-fluid">
+
+ <div class="span4">
+ <h4 id="title">WMTS example</h4>
+ <p id="shortdesc">Example of a WMTS source.</p>
+ <div id="docs">
+ <p>See the <a href="wmts.js" target="_blank">wmts.js source</a> to see how this is done.</p>
+ </div>
+ <div id="tags">wmts</div>
+ </div>
+
+ </div>
+
+ </div>
+
+ <script src="loader.js?id=wmts" type="text/javascript"></script>
+
+ </body>
+</html>
View
@@ -0,0 +1,54 @@
+goog.require('ol.Coordinate');
+goog.require('ol.Extent');
+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.OpenStreetMap');
+goog.require('ol.source.WMTS');
+goog.require('ol.tilegrid.WMTS');
+
+
+var projection = ol.projection.get('EPSG:900913');
+var projectionExtent = projection.getExtent();
+var size = projectionExtent.getWidth() / 256;
+var resolutions = new Array(26);
+var matrixIds = new Array(26);
+for (var z = 0; z < 26; ++z) {
+ // generate resolutions and matrixIds arrays for this WMTS
+ resolutions[z] = size / Math.pow(2, z);
+ matrixIds[z] = 'EPSG:900913:' + z;
+}
+
+var map = new ol.Map({
+ layers: [
+ new ol.layer.TileLayer({
+ source: new ol.source.OpenStreetMap(),
+ opacity: 0.7
+ }),
+ new ol.layer.TileLayer({
+ source: new ol.source.WMTS({
+ url: 'http://v2.suite.opengeo.org/geoserver/gwc/service/wmts/',
+ layer: 'medford:buildings',
+ matrixSet: 'EPSG:900913',
+ format: 'image/png',
+ projection: projection,
+ tileGrid: new ol.tilegrid.WMTS({
+ origin: projectionExtent.getTopLeft(),
+ resolutions: resolutions,
+ matrixIds: matrixIds
+ }),
+ style: '_null',
+ crossOrigin: null, // FIXME: this should be the default
+ extent: new ol.Extent(-13682835, 5204068, -13667473, 5221690)
+ })
+ })
+ ],
+ renderer: ol.RendererHint.CANVAS,
+ target: 'map',
+ view: new ol.View2D({
+ center: new ol.Coordinate(-13677832, 5213272),
+ zoom: 13
+ })
+});
View
@@ -155,38 +155,21 @@
@exportObjectLiteralProperty ol.source.TiledWMSOptions.url string|undefined
@exportObjectLiteralProperty ol.source.TiledWMSOptions.urls Array.<string>|undefined
-@exportObjectLiteral ol.style.IconOptions
-@exportObjectLiteralProperty ol.style.IconOptions.url string|ol.Expression
-@exportObjectLiteralProperty ol.style.IconOptions.width number|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.IconOptions.height number|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.IconOptions.opacity number|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.IconOptions.rotation number|ol.Expression|undefined
-
-@exportObjectLiteral ol.style.LineOptions
-@exportObjectLiteralProperty ol.style.LineOptions.strokeColor string|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.LineOptions.strokeWidth number|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.LineOptions.opacity number|ol.Expression|undefined
-
-@exportObjectLiteral ol.style.PolygonOptions
-@exportObjectLiteralProperty ol.style.PolygonOptions.fillColor string|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.PolygonOptions.strokeColor string|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.PolygonOptions.strokeWidth number|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.PolygonOptions.opacity number|ol.Expression|undefined
-
-@exportObjectLiteral ol.style.RuleOptions
-@exportObjectLiteralProperty ol.style.RuleOptions.filter ol.filter.Filter|undefined
-@exportObjectLiteralProperty ol.style.RuleOptions.symbolizers Array.<ol.style.Symbolizer>|undefined
-
-@exportObjectLiteral ol.style.ShapeOptions
-@exportObjectLiteralProperty ol.style.ShapeOptions.type ol.style.ShapeType|undefined
-@exportObjectLiteralProperty ol.style.ShapeOptions.size number|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.ShapeOptions.fillColor string|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.ShapeOptions.strokeColor string|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.ShapeOptions.strokeWidth number|ol.Expression|undefined
-@exportObjectLiteralProperty ol.style.ShapeOptions.opacity number|ol.Expression|undefined
-
-@exportObjectLiteral ol.style.StyleOptions
-@exportObjectLiteralProperty ol.style.StyleOptions.rules Array.<ol.style.Rule>
+@exportObjectLiteral ol.source.WMTSOptions
+@exportObjectLiteralProperty ol.source.WMTSOptions.attributions Array.<ol.Attribution>|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.crossOrigin string|null|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.extent ol.Extent|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.tileGrid ol.tilegrid.WMTS
+@exportObjectLiteralProperty ol.source.WMTSOptions.projection ol.Projection|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.requestEncoding ol.source.WMTSRequestEncoding|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.layer string
+@exportObjectLiteralProperty ol.source.WMTSOptions.style string
+@exportObjectLiteralProperty ol.source.WMTSOptions.format string|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.matrixSet string
+@exportObjectLiteralProperty ol.source.WMTSOptions.dimensions Object|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.url string|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.maxZoom number|undefined
+@exportObjectLiteralProperty ol.source.WMTSOptions.urls Array.<string>|undefined
@exportObjectLiteral ol.tilegrid.TileGridOptions
@exportObjectLiteralProperty ol.tilegrid.TileGridOptions.origin ol.Coordinate|undefined
@@ -195,6 +178,14 @@
@exportObjectLiteralProperty ol.tilegrid.TileGridOptions.tileSize ol.Size|undefined
@exportObjectLiteralProperty ol.tilegrid.TileGridOptions.tileSizes Array.<ol.Size>|undefined
+@exportObjectLiteral ol.tilegrid.WMTSOptions
+@exportObjectLiteralProperty ol.tilegrid.WMTSOptions.origin ol.Coordinate|undefined
+@exportObjectLiteralProperty ol.tilegrid.WMTSOptions.origins Array.<ol.Coordinate>|undefined
+@exportObjectLiteralProperty ol.tilegrid.WMTSOptions.resolutions !Array.<number>
+@exportObjectLiteralProperty ol.tilegrid.WMTSOptions.matrixIds !Array.<string>
+@exportObjectLiteralProperty ol.tilegrid.WMTSOptions.tileSize ol.Size|undefined
+@exportObjectLiteralProperty ol.tilegrid.WMTSOptions.tileSizes Array.<ol.Size>|undefined
+
@exportObjectLiteral ol.tilegrid.XYZOptions
@exportObjectLiteralProperty ol.tilegrid.XYZOptions.maxZoom number
@@ -1,2 +1,5 @@
@exportSymbol ol.Coordinate
-@exportProperty ol.Coordinate.toStringHDMS
+@exportSymbol ol.Coordinate.createStringXY
+@exportSymbol ol.Coordinate.toStringHDMS
+@exportSymbol ol.Coordinate.toStringXY
+@exportSymbol ol.Coordinate.fromProjectedArray
View
@@ -1,3 +1,11 @@
@exportSymbol ol.Extent
+@exportProperty ol.Extent.prototype.getCenter
@exportProperty ol.Extent.prototype.getHeight
@exportProperty ol.Extent.prototype.getWidth
+@exportProperty ol.Extent.prototype.containsCoordinate
+@exportProperty ol.Extent.prototype.containsExtent
+@exportProperty ol.Extent.prototype.getBottomLeft
+@exportProperty ol.Extent.prototype.getBottomRight
+@exportProperty ol.Extent.prototype.getTopLeft
+@exportProperty ol.Extent.prototype.getTopRight
+@exportProperty ol.Extent.prototype.transform
Oops, something went wrong.

0 comments on commit fad036a

Please sign in to comment.