<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello Pascal,<div>well, unfortunately at this time this is not quite easy to achieve in MapStore2.</div><div><br></div><div>There are plans to introduce a generic "TMS" Provider in the next release, but at this time only configured providers are supported. See the list here</div><div><br></div><div><a href="https://mapstore.readthedocs.io/en/latest/developer-guide/maps-configuration/#providers-and-variants">https://mapstore.readthedocs.io/en/latest/developer-guide/maps-configuration/#providers-and-variants</a> </div><div><br></div><div>In order to add your own provider, you should roughly follow those steps:</div><div><br></div><div>1) download the geonode-mapstore-client source code</div><div><br></div><div>git clone <a href="https://github.com/geosolutions-it/geonode-mapstore-client.git">https://github.com/geosolutions-it/geonode-mapstore-client.git</a></div><div><br></div><div>2) go to folder geonode-mapstore-client/geonode_mapstore_client/client and run</div><div><br></div><div>git submodule update --recursive<br></div><div><br></div><div>3) edit the file ConfigProvider.js and add your new provider</div><div><br></div><div>vim MapStore2/web/client/utils/ConfigProvider.js<br></div><div><br></div><div>4) rebuild the library; from geonode-mapstore-client/geonode_mapstore_client/client</div><div><br></div><div>npm run compile<br></div><div><br></div><div>5) install your local version of the python library; from geonode-mapstore-client</div><div><br></div><div>pip install -e .</div><div><br></div><div>6) go back to geonode source folder and run </div><div><br></div><div>python manage.py collectstatic</div><div><br></div><div>7) restart the server after having updated the MS2_DEFAULT_BACKGROUNDs config accordingly</div><div><br></div><div>Hope this helps.</div><div><br></div><div>By the way, the same procedure applies whenever you would like to update/customize MapStore2 somehow.</div><div><br></div><div>Regards,</div><div>Alessio.</div><div><br></div><div><br></div><div> <br></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 26 apr 2019 alle ore 12:01 Pascal Coulon <<a href="mailto:Pascal.Coulon@scisys.co.uk">Pascal.Coulon@scisys.co.uk</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




  
<div lang="EN-GB">
<div class="gmail-m_308607887353149828WordSection1">
<p class="MsoNormal">All,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">We have decided to use MapStore2 as the main viewer in Geonode (2.10RC4). We would like to set-up a custom WMTS or XYZ (tile) layer for the background map. We are based in the UK and we would need to use the Ordnance Survey OGC feed for
 this. <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In our settings.py we have set-up the following config.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">DEFAULT_MAP_CRS = "EPSG:3857"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">if 'geonode_mapstore_client' not in INSTALLED_APPS:<u></u><u></u></p>
<p class="MsoNormal">    INSTALLED_APPS += (<u></u><u></u></p>
<p class="MsoNormal">        'mapstore2_adapter',<u></u><u></u></p>
<p class="MsoNormal">        'geonode_mapstore_client',)<u></u><u></u></p>
<p class="MsoNormal">GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY = 'mapstore'  # DEPRECATED use HOOKSET instead<u></u><u></u></p>
<p class="MsoNormal">GEONODE_CLIENT_HOOKSET = "geonode_mapstore_client.hooksets.MapStoreHookSet"<u></u><u></u></p>
<p class="MsoNormal">MAPSTORE_DEBUG = False<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">### The key to access OS API as obfuscated. #####<u></u><u></u></p>
<p class="MsoNormal">DEFAULT_MS2_BACKGROUNDS = [<u></u><u></u></p>
<p class="MsoNormal">        <u></u><u></u></p>
<p class="MsoNormal">         {<u></u><u></u></p>
<p class="MsoNormal">             "type":"wmts",<u></u><u></u></p>
<p class="MsoNormal">             "title":"Ordnance Survey",<u></u><u></u></p>
<p class="MsoNormal">              "allowedSRS": {<u></u><u></u></p>
<p class="MsoNormal">              "EPSG:3857": True<u></u><u></u></p>
<p class="MsoNormal">              },<u></u><u></u></p>
<p class="MsoNormal">             "url": [<u></u><u></u></p>
<p class="MsoNormal">              "<a href="https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/zxy/EPSG:3857/Outdoor" target="_blank">https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/zxy/EPSG:3857/Outdoor</a> 3857/${z}/${x}/${y}.png?key=xxxxx"<u></u><u></u></p>
<p class="MsoNormal">             ],<u></u><u></u></p>
<p class="MsoNormal">             "visibility": False,<u></u><u></u></p>
<p class="MsoNormal">             "group":"background",<u></u><u></u></p>
<p class="MsoNormal">              "matrixIds": [<u></u><u></u></p>
<p class="MsoNormal">                  "EPSG:3857",<u></u><u></u></p>
<p class="MsoNormal">              ],<u></u><u></u></p>
<p class="MsoNormal">              "tileMatrixSet": [                     <u></u><u></u></p>
<p class="MsoNormal">                 ],<u></u><u></u></p>
<p class="MsoNormal"><span lang="FR">             "capabilitiesURL": "<a href="https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/wmts?Request=GetCapabilities&key=XXXXXXXXXXXX" target="_blank">https://api2.ordnancesurvey.co.uk/mapping_api/v1/service/wmts?Request=GetCapabilities&key=XXXXXXXXXXXX</a>"<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR">        </span>},<u></u><u></u></p>
<p class="MsoNormal">        <u></u><u></u></p>
<p class="MsoNormal">   <u></u><u></u></p>
<p class="MsoNormal">    ]<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">MAPSTORE_BASELAYERS = DEFAULT_MS2_BACKGROUNDS<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The background data from OS does not get properly set and we get some JavaScript errors that lead us to believe that we are not setting the background layer the proper way.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any help or recommendation would be gratefully received.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Pascal<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="gmail-m_308607887353149828gfidisc.scisys.co.uk" id="gmail-m_308607887353149828gfidisc.scisys.co.uk"></p><a id="gmail-m_308607887353149828gfidisc.scisys.co.uk" title="gfidisc.scisys.co.uk" href="http://gfidisc.scisys.co.uk" class="gmail-m_308607887353149828gfidisc.scisys.co.uk" style="text-decoration:none" target="_blank"></a><u></u><h1 class="gmail-m_308607887353149828gfidisc.scisys.co.uk"></h1><p><span style="color:rgb(0,0,255);font-family:Tahoma;font-size:small"> </span></p>
<div align="left"><span style="color:rgb(128,128,128);font-family:Arial;font-size:small">SCISYS UK Limited. Registered in England and Wales No. 4373530.</span></div>
<div align="left"><span style="color:rgb(128,128,128);font-family:Arial;font-size:small">Registered Office: Methuen Park, Chippenham, Wiltshire SN14 0GB, UK.</span></div>
<div align="left"> </div>
<div align="left"><span class="gmail-m_308607887353149828400184714-12042007"><span style="color:rgb(0,0,0)"><span style="font-size:7pt;font-family:Tahoma"><span style="font-size:xx-small"><span style="color:rgb(0,128,0)"><span style="font-family:Arial">Before printing, <span class="gmail-m_308607887353149828296245114-12042007">please </span>think about the environment<span class="gmail-m_308607887353149828296245114-12042007">.</span></span></span></span></span></span></span></div><p class="gmail-m_308607887353149828gfidisc.scisys.co.uk" id="gmail-m_308607887353149828gfidisc.scisys.co.uk"></p><a id="gmail-m_308607887353149828gfidisc.scisys.co.uk" title="gfidisc.scisys.co.uk" href="http://gfidisc.scisys.co.uk" class="gmail-m_308607887353149828gfidisc.scisys.co.uk" style="text-decoration:none" target="_blank"></a><u></u><h1 class="gmail-m_308607887353149828gfidisc.scisys.co.uk"></h1></div>

_______________________________________________<br>
geonode-users mailing list<br>
<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geonode-users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><span><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Arial;font-size:11pt;white-space:pre-wrap">==</span><br></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">GeoServer Professional Services from the experts! Visit <a href="http://goo.gl/it488V" target="_blank">http://goo.gl/it488V</a> for more information.</span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">==</span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Ing. Alessio Fabiani</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">@alfa7691</span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Founder/Technical Lead</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">GeoSolutions S.A.S.</span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Via di Montramito 3/A - </span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">55054  Massarosa (LU) - </span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Italy</span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">phone: +39 0584 962313</span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">fax:     +39 0584 1660272</span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">mob:   +39 331 6233686</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(34,34,34);background-color:rgb(255,255,255);font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">-------------------------------------------------------</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:italic;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:italic;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:italic;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.</span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:italic;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br></span></p></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div>