Update type annotations in examples

This commit is contained in:
Tim Schaub
2018-05-07 15:41:33 -06:00
parent ae55814875
commit cfe88663aa
9 changed files with 13 additions and 13 deletions

View File

@@ -114,7 +114,7 @@ const resetBlendModeFromSelect = function(evt) {
/**
* Bind the pre- and postcompose handlers to the passed layer.
*
* @param {ol.layer.Vector} layer The layer to bind the handlers to.
* @param {module:ol/layer/Vector} layer The layer to bind the handlers to.
*/
const bindLayerListeners = function(layer) {
layer.on('precompose', setBlendModeFromSelect);
@@ -125,7 +125,7 @@ const bindLayerListeners = function(layer) {
/**
* Unind the pre- and postcompose handlers to the passed layers.
*
* @param {ol.layer.Vector} layer The layer to unbind the handlers from.
* @param {module:ol/layer/Vector} layer The layer to unbind the handlers from.
*/
const unbindLayerListeners = function(layer) {
layer.un('precompose', setBlendModeFromSelect);

View File

@@ -70,7 +70,7 @@ const style = new Style({
*
* @param {module:ol/Feature~Feature} feature The feature to style.
* @param {number} resolution Resolution.
* @return {ol.style.Style} The style to use for the feature.
* @return {module:ol/style/Style} The style to use for the feature.
*/
const getStackedStyle = function(feature, resolution) {
const id = feature.getId();

View File

@@ -87,6 +87,6 @@ const centerlausanne = document.getElementById('centerlausanne');
centerlausanne.addEventListener('click', function() {
const feature = source.getFeatures()[1];
const point = /** @type {module:ol/geom/Point~Point} */ (feature.getGeometry());
const size = /** @type {ol.Size} */ (map.getSize());
const size = /** @type {module:ol/size~Size} */ (map.getSize());
view.centerOn(point.getCoordinates(), size, [570, 500]);
}, false);

View File

@@ -17,7 +17,7 @@ const app = {};
/**
* @constructor
* @extends {ol.interaction.Pointer}
* @extends {module:ol/interaction/Pointer}
*/
app.Drag = function() {
@@ -29,7 +29,7 @@ app.Drag = function() {
});
/**
* @type {ol.Pixel}
* @type {module:ol~Pixel}
* @private
*/
this.coordinate_ = null;

4
examples/d3.js vendored
View File

@@ -31,10 +31,10 @@ d3.json('data/topojson/us.json', function(error, us) {
/**
* This function uses d3 to render the topojson features to a canvas.
* @param {ol.Extent} extent Extent.
* @param {module:ol/extent~Extent} extent Extent.
* @param {number} resolution Resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {ol.Size} size Size.
* @param {module:ol/size~Size} size Size.
* @param {module:ol/proj/Projection~Projection} projection Projection.
* @return {HTMLCanvasElement} A canvas element.
*/

View File

@@ -64,7 +64,7 @@ exportButton.addEventListener('click', function() {
const dim = dims[format];
const width = Math.round(dim[0] * resolution / 25.4);
const height = Math.round(dim[1] * resolution / 25.4);
const size = /** @type {ol.Size} */ (map.getSize());
const size = /** @type {module:ol/size~Size} */ (map.getSize());
const extent = map.getView().calculateExtent(size);
const source = raster.getSource();

View File

@@ -52,7 +52,7 @@ let helpTooltipElement;
/**
* Overlay to show the help messages.
* @type {ol.Overlay}
* @type {module:ol/Overlay}
*/
let helpTooltip;
@@ -66,7 +66,7 @@ let measureTooltipElement;
/**
* Overlay to show the measurement.
* @type {ol.Overlay}
* @type {module:ol/Overlay}
*/
let measureTooltip;

View File

@@ -3,7 +3,7 @@ layout: example.html
title: XYZ Retina Tiles
shortdesc: Example of Retina / HiDPI mercator tiles (512x512px) available as XYZ.
docs: >
The ol.source.XYZ must contain `tilePixelRatio` parameter. The tiles were prepared from a GeoTIFF file with [MapTiler](http://www.maptiler.com/).
The XYZ source accepts a `tilePixelRatio` option. The tiles were prepared from a GeoTIFF file with [MapTiler](http://www.maptiler.com/).
tags: "retina, hidpi, xyz, maptiler, @2x, devicePixelRatio"
---
<div id="map" class="map"></div>

View File

@@ -9,7 +9,7 @@ import OSM from '../src/ol/source/OSM.js';
* Helper method for map-creation.
*
* @param {string} divId The id of the div for the map.
* @return {ol.PluggableMap} The map instance.
* @return {module:ol/PluggableMap} The map instance.
*/
function createMap(divId) {
const source = new OSM();