I want to define parameters

Discussions about onboard maps, online maps and Map Creators
baegas
Posts: 9
Joined: Tue Apr 28, 2020 12:23 pm

I want to define parameters

Post by baegas » Sat May 29, 2021 11:27 am

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?

Online
Psyberia-Support
Site Admin
Posts: 4898
Joined: Wed Apr 14, 2010 9:41 pm

Re: I want to define parameters

Post by Psyberia-Support » Tue Jun 01, 2021 2:41 pm

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.
Do you like AlpineQuest ? Leave a small comment on Google Play !

baegas
Posts: 9
Joined: Tue Apr 28, 2020 12:23 pm

Re: I want to define parameters

Post by baegas » Wed Jun 02, 2021 1:51 am

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

Post Reply