This commit is contained in:
Tom Payne
2012-10-18 11:50:40 +02:00
parent 453f8499d6
commit 1f8c98db8c
9 changed files with 106 additions and 36 deletions

View File

@@ -2,6 +2,7 @@
<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">

View File

@@ -0,0 +1 @@
<!doctype html><html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><link href="style.css" rel="stylesheet" type="text/css"><title>ol3 examples</title></head><body><h1>ol3 examples</h1><ul><li><a href="full-screen.html">full screen</a></li><li><a href="local.html">local</a></li><li><a href="overlay-and-popup.html">overlay and popup</a></li><li><a href="side-by-side.html">side by side</a></li><li><a href="two-layers.html">two layers</a></li></ul><script src="index.js" type="text/javascript"></script></body></html>

16
master/examples/index.js Normal file
View File

@@ -0,0 +1,16 @@
/**
* Loader to append the query string to every A element in the document.
*
* This is so that (for example) visiting
* /examples/index.html?mode=RAW&Debug=true
* will cause all links to automatically include the ?mode=RAW&Debug=true.
*/
(function() {
var as = document.getElementsByTagName('a');
var i, n = as.length;
for (i = 0; i < n; ++i) {
as[i].href += window.location.search;
}
})();

View File

@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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%;
}
</style>
<link rel="stylesheet" href="../css/ol.css" type="text/css">
<title>ol3 local demo</title>
</head>
<body>
<div id="map"></div>
<script src="loader.js?id=local" type="text/javascript"></script>
</body>
</html>

27
master/examples/local.js Normal file
View File

@@ -0,0 +1,27 @@
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.source.MapQuestOpenAerial');
if (goog.DEBUG) {
goog.debug.Console.autoInstall();
goog.debug.Logger.getLogger('ol').setLevel(goog.debug.Logger.Level.INFO);
}
var layer = new ol.layer.TileLayer({
source: new ol.source.XYZ({
maxZoom: 8,
url: 'http://localhost:8080/tiles/0/tiles/{z}/{x}/{y}'
})
});
var map = new ol.Map({
center: new ol.Coordinate(0, 0),
layers: new ol.Collection([layer]),
target: 'map',
zoom: 2
});

View File

@@ -2,6 +2,7 @@
<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">

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" href="style.css" type="text/css">
<style type="text/css">
.map {

View File

@@ -2,6 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" href="style.css" type="text/css">
<style type="text/css">
.map {