Skip to content

Commit

Permalink
Merge pull request #1103 from OpenGeoscience/improve-docs
Browse files Browse the repository at this point in the history
docs: Improve documentation.
  • Loading branch information
manthey authored Aug 5, 2021
2 parents a324c4c + 0a731f1 commit ce68ccc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
22 changes: 16 additions & 6 deletions src/quadFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@ var $ = require('jquery');
var inherit = require('./inherit');
var feature = require('./feature');

/**
* Quad position specification
*
* @typedef {object} geo.quadFeature.position
* @property {geo.geoPosition} [ul] Upper left coordinate.
* @property {geo.geoPosition} [ur] Upper right coordinate.
* @property {geo.geoPosition} [ll] Lower left coordinate.
* @property {geo.geoPosition} [lr] Lower right coordinate.
*/

/**
* Quad feature specification.
*
* @typedef {geo.feature.spec} geo.quadFeature.spec
* @extends geo.feature.spec
* @property {object|function} [position] Position of the quad. Default is
* (data). The position is an object which specifies the corners of the
* quad: ll, lr, ur, ul. At least two opposite corners must be specified.
* The corners do not have to physically correspond to the order specified,
* but rather correspond to that part of an image or video (if there is one).
* If a corner is unspecified, it will use the x coordinate from one adjacent
* @property {geo.quadFeature.position|function} [position] Position of the
* quad. Default is (data). The position specifies the corners of the quad:
* ll, lr, ur, ul. At least two opposite corners must be specified. The
* corners do not have to physically correspond to the order specified, but
* rather correspond to that part of an image or video (if there is one). If
* a corner is unspecified, it will use the x coordinate from one adjacent
* corner, the y coordinate from the other adjacent corner, and the average
* z value of those two corners. For instance, if ul is unspecified, it is
* {x: ll.x, y: ur.y}. Note that each quad is rendered as a pair of
Expand Down
2 changes: 1 addition & 1 deletion src/tileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var featureLayer = require('./featureLayer');
* If this is a string, a template url with {x}, {y}, {z}, and {s} as
* template variables. {s} picks one of the subdomains parameter and may
* contain a comma-separated list of subdomains.
* @property {string|string[]} [subdomain="abc"] Subdomains to use in template
* @property {string|string[]} [subdomains="abc"] Subdomains to use in template
* url strings. If a string, this is converted to a list before being passed
* to a url function.
* @property {string} [baseUrl=null] If defined, use the old-style base url
Expand Down
6 changes: 4 additions & 2 deletions tutorials/common/tutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ function process_block(selector) {
code[format].push('');
}
val = $('.CodeMirror', block).length ? $('.CodeMirror', block)[0].CodeMirror.getValue() : $('textarea', block).val();
code[format][step] = val.trim();
val = val.trim().replace(/ [ ]*\n/g, '\n');
code[format][step] = val;
});
$.each(code, function (key, list) {
var processed = '';
Expand Down Expand Up @@ -283,7 +284,8 @@ function start_keeper(alwaysKeep) {
defaultSrc = $('textarea', block).attr('defaultvalue'),
key = 'src' + (block.attr('step') !== '1' ? block.attr('step') : '');

var src = $('.CodeMirror', block).length ? $('.CodeMirror', block)[0].CodeMirror.getValue() : $('textarea', block).val().trim();
var src = $('.CodeMirror', block).length ? $('.CodeMirror', block)[0].CodeMirror.getValue() : $('textarea', block).val();
src = src.trim().replace(/ [ ]*\n/g, '\n');
if (src !== defaultSrc) {
var comp = btoa(pako.deflate(src, {to: 'string', level: 9, raw: true}));
/* instead of using regular base64, convert /, +, and = to ., -, and _
Expand Down

0 comments on commit ce68ccc

Please sign in to comment.