Hi everyone,

so I'm currently trying to set up a custom tile source that requires a 
timestamp in the tile url. Manually changing that timestamp works but since 
changes happen in the minute range it's not really a feasible solution.
I read up on beanshell and figured it shouldn't be too hard but the problem 
I run into is that any function that would be able to generate a timestamp 
fails. I also played around with some imports to no avail. For some reason 
it seems nothing is known about "higher level" java functions.
Logcat when using System.currentTimeMillis():
2019-05-20 18:22:53.738 19761-19782/? E/net.osmand: TileSourceManager 
Sourced file: inline evaluation of: ``getTileUrl(6,35,26);'' : Typed 
variable declaration : Attempt to resolve method: currentTimeMillis() on 
undefined variable or class name: System
    Sourced file: inline evaluation of: ``getTileUrl(6,35,26);'' : Typed 
variable declaration : Attempt to resolve method: currentTimeMillis() on 
undefined variable or class name: System : at Line: 1 : in file: inline 
evaluation of: ``String getTileUrl(int z, int x, int y) {int time= (int)(
System.currentTimeMillis . . . '' : System .currentTimeMillis ( ) 


The .metainfo is currently looking something like this:
[rule]
beanshell
[url_template]
String getTileUrl(int z, int x, int y) {int time = System.currentTimeMillis
()/1000; time = time-time %600; return "https://my.tile.cache/"+time+"/"+z+
"/"+x+"/"+y+"/tile.png";}
[ext]
png
[min_zoom]
1
[max_zoom]
18
[tile_size]
256
[img_density]
16
[avg_img_size]
18000

So I've run out of ideas what to try and started wondering if it is at all 
possible what I'm trying to do.
Any help or definitive answer would be appreciated.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osmand+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osmand/ccdfc847-2ec0-4331-a707-8c0bc8e9e8d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to