Add Zoomify stuff
This commit is contained in:
committed by
Tom Payne
parent
83e34bfc8d
commit
fe1f98899f
50
examples/zoomify.html
Normal file
50
examples/zoomify.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<!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>Zoomify 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">Zoomify example</h4>
|
||||
<p id="shortdesc">Example of a Zoomify source.</p>
|
||||
<div id="docs">
|
||||
<p>See the <a href="zoomify.js" target="_blank">zoomify.js source</a> to see how this is done.</p>
|
||||
</div>
|
||||
<div id="tags">zoomify</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=zoomify" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
39
examples/zoomify.js
Normal file
39
examples/zoomify.js
Normal file
@@ -0,0 +1,39 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.Projection');
|
||||
goog.require('ol.proj.Units');
|
||||
goog.require('ol.source.Zoomify');
|
||||
|
||||
var imgWidth = 8001;
|
||||
var imgHeight = 6943;
|
||||
var imgCenter = [imgWidth / 2, -imgHeight / 2];
|
||||
var url = 'http://mapy.mzk.cz/AA22/0103/';
|
||||
|
||||
var proj = new ol.proj.Projection({
|
||||
code: 'ZOOMIFY',
|
||||
units: ol.proj.Units.PIXELS,
|
||||
extent: [0, 0, imgWidth, imgHeight]
|
||||
});
|
||||
|
||||
var source = new ol.source.Zoomify({
|
||||
url: url,
|
||||
size: [imgWidth, imgHeight]
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: source
|
||||
})
|
||||
],
|
||||
renderer: ol.RendererHint.CANVAS,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
projection: proj,
|
||||
center: imgCenter,
|
||||
zoom: 0
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user