Skip to content

Commit

Permalink
[UPD] preview with apikey
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Oct 11, 2024
1 parent 6ebc5da commit 3a17511
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"process": "^0.11.10"
},
"dependencies": {
"mcutils": "github:IGNF-Ma-carte/mcutils",
"xlsx": "^0.18.5"
"mcutils": "github:IGNF-Ma-carte/mcutils"
},
"staticFiles": {
"staticPath": "./assets",
Expand Down
5 changes: 5 additions & 0 deletions page/onglet/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ ul.no-style {
background-color: #eee;
color: #999;
}

[data-role="menu-tab"] [data-formstyle] .ol-popup.popup-symbol .ol-popup ul {
max-height: min(20em, calc(100vh - 24em)) ;
}

10 changes: 5 additions & 5 deletions src/layerShop/addLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import addDrawLyr from './layers/addDrawLayer';
import addLayerGeoportail from './layers/addLayerGeoportail'
import charte from 'mcutils/charte/charte';

import '../../page/layerShop/addLayer.css'
import defaultLayersHTML from '../../page/layerShop/defaultLayers-page.html'
import extendedLayersHTML from '../../page/layerShop/extendedLayers-page.html'
import edugeoLayersHTML from '../../page/layerShop/edugeoLayers-page.html'

import loaders from './layers/layerLoader'
import { insertLayer } from './layers/loadLayer';
import Geoportail from 'mcutils/layer/Geoportail';
import carte from '../carte';

import '../../page/layerShop/addLayer.css'
import defaultLayersHTML from '../../page/layerShop/defaultLayers-page.html'
import extendedLayersHTML from '../../page/layerShop/extendedLayers-page.html'
import edugeoLayersHTML from '../../page/layerShop/edugeoLayers-page.html'

/** Dialog to add new file layer
*/
switcher.addControl(new Button({
Expand Down
8 changes: 8 additions & 0 deletions src/layerShop/layers/addLayerWMS.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ const wmsCapabilities = new WMSCapabilities({
});
switcher.addControl(wmsCapabilities, 'bottom');

// Check parameters on error to add apikey if needed (and more)
wmsCapabilities._img.addEventListener('error', () => {
const extra = wmsCapabilities._elements.input.value.split('?')[1]
if (wmsCapabilities._img.src.search(extra) < 0) {
wmsCapabilities._elements.preview.src = wmsCapabilities._img.src = wmsCapabilities._img.src + '&' + extra
}
})

// WMTS services
const wmtsServices = {
'cartes': {
Expand Down

0 comments on commit 3a17511

Please sign in to comment.