Move parser examples away

This commit is contained in:
Tom Payne
2013-11-06 21:25:30 +01:00
parent 72d849563b
commit 07ef8e774d
8 changed files with 0 additions and 0 deletions

View File

@@ -1,48 +0,0 @@
<!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="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>WMS GetCapabilities parsing example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
<h4 id="title">WMS GetCapabilities parsing example</h4>
<p id="shortdesc">Example of parsing a WMS GetCapabilities response.</p>
<div id="docs">
<p>See the <a href="wms-capabilities.js" target="_blank">wms-capabilities.js source</a> to see how this is done.</p>
</div>
<div id="tags">wms, capabilities, getcapabilities</div>
</div>
<div class="span8">
<pre id="log"></pre>
</div>
</div>
</div>
<script src="loader.js?id=wms-capabilities" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,20 +0,0 @@
goog.require('ol.parser.ogc.WMSCapabilities');
var parser = new ol.parser.ogc.WMSCapabilities(), result;
var url = 'data/ogcsample.xml';
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
/**
* onload handler for the XHR request.
*/
xhr.onload = function() {
if (xhr.status == 200) {
result = parser.read(xhr.responseXML);
document.getElementById('log').innerHTML =
window.JSON.stringify(result, undefined, 2);
}
};
xhr.send();

View File

@@ -1,49 +0,0 @@
<!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="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>WMTS Capabilities parsing example</title>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
<h4 id="title">WMTS Capabilities parsing example</h4>
<p id="shortdesc">Example of parsing a WMTS Capabilities document.</p>
<div id="docs">
<p>See the <a href="wmts-capabilities.js" target="_blank">wmts-capabilities.js source</a> to see how this is done.</p>
</div>
<div id="tags">wmts, WMTSCapabilities</div>
</div>
<div class="span8">
<pre id="log"></pre>
</div>
</div>
</div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.js" type="text/javascript"></script>
<script src="loader.js?id=wmts-capabilities" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,26 +0,0 @@
goog.require('ol.parser.ogc.WMTSCapabilities');
goog.require('ol.proj.common');
ol.proj.common.add();
Proj4js.defs['EPSG:31256'] = '+proj=tmerc +lat_0=0 ' +
'+lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel ' +
'+towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 ' +
'+units=m +no_defs';
var parser = new ol.parser.ogc.WMTSCapabilities(), result;
var url = 'data/WMTSCapabilities.xml';
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
/**
* onload handler for the XHR request.
*/
xhr.onload = function() {
if (xhr.status == 200) {
result = parser.read(xhr.responseXML);
document.getElementById('log').innerHTML =
window.JSON.stringify(result, undefined, 2);
}
};
xhr.send();

View File

@@ -1,50 +0,0 @@
<!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="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/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="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</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="span12">
<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="loader.js?id=wmts-from-capabilities" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,42 +0,0 @@
goog.require('ol.Map');
goog.require('ol.RendererHint');
goog.require('ol.View2D');
goog.require('ol.layer.Tile');
goog.require('ol.parser.ogc.WMTSCapabilities');
goog.require('ol.source.WMTS');
var map, capabilities;
var parser = new ol.parser.ogc.WMTSCapabilities();
var xhr = new XMLHttpRequest();
xhr.open('GET', 'data/WMTSCapabilities.xml', true);
/**
* onload handler for the XHR request.
*/
xhr.onload = function() {
if (xhr.status == 200) {
capabilities = parser.read(xhr.responseXML);
map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.WMTS(ol.source.WMTS.optionsFromCapabilities(
capabilities, 'fmzk'))
}),
new ol.layer.Tile({
source: new ol.source.WMTS(ol.source.WMTS.optionsFromCapabilities(
capabilities, 'beschriftung'))
})
],
renderer: ol.RendererHint.CANVAS,
target: 'map',
view: new ol.View2D({
center: [1823849, 6143760],
zoom: 11
})
});
}
};
xhr.send();

View File

@@ -1,59 +0,0 @@
<!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="../css/ol.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<title>IGN WMTS example</title>
<style>
.ol-logo ul li {
margin-right: 3px;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
</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="span12">
<h4 id="title">IGN WMTS example</h4>
<p id="shortdesc">Demonstrates displaying IGN (France) WMTS layers.</p>
<div id="docs">
<p>In this example two IGN WMTS layers are displayed: <em>Ortho imagery and Cadastral parcels.</em>.
For more information on IGN's WMTS service see the
<a href="http://professionnels.ign.fr/api-sig">IGN Géoportail API web page</a> (french).</p>
<p>See the <a href="wmts-ign.js" target="_blank">wmts-ign.js source</a> to see how this is done.</p>
</div>
<div id="tags">french, ign, geoportail, 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="loader.js?id=wmts-ign" type="text/javascript"></script>
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
</body>
</html>

View File

@@ -1,86 +0,0 @@
goog.require('ol.Attribution');
goog.require('ol.Map');
goog.require('ol.RendererHint');
goog.require('ol.View2D');
goog.require('ol.layer.Tile');
goog.require('ol.parser.ogc.WMTSCapabilities');
goog.require('ol.source.WMTS');
// The WMTS Capabilities document includes IGNF:WGS84G as a supported
// CRS. We include the Proj4js definition of that projection to prevent
// Proj4js from requesting that definition from spatialreference.org.
Proj4js.defs['IGNF:WGS84G'] = '+title=World Geodetic System 1984 ' +
'+proj=longlat +towgs84=0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,' +
'0.000000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>';
// API key valid for "localhost" and "ol3js.org". Expiration date
// is 21/06/2014.
var key = 'crrypaoz7j1ifbalcobnumb0';
var map = new ol.Map({
renderer: ol.RendererHint.CANVAS,
target: 'map'
});
var xhr = new XMLHttpRequest();
// data/IGNWMTSCapabilities.xml downloaded from
// http://wxs.ign.fr/cle/geoportail/wmts?SERVICE=WMTS&REQUEST=GetCapabilities
// Stored locally because of the Same Origin Policy.
xhr.open('GET', 'data/IGNWMTSCapabilities.xml', true);
/**
* onload handler for the XHR request.
*/
xhr.onload = function() {
if (xhr.status == 200) {
var parser = new ol.parser.ogc.WMTSCapabilities();
var capabilities = parser.read(xhr.responseXML);
var wmtsUrl = 'http://wxs.ign.fr/' + key + '/geoportail/wmts';
var layerIdentifiers = [
'ORTHOIMAGERY.ORTHOPHOTOS',
'CADASTRALPARCELS.PARCELS'
];
var layerLogos = [
'http://gpp3-wxs.ign.fr/static/logos/PLANETOBSERVER/PLANETOBSERVER.gif',
'http://gpp3-wxs.ign.fr/static/logos/IGN/IGN.gif'
];
var attribution = new ol.Attribution({
html: '<a href="http://www.geoportail.fr/" target="_blank">' +
'<img src="http://api.ign.fr/geoportail/api/js/latest/' +
'theme/geoportal/img/logo_gp.gif"></a>'
});
var sourceOptions;
var source;
var layer;
var i;
for (i = 0; i < layerIdentifiers.length; ++i) {
sourceOptions = ol.source.WMTS.optionsFromCapabilities(
capabilities, layerIdentifiers[i]);
// we need to set the URL because it must include the key.
sourceOptions.urls = [wmtsUrl];
sourceOptions.attributions = [attribution];
sourceOptions.logo = layerLogos[i];
source = new ol.source.WMTS(sourceOptions);
layer = new ol.layer.Tile({source: source});
map.addLayer(layer);
}
var view = new ol.View2D();
view.fitExtent(
[257596.65942095537, 6250898.984085131,
262082.55751844167, 6251854.446938695],
/** @type {ol.Size} */ (map.getSize()));
map.setView(view);
}
};
xhr.send();