diff --git a/Makefile b/Makefile
index 0cca89131f..5b2e479a62 100644
--- a/Makefile
+++ b/Makefile
@@ -110,7 +110,7 @@ doc: build/jsdoc-$(BRANCH)-timestamp
build/jsdoc-$(BRANCH)-timestamp: $(SRC) $(shell find doc/template -type f)
mkdir -p build/gh-pages/$(BRANCH)/apidoc
- $(JSDOC) -t doc/template -r src -d build/gh-pages/$(BRANCH)/apidoc
+ $(JSDOC) -t doc/template -r src -d build/gh-pages/$(BRANCH)/apidoc doc/index.md
touch $@
.PHONY: hostexamples
diff --git a/doc/index.md b/doc/index.md
new file mode 100644
index 0000000000..1fb377193a
--- /dev/null
+++ b/doc/index.md
@@ -0,0 +1,17 @@
+Finding your way round
+----------------------
+See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects.
+
+In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map.
+
+Projections
+-----------
+A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. Coordinates within OpenLayers can be used in various projections where some common projections are always supported, others can be used via Proj4js.
+
+Maps and Layers
+---------------
+A map in OpenLayers is essentially a staple of layers that is viewed from the top. Layers are responsible for retieving data and displaying it.
+
+Contributing
+------------
+See CONTRIBUTING.md for instructions on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers.
\ No newline at end of file
diff --git a/doc/template/publish.js b/doc/template/publish.js
index 23e9c7d08e..5a0eb1ff81 100644
--- a/doc/template/publish.js
+++ b/doc/template/publish.js
@@ -2,6 +2,7 @@
var template = require('jsdoc/template'),
fs = require('fs'),
path = require('path'),
+ taffy = require('taffydb').taffy,
helper = require('jsdoc/util/templateHelper'),
scopeToPunc = helper.scopeToPunc,
hasOwnProp = Object.prototype.hasOwnProperty,
@@ -9,8 +10,9 @@ var template = require('jsdoc/template'),
view,
outdir = env.opts.destination;
-function find(spec, sort) {
- return helper.find(data, spec, sort);
+
+function find(spec) {
+ return helper.find(data, spec);
}
function tutoriallink(tutorial) {
@@ -26,7 +28,7 @@ var linkto = helper.linkto;
var htmlsafe = helper.htmlsafe;
function hashToLink(doclet, hash) {
- if (!/^(#.+)/.test(hash)) { return hash; }
+ if ( !/^(#.+)/.test(hash) ) { return hash; }
var url = helper.createLink(doclet);
@@ -64,7 +66,7 @@ function generate(title, docs, filename) {
docs: docs
};
- var outpath = outdir + '/' + filename,
+ var outpath = path.join(outdir, filename),
html = view.render('container.tmpl', docData);
html = helper.resolveLinks(html); // turn {@link foo} into foo
@@ -87,15 +89,28 @@ function generate(title, docs, filename) {
function buildNav(members) {
var nav = '
',
seen = {};
-
- function byLongName(a, b) {
- return a.longname.localeCompare(b.longname);
+
+ /**
+ * Sorts elements by their qualified names (property longname).
+ * See https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/sort
+ * @param {object} a
+ * @param {object} b
+ * @return {number}
+ */
+ function byLongName(a, b){
+ if(a.longname===b.longname){
+ return 0;
+ } else if(a.longname < b.longname){
+ return -1;
+ } else {
+ return 1;
+ }
}
if (members.modules.length) {
nav += 'Modules ';
members.modules.sort(byLongName).forEach(function(m) {
- if (!hasOwnProp.call(seen, m.longname)) {
+ if ( !hasOwnProp.call(seen, m.longname) ) {
nav += ''+linkto(m.longname, m.longname)+' ';
}
seen[m.longname] = true;
@@ -107,8 +122,8 @@ function buildNav(members) {
if (members.externals.length) {
nav += 'Externals ';
members.externals.sort(byLongName).forEach(function(e) {
- if (!hasOwnProp.call(seen, e.longname)) {
- nav += ''+linkto(e.longname, e.name.replace(/(^"|"$)/g, ''))+' ';
+ if ( !hasOwnProp.call(seen, e.longname) ) {
+ nav += ''+linkto( e.longname, e.name.replace(/(^"|"$)/g, '') )+' ';
}
seen[e.longname] = true;
});
@@ -119,7 +134,7 @@ function buildNav(members) {
if (members.classes.length) {
var moduleClasses = 0;
members.classes.sort(byLongName).forEach(function(c) {
- var moduleSameName = find({kind: 'module', longname: c.longname}, false);
+ var moduleSameName = find({kind: 'module', longname: c.longname});
if (moduleSameName.length) {
c.name = c.name.replace('module:', 'require("')+'")';
moduleClasses++;
@@ -129,7 +144,7 @@ function buildNav(members) {
nav += 'Classes ';
moduleClasses = -1;
}
- if (!hasOwnProp.call(seen, c.longname)) {
+ if ( !hasOwnProp.call(seen, c.longname) ) {
nav += ''+linkto(c.longname, c.longname)+' ';
}
seen[c.longname] = true;
@@ -141,7 +156,7 @@ function buildNav(members) {
if (members.namespaces.length) {
nav += 'Namespaces ';
members.namespaces.sort(byLongName).forEach(function(n) {
- if (!hasOwnProp.call(seen, n.longname)) {
+ if ( !hasOwnProp.call(seen, n.longname) ) {
nav += ''+linkto(n.longname, n.longname)+' ';
}
seen[n.longname] = true;
@@ -153,7 +168,7 @@ function buildNav(members) {
if (members.mixins.length) {
nav += 'Mixins ';
members.mixins.sort(byLongName).forEach(function(m) {
- if (!hasOwnProp.call(seen, m.longname)) {
+ if ( !hasOwnProp.call(seen, m.longname) ) {
nav += ''+linkto(m.longname, m.longname)+' ';
}
seen[m.longname] = true;
@@ -174,7 +189,7 @@ function buildNav(members) {
if (members.globals.length) {
nav += 'Global ';
members.globals.sort(byLongName).forEach(function(g) {
- if (g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname)) {
+ if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) {
nav += ''+linkto(g.longname, g.longname)+' ';
}
seen[g.longname] = true;
@@ -205,9 +220,9 @@ exports.publish = function(taffyData, opts, tutorials) {
helper.setTutorials(tutorials);
data = helper.prune(data);
- data.orderBy(['longname', 'version', 'since']);
+ data.sort('longname, version, since');
- data.forEach(function(doclet) {
+ data().each(function(doclet) {
doclet.attribs = '';
if (doclet.examples) {
@@ -233,28 +248,28 @@ exports.publish = function(taffyData, opts, tutorials) {
});
// update outdir if necessary, then create outdir
- var packageInfo = (find({kind: 'package'}, false) || []) [0];
+ var packageInfo = ( find({kind: 'package'}) || [] ) [0];
if (packageInfo && packageInfo.name) {
- outdir += '/' + packageInfo.name + '/' + packageInfo.version + '/';
+ outdir = path.join(outdir, packageInfo.name, packageInfo.version);
}
fs.mkPath(outdir);
// copy static files to outdir
- var fromDir = templatePath + '/static',
+ var fromDir = path.join(templatePath, 'static'),
staticFiles = fs.ls(fromDir, 3);
staticFiles.forEach(function(fileName) {
- var toDir = fs.toDir(fileName.replace(fromDir, outdir));
+ var toDir = fs.toDir( fileName.replace(fromDir, outdir) );
fs.mkPath(toDir);
fs.copyFileSync(fileName, toDir);
});
- data.forEach(function(doclet) {
+ data().each(function(doclet) {
var url = helper.createLink(doclet);
helper.registerLink(doclet.longname, url);
});
- data.forEach(function(doclet) {
+ data().each(function(doclet) {
var url = helper.longnameToUrl[doclet.longname];
if (url.indexOf('#') > -1) {
@@ -272,7 +287,7 @@ exports.publish = function(taffyData, opts, tutorials) {
});
// do this after the urls have all been generated
- data.forEach(function(doclet) {
+ data().each(function(doclet) {
doclet.ancestors = getAncestorLinks(doclet);
doclet.signature = '';
@@ -302,47 +317,45 @@ exports.publish = function(taffyData, opts, tutorials) {
view.nav = buildNav(members);
for (var longname in helper.longnameToUrl) {
- if (hasOwnProp.call(helper.longnameToUrl, longname)) {
+ if ( hasOwnProp.call(helper.longnameToUrl, longname) ) {
// reuse 'members', which speeds things up a bit
- var classes = new (require('typicaljoe/taffy'))(members.classes);
- classes = helper.find(classes, {longname: longname}, false);
+ var classes = taffy(members.classes);
+ classes = helper.find(classes, {longname: longname});
if (classes.length) {
generate('Class: ' + classes[0].longname, classes, helper.longnameToUrl[longname]);
}
- var modules = new (require('typicaljoe/taffy'))(members.modules);
- modules = helper.find(modules, {longname: longname}, false);
+ var modules = taffy(members.modules);
+ modules = helper.find(modules, {longname: longname});
if (modules.length) {
generate('Module: ' + modules[0].longname, modules, helper.longnameToUrl[longname]);
}
- var namespaces = new (require('typicaljoe/taffy'))(members.namespaces);
- namespaces = helper.find(namespaces, {longname: longname}, false);
+ var namespaces = taffy(members.namespaces);
+ namespaces = helper.find(namespaces, {longname: longname});
if (namespaces.length) {
generate('Namespace: ' + namespaces[0].longname, namespaces, helper.longnameToUrl[longname]);
}
- var mixins = new (require('typicaljoe/taffy'))(members.mixins);
- mixins = helper.find(mixins, {longname: longname}, false);
+ var mixins = taffy(members.mixins);
+ mixins = helper.find(mixins, {longname: longname});
if (mixins.length) {
generate('Mixin: ' + mixins[0].longname, mixins, helper.longnameToUrl[longname]);
}
- var externals = new (require('typicaljoe/taffy'))(members.externals);
- externals = helper.find(externals, {longname: longname}, false);
+ var externals = taffy(members.externals);
+ externals = helper.find(externals, {longname: longname});
if (externals.length) {
generate('External: ' + externals[0].longname, externals, helper.longnameToUrl[longname]);
}
}
}
- if (members.globals.length) {
- generate('Global', [{kind: 'globalobj'}], 'global.html');
- }
+ if (members.globals.length) { generate('Global', members.globals, 'global.html'); }
// index page displays information from package.json and lists files
- var files = find({kind: 'file'}, false),
- packages = find({kind: 'package'}, false);
+ var files = find({kind: 'file'}),
+ packages = find({kind: 'package'});
generate('Index',
packages.concat(
@@ -359,7 +372,7 @@ exports.publish = function(taffyData, opts, tutorials) {
children: tutorial.children
};
- var tutorialPath = outdir + '/' + filename,
+ var tutorialPath = path.join(outdir, filename),
html = view.render('tutorial.tmpl', tutorialData);
// yes, you can use {@link} in tutorials too!
diff --git a/doc/template/static/styles/apidoc.css b/doc/template/static/styles/jsdoc-default.css
similarity index 91%
rename from doc/template/static/styles/apidoc.css
rename to doc/template/static/styles/jsdoc-default.css
index 4190811f54..47b2756c09 100644
--- a/doc/template/static/styles/apidoc.css
+++ b/doc/template/static/styles/jsdoc-default.css
@@ -1,9 +1,11 @@
-html {
+html
+{
overflow: auto;
background-color: #fff;
}
-body {
+body
+{
font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans serif;
line-height: 130%;
color: #000;
@@ -22,7 +24,8 @@ a:active {
color: #444;
}
-header {
+header
+{
display: block;
padding: 6px 4px;
}
@@ -41,7 +44,8 @@ header {
width: 100%;
}
-section {
+section
+{
display: block;
background-color: #fff;
@@ -62,7 +66,8 @@ section {
font-weight: lighter;
}
-nav {
+nav
+{
display: block;
float: left;
margin-left: -230px;
@@ -114,21 +119,24 @@ footer {
font-size: 90%;
}
-h1 {
+h1
+{
font-size: 200%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 6px 0 9px 0;
}
-h2 {
+h2
+{
font-size: 170%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 6px 0 3px 0;
}
-h3 {
+h3
+{
font-size: 150%;
font-weight: bold;
letter-spacing: -0.01em;
@@ -136,7 +144,8 @@ h3 {
margin: 6px 0 3px 0;
}
-h4 {
+h4
+{
font-size: 130%;
font-weight: bold;
letter-spacing: -0.01em;
@@ -145,14 +154,16 @@ h4 {
color: #A35A00;
}
-h5, .container-overview .subsection-title {
+h5, .container-overview .subsection-title
+{
font-size: 120%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 8px 0 3px -16px;
}
-h6 {
+h6
+{
font-size: 100%;
letter-spacing: -0.01em;
margin: 6px 0 3px 0;
@@ -162,18 +173,19 @@ h6 {
.protected {
display: none;
}
-
dt.tag-source, dd.tag-source {
display: none;
}
.ancestors { color: #999; }
-.ancestors a {
+.ancestors a
+{
color: #999 !important;
text-decoration: none;
}
-.important {
+.important
+{
font-weight: bold;
color: #950B02;
}
@@ -203,19 +215,22 @@ dt.tag-source, dd.tag-source {
margin-top: 1em;
}
-.code-caption {
+.code-caption
+{
font-style: italic;
font-family: Palatino, 'Palatino Linotype', serif;
font-size: 107%;
margin: 0;
}
-.prettyprint {
+.prettyprint
+{
border: 1px solid #ddd;
width: 80%;
}
-.prettyprint code {
+.prettyprint code
+{
font-family: Consolas, 'Lucida Console', Monaco, monospace;
font-size: 100%;
line-height: 18px;
@@ -227,7 +242,8 @@ dt.tag-source, dd.tag-source {
border-left: 3px #ddd solid;
}
-.params, .props {
+.params, .props
+{
border-spacing: 0;
border: 0;
border-collapse: collapse;
@@ -239,7 +255,8 @@ dt.tag-source, dd.tag-source {
font-size: 100%;
}
-.params td, .params th, .props td, .props th {
+.params td, .params th, .props td, .props th
+{
border: 1px solid #ddd;
margin: 0px;
text-align: left;
@@ -248,12 +265,14 @@ dt.tag-source, dd.tag-source {
display: table-cell;
}
-.params thead tr, .props thead tr {
+.params thead tr, .props thead tr
+{
background-color: #ddd;
font-weight: bold;
}
-.params .params thead tr, .props .props thead tr {
+.params .params thead tr, .props .props thead tr
+{
background-color: #fff;
font-weight: bold;
}
diff --git a/doc/template/tmpl/details.tmpl b/doc/template/tmpl/details.tmpl
index 18ef9d0d98..981a6d5a53 100644
--- a/doc/template/tmpl/details.tmpl
+++ b/doc/template/tmpl/details.tmpl
@@ -1,4 +1,7 @@
-
+
diff --git a/doc/template/tmpl/examples.tmpl b/doc/template/tmpl/examples.tmpl
index 7197063074..23384c9d9d 100644
--- a/doc/template/tmpl/examples.tmpl
+++ b/doc/template/tmpl/examples.tmpl
@@ -1,4 +1,5 @@
diff --git a/doc/template/tmpl/exceptions.tmpl b/doc/template/tmpl/exceptions.tmpl
index 6edf06181e..660afa21b6 100644
--- a/doc/template/tmpl/exceptions.tmpl
+++ b/doc/template/tmpl/exceptions.tmpl
@@ -1,4 +1,7 @@
-
+
diff --git a/doc/template/tmpl/fires.tmpl b/doc/template/tmpl/fires.tmpl
index 24b07ce84e..21cfd229cd 100644
--- a/doc/template/tmpl/fires.tmpl
+++ b/doc/template/tmpl/fires.tmpl
@@ -1,3 +1,4 @@
+
\ No newline at end of file
diff --git a/doc/template/tmpl/layout.tmpl b/doc/template/tmpl/layout.tmpl
index f73d09197d..91857f98e7 100644
--- a/doc/template/tmpl/layout.tmpl
+++ b/doc/template/tmpl/layout.tmpl
@@ -2,7 +2,7 @@
- OpenLayers
+ OpenLayers:
@@ -10,7 +10,7 @@
-
+
diff --git a/doc/template/tmpl/mainpage.tmpl b/doc/template/tmpl/mainpage.tmpl
index 859a1ee01e..64e9e5943a 100644
--- a/doc/template/tmpl/mainpage.tmpl
+++ b/doc/template/tmpl/mainpage.tmpl
@@ -1,4 +1,5 @@
diff --git a/doc/template/tmpl/members.tmpl b/doc/template/tmpl/members.tmpl
index edd304f6b5..56b6f029dd 100644
--- a/doc/template/tmpl/members.tmpl
+++ b/doc/template/tmpl/members.tmpl
@@ -1,12 +1,12 @@
-
-
+
+
-
+
diff --git a/doc/template/tmpl/method.tmpl b/doc/template/tmpl/method.tmpl
index 226f9040b6..c448eb11fd 100644
--- a/doc/template/tmpl/method.tmpl
+++ b/doc/template/tmpl/method.tmpl
@@ -1,4 +1,7 @@
-
+
diff --git a/doc/template/tmpl/params.tmpl b/doc/template/tmpl/params.tmpl
index b9ab2019d5..50a8ff2110 100644
--- a/doc/template/tmpl/params.tmpl
+++ b/doc/template/tmpl/params.tmpl
@@ -1,5 +1,5 @@
Type
+
+ Argument
+
+
Default
@@ -73,6 +77,18 @@
+
+
+
+ <optional>
+
+
+
+ <nullable>
+
+
+
+
diff --git a/doc/template/tmpl/properties.tmpl b/doc/template/tmpl/properties.tmpl
index 0c700aba4a..dfa6ee0e99 100644
--- a/doc/template/tmpl/properties.tmpl
+++ b/doc/template/tmpl/properties.tmpl
@@ -1,5 +1,5 @@
+
diff --git a/doc/template/tmpl/type.tmpl b/doc/template/tmpl/type.tmpl
index 6c96d6b762..db8194d6d0 100644
--- a/doc/template/tmpl/type.tmpl
+++ b/doc/template/tmpl/type.tmpl
@@ -1,4 +1,5 @@