Page 1 of 1

I want to define parameters

Posted: Sat May 29, 2021 11:27 am
by baegas
Hello!

Code: Select all

<![CDATA[http://api.mapbox.com/styles/v1/mapbox/light-v10/12345789/{z}/{x}/{y}]]>
If there is an online map like the one above, the number 123456789 changes once a month.

The URL that changes once a month is

Code: Select all

http://api.mapbox.com/styles/v1/mapbox/@2x.png?mt=kb.bbb.vv
If it's like this

Code: Select all

<![CDATA[http://api.mapbox.com/styles/v1/mapbox/light-v10/???/{z}/{x}/{y}]]>
/???/ How can I define this part as parameters?

Re: I want to define parameters

Posted: Tue Jun 01, 2021 2:41 pm
by Psyberia-Support
Hi,
If I correctly understand, you want to define a parameter, using the text that come from a remote URL?
Right now this is not possible.
I'm not sure if I will be able to work on this, this is very specific, I guess for this map only. When does the app is supposed to update the parameter value?

I think the solution using what is existing is to use a static parameter at the start of the file (before the first <source>):

Code: Select all

<param name="kb-bbb-vv">12345789</param>
Then use is like this in your map:

Code: Select all

<![CDATA[http://api.mapbox.com/styles/v1/mapbox/light-v10/{$param:kb-bbb-vv}/{z}/{x}/{y}]]>
And once in a while edit the variable value with your text editor.

Re: I want to define parameters

Posted: Wed Jun 02, 2021 1:51 am
by baegas
Hello

thanks for the kind reply
It's a pity that it's not supported, but I think it's okay to use static parameters.
Thank you again
Have a nice day