Hi, Your question is actually not related to OpenLayers but to Javascript in general. A string representing a JSON object can easily be transformed into an actual object using `JSON.parse(stringJson)`. This will throw in case of invalid syntax.
Cheers, -- *camptocamp* INNOVATIVE SOLUTIONS BY OPEN SOURCE EXPERTS *Olivier Guyot* Geospatial Developer +33 4 58 48 20 28 On Fri, Apr 16, 2021 at 1:06 PM GIP ATGERI via OpenLayers Dev < [email protected]> wrote: > Hello > > We want to ask the OpenLayers community about the updateParams method of > the TileWMS object. > > The problem we have is the following: > > We need to use a variable which contains JSON in the updateParams > method. > > It seems this method does not allow it. > > Example that does not work: > > (here newObjSourceWMS is an object TileWMS) > > let param="{'test_new_param' : 'value_param'}"; > > newObjSourceWMS.updateParams( param); > > > > Example that does work: > > newObjSourceWMS.updateParams( {'test_new_param': 'value_param'}); > > > Is there a possible solution to this problem? > > Or how can we ask for an improvement of this method? > > > Thanks for helping. > > > > -- > You received this message because you are subscribed to the Google Groups > "OpenLayers Dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/openlayers-dev/00e0b62f-481d-4266-8e9d-56c7818a85afn%40googlegroups.com > <https://groups.google.com/d/msgid/openlayers-dev/00e0b62f-481d-4266-8e9d-56c7818a85afn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "OpenLayers Dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/openlayers-dev/CAOSogobpb8GJfWzw-JORyesN%2BEfa%3DjuV7UYR3C0VSWcoBgtpPQ%40mail.gmail.com.
