Skip to content

Commit

Permalink
Merge pull request #4743 from camptocamp/api_fixes
Browse files Browse the repository at this point in the history
Use single tile WMS for the overlays
  • Loading branch information
fredj committed Mar 13, 2019
2 parents 3c53c31 + cdb85be commit 3956b55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 6 additions & 5 deletions api/src/Themes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import WMTSCapabilities from 'ol/format/WMTSCapabilities.js';
import TileWMS from 'ol/source/TileWMS.js';
import ImageWMS from 'ol/source/ImageWMS.js';
import WMTS, {optionsFromCapabilities} from 'ol/source/WMTS.js';
import TileLayer from 'ol/layer/Tile.js';
import ImageLayer from 'ol/layer/Image.js';

import constants from './constants.js';

Expand Down Expand Up @@ -30,7 +31,7 @@ let overlayDefPromise;

/**
* @hidden
* @returns {Promise<Array<TileLayer>>} Promise
* @returns {Promise<Array<TileLayer|ImageLayer>>} Promise
*/
export function getBackgroundLayers() {
return getThemesPromise().then((themes) => {
Expand Down Expand Up @@ -155,12 +156,12 @@ export function getOverlayLayers(layerNames) {
/**
* @param {import('gmf/themes.js').GmfLayerWMS} config Layer config (i.e. gmf layer node)
* @param {import('gmf/themes.js').GmfOgcServer} ogcServer OGC server configuration used to create the layer.
* @return {Promise<TileLayer>} Promise.
* @return {Promise<ImageLayer>} Promise.
* @hidden
*/
export function createWMSLayer(config, ogcServer) {
const layer = new TileLayer({
source: new TileWMS({
const layer = new ImageLayer({
source: new ImageWMS({
url: ogcServer.url,
projection: undefined, // should be removed in next OL version
params: {
Expand Down
2 changes: 0 additions & 2 deletions api/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import EPSG21781 from '@geoblocks/proj/src/EPSG_21781.js';
import EPSG2056 from '@geoblocks/proj/src/EPSG_2056.js';


export default {
themesUrl: undefined,
projection: EPSG21781,
supportedProjections: [EPSG21781, EPSG2056],
resolutions: [250, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.25, 0.1, 0.05],
extent: [420000, 30000, 660000, 350000],
/**
Expand Down

0 comments on commit 3956b55

Please sign in to comment.