@@ -61,6 +61,10 @@ const INTERVALS = [
|
||||
* longitudes. This function is called with the longitude as argument, and
|
||||
* should return a formatted string representing the longitude. By default,
|
||||
* labels are formatted as degrees, minutes, seconds and hemisphere.
|
||||
* @property {function(number):string} [latLabelFormatter] Label formatter for
|
||||
* latitudes. This function is called with the latitude as argument, and
|
||||
* should return a formatted string representing the latitude. By default,
|
||||
* labels are formatted as degrees, minutes, seconds and hemisphere.
|
||||
* @property {number} [lonLabelPosition=0] Longitude label position in fractions
|
||||
* (0..1) of view extent. 0 means at the bottom of the viewport, 1 means at the
|
||||
* top.
|
||||
@@ -85,7 +89,7 @@ const INTERVALS = [
|
||||
* Note that the default's `textBaseline` configuration will not work well for
|
||||
* `lonLabelPosition` configurations that position labels close to the top of
|
||||
* the viewport.
|
||||
* @param {module:ol/style/Text} [latLabelStyle] Latitude label text style.
|
||||
* @property {module:ol/style/Text} [latLabelStyle] Latitude label text style.
|
||||
* If not provided, the following style will be used:
|
||||
* ```js
|
||||
* new Text({
|
||||
|
||||
@@ -38,8 +38,8 @@ const MIN_RATIO = 0.1;
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {boolean} [collapsed=true] Whether the control should start collapsed
|
||||
* or not (expanded).
|
||||
* @property {string} [className='ol-overviewmap'] CSS class name.
|
||||
* @property {boolean} [collapsed=true] Whether the control should start collapsed or not (expanded).
|
||||
* @property {string|Element} [collapseLabel='«'] Text label to use for the
|
||||
* expanded overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.
|
||||
* @property {boolean} [collapsible=true] Whether the control can be collapsed or not.
|
||||
|
||||
@@ -66,7 +66,7 @@ inherits(GPX, XMLFeature);
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array.<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
|
||||
@@ -324,7 +324,7 @@ const GX_NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array.<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
|
||||
@@ -38,7 +38,7 @@ inherits(OSMXML, XMLFeature);
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array.<null>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [null];
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ inherits(OWS, XML);
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array.<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ inherits(WMSCapabilities, XML);
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array.<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
|
||||
@@ -33,7 +33,7 @@ inherits(WMTSCapabilities, XML);
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array.<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -43,7 +43,7 @@ const NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array.<null|string>}
|
||||
*/
|
||||
const OWS_NAMESPACE_URIS = [
|
||||
null,
|
||||
|
||||
@@ -135,7 +135,7 @@ inherits(DragAndDrop, Interaction);
|
||||
|
||||
|
||||
/**
|
||||
* @param {Event} event Event.
|
||||
* @param {DragEvent} event Event.
|
||||
* @this {module:ol/interaction/DragAndDrop}
|
||||
*/
|
||||
function handleDrop(event) {
|
||||
@@ -150,7 +150,7 @@ function handleDrop(event) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Event} event Event.
|
||||
* @param {DragEvent} event Event.
|
||||
*/
|
||||
function handleStop(event) {
|
||||
event.stopPropagation();
|
||||
|
||||
@@ -8,6 +8,7 @@ import GeometryType from '../geom/GeometryType.js';
|
||||
import {linearRingss as linearRingssCenter} from '../geom/flat/center.js';
|
||||
import {getInteriorPointOfArray, getInteriorPointsOfMultiArray} from '../geom/flat/interiorpoint.js';
|
||||
import {interpolatePoint} from '../geom/flat/interpolate.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
import {transform2D} from '../geom/flat/transform.js';
|
||||
import {create as createTransform, compose as composeTransform} from '../transform.js';
|
||||
|
||||
@@ -264,6 +265,7 @@ RenderFeature.prototype.getType = function() {
|
||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection.
|
||||
*/
|
||||
RenderFeature.prototype.transform = function(source, destination) {
|
||||
source = getProjection(source);
|
||||
const pixelExtent = source.getExtent();
|
||||
const projectedExtent = source.getWorldExtent();
|
||||
const scale = getHeight(projectedExtent) / getHeight(pixelExtent);
|
||||
|
||||
@@ -13,6 +13,10 @@ import {appendParams} from '../uri.js';
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {string} [url] The mapagent url.
|
||||
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
||||
* you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
* access pixel data with the Canvas renderer. See
|
||||
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail.
|
||||
* @property {number} [displayDpi=96] The display resolution.
|
||||
* @property {number} [metersPerUnit=1] The meters-per-unit value.
|
||||
* @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting
|
||||
|
||||
@@ -44,6 +44,8 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
|
||||
* @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
|
||||
* A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be
|
||||
* used instead of defining each one separately in the `urls` option.
|
||||
* @property {number} [transition] A duration for tile opacity
|
||||
* transitions in milliseconds. A duration of 0 disables the opacity transition.
|
||||
* @property {Array.<string>} [urls] An array of URL templates.
|
||||
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
|
||||
* When set to `false`, only one world
|
||||
|
||||
@@ -18,7 +18,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
||||
* @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
|
||||
* Higher values can increase reprojection performance, but decrease precision.
|
||||
* @property {number} [maxZoom=18] Optional max zoom level.
|
||||
* @property {number} [maxZoom=0] Optional min zoom level.
|
||||
* @property {number} [minZoom=0] Optional min zoom level.
|
||||
* @property {module:ol/tilegrid/TileGrid} [tileGrid] Tile grid.
|
||||
* @property {module:ol/Tile~LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is
|
||||
* ```js
|
||||
|
||||
@@ -335,10 +335,8 @@ export function makeSimpleNodeFactory(opt_nodeName, opt_namespaceURI) {
|
||||
if (nodeName === undefined) {
|
||||
nodeName = opt_nodeName;
|
||||
}
|
||||
let namespaceURI = opt_namespaceURI;
|
||||
if (opt_namespaceURI === undefined) {
|
||||
namespaceURI = node.namespaceURI;
|
||||
}
|
||||
|
||||
const namespaceURI = opt_namespaceURI !== undefined ? opt_namespaceURI : node.namespaceURI;
|
||||
return createElementNS(namespaceURI, /** @type {string} */ (nodeName));
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user