Merge pull request #4769 from fredj/osm_opaque
Add opaque option to olx.source.OSMOptions
This commit is contained in:
@@ -3,8 +3,7 @@ layout: example.html
|
|||||||
title: Localized OpenStreetMap
|
title: Localized OpenStreetMap
|
||||||
shortdesc: Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.
|
shortdesc: Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.
|
||||||
docs: >
|
docs: >
|
||||||
<p>The base layer is <a href="http://www.opencyclemap.org/">OpenCycleMap</a> with an overlay from <a href="http://www.openseamap.org/">OpenSeaMap</a>. The OpenSeaMap tile server
|
<p>The base layer is <a href="http://www.opencyclemap.org/">OpenCycleMap</a> with an overlay from <a href="http://www.openseamap.org/">OpenSeaMap</a>.
|
||||||
does not support <a href="http://enable-cors.org/">CORS</a> headers.</p>
|
tags: "localized-openstreetmap, openseamap, openstreetmap"
|
||||||
tags: "cors, localized-openstreetmap, openseamap, openstreetmap"
|
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ var openSeaMapLayer = new ol.layer.Tile({
|
|||||||
}),
|
}),
|
||||||
ol.source.OSM.ATTRIBUTION
|
ol.source.OSM.ATTRIBUTION
|
||||||
],
|
],
|
||||||
crossOrigin: null,
|
opaque: false,
|
||||||
url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
|
url: 'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4573,6 +4573,7 @@ olx.source.TileDebugOptions.prototype.wrapX;
|
|||||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||||
* crossOrigin: (null|string|undefined),
|
* crossOrigin: (null|string|undefined),
|
||||||
* maxZoom: (number|undefined),
|
* maxZoom: (number|undefined),
|
||||||
|
* opaque: (boolean|undefined),
|
||||||
* reprojectionErrorThreshold: (number|undefined),
|
* reprojectionErrorThreshold: (number|undefined),
|
||||||
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
|
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
|
||||||
* url: (string|undefined),
|
* url: (string|undefined),
|
||||||
@@ -4612,6 +4613,14 @@ olx.source.OSMOptions.prototype.crossOrigin;
|
|||||||
olx.source.OSMOptions.prototype.maxZoom;
|
olx.source.OSMOptions.prototype.maxZoom;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the layer is opaque. Default is `true`.
|
||||||
|
* @type {boolean|undefined}
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
olx.source.OSMOptions.prototype.opaque;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum allowed reprojection error (in pixels). Default is `0.5`.
|
* Maximum allowed reprojection error (in pixels). Default is `0.5`.
|
||||||
* Higher values can increase reprojection performance, but decrease precision.
|
* Higher values can increase reprojection performance, but decrease precision.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ ol.source.OSM = function(opt_options) {
|
|||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
attributions: attributions,
|
attributions: attributions,
|
||||||
crossOrigin: crossOrigin,
|
crossOrigin: crossOrigin,
|
||||||
opaque: true,
|
opaque: options.opaque !== undefined ? options.opaque : true,
|
||||||
maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19,
|
maxZoom: options.maxZoom !== undefined ? options.maxZoom : 19,
|
||||||
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
|
||||||
tileLoadFunction: options.tileLoadFunction,
|
tileLoadFunction: options.tileLoadFunction,
|
||||||
|
|||||||
Reference in New Issue
Block a user