KlausBenndorf / guide4you

A configurable web client for geo-applications. Uses OpenLayers 5. Optimized for mobile devices.
MIT License
15 stars 5 forks source link

Adding WMS layer: cannot localise 'LayerSelector featureInfo show': Not in dictionary #359

Closed SamOxyPlot closed 3 years ago

SamOxyPlot commented 3 years ago

Hello

Can someone please help me out with adding an WMS layer (from GeoServer) via the Guide4You library? Is there a sample available?

Adding the code below results in this error: “g4u.js?v=163:1024 Cannot localise 'LayerSelector featureInfo show': Not in dictionary”

var layerConfig = {
   "id": "XXX",
   "title": "XXX",
   "code": "XXX",
   "type": "WMS",
   "source": {
      "url": "REPLACED URL…/geoserver/XXX/ows?",
      "params": { 'LAYERS': 'XX:XX' },
      "serverType": 'geoserver',
      "crossOrigin": 'anonymous'
                  },
   "visible": true
}

var layer = map.get('api').addBaseLayer(layerConfig);

Thanks in advance!

Kind regards

simonseyock commented 3 years ago

Your l10n.json file seems to be missing the LayerSelector featureInfo show key.

In the repository it looks like this: https://github.com/KlausBenndorf/guide4you/blob/master/files/l10n.json.js#L158

simonseyock commented 3 years ago

You can use a tool like http://jsondiff.com/ to compare the json files (you find a 'compiled' one in the dist folder here: https://github.com/KlausBenndorf/guide4you/blob/master/dist/files/l10n.json)

SamOxyPlot commented 3 years ago

Thanks Simon. Problem solved!