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 = '

Index

', 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