Merge branch 'master' of github.com:openlayers/ol3 into vector
This commit is contained in:
@@ -16,8 +16,8 @@ var layers = new ol.Collection([
|
||||
source: new ol.source.TiledWMS({
|
||||
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
|
||||
crossOrigin: null,
|
||||
version: '1.1.1',
|
||||
params: {
|
||||
'VERSION': '1.1.1',
|
||||
'LAYERS': 'basic',
|
||||
'FORMAT': 'image/jpeg'
|
||||
},
|
||||
|
||||
42
examples/stamen.html
Normal file
42
examples/stamen.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!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;
|
||||
}
|
||||
</style>
|
||||
<title>Stamen example</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map">
|
||||
<div id="text">
|
||||
<h1 id="title">Stamen example</h1>
|
||||
<div id="shortdesc">Example of a Stamen tile source.</div>
|
||||
<div id="docs">
|
||||
<p>See the
|
||||
<a href="stamen.js" target="_blank">stamen.js source</a>
|
||||
to see how this is done.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tags">fullscreen, stamen, tilelayer</div>
|
||||
<script src="loader.js?id=stamen" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
31
examples/stamen.js
Normal file
31
examples/stamen.js
Normal file
@@ -0,0 +1,31 @@
|
||||
goog.require('ol.Collection');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.source.Stamen');
|
||||
|
||||
|
||||
var layers = new ol.Collection([
|
||||
new ol.layer.TileLayer({
|
||||
source: new ol.source.Stamen({
|
||||
layer: 'watercolor'
|
||||
})
|
||||
}),
|
||||
new ol.layer.TileLayer({
|
||||
source: new ol.source.Stamen({
|
||||
layer: 'terrain-labels'
|
||||
})
|
||||
})
|
||||
]);
|
||||
var map = new ol.Map({
|
||||
layers: layers,
|
||||
renderers: ol.RendererHints.createFromQueryData(),
|
||||
scaleLineControl: true,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: new ol.Coordinate(0, 0),
|
||||
zoom: 3
|
||||
})
|
||||
});
|
||||
@@ -19,19 +19,6 @@ var epsg21781 = new ol.Projection('EPSG:21781', ol.ProjectionUnits.METERS,
|
||||
new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864));
|
||||
ol.projection.addProjection(epsg21781);
|
||||
|
||||
// We could give the single image source a set of resolutions. This prevents the
|
||||
// source from requesting images of arbitrary resolutions. To try it, uncomment
|
||||
// the block below and the resolutions option in the SingleImageWMS config.
|
||||
/*
|
||||
var projectionExtent = epsg21781.getExtent();
|
||||
var maxResolution = Math.max(projectionExtent.getWidth(),
|
||||
projectionExtent.getHeight()) / 256;
|
||||
var resolutions = new Array(10);
|
||||
for (var i = 0; i < 10; ++i) {
|
||||
resolutions[i] = maxResolution / Math.pow(2.0, i);
|
||||
}
|
||||
*/
|
||||
|
||||
var extent = new ol.Extent(420000, 30000, 900000, 350000);
|
||||
var layers = new ol.Collection([
|
||||
new ol.layer.TileLayer({
|
||||
@@ -50,7 +37,6 @@ var layers = new ol.Collection([
|
||||
}),
|
||||
new ol.layer.ImageLayer({
|
||||
source: new ol.source.SingleImageWMS({
|
||||
//resolutions: resolutions,
|
||||
url: 'http://wms.geo.admin.ch/',
|
||||
attributions: [new ol.Attribution(
|
||||
'© ' +
|
||||
|
||||
Reference in New Issue
Block a user