Hi Radek, With my rewrite, I try to address much more simpler hacks: allow user to configure their own server or public servers not referenced (yet) in viking. Currently, it is not possible to configure coordinates computation. But in the future, I expect to add a scriptable interface for MapSource. So, it will be possible to describe a MapSource with some python/scheme/JavaScript/... script.
I'm pleased to read that you have success with this new feature. This is exactly what I tried to address: enable people to change viking easily for their needs. Which server you contact/hack is your 'problem'. Thanks for this report. Le vendredi 31 juillet 2009 à 20:18 +0200, Radek Šťastný a écrit : > Hello Guilhem, > I'm just tring your code on user level - compiling was ok, and it > works fine, but now I'm trying to add custom map source which needs > some math operations to get the proper coordinates, and the zoom is > shifted also. I expect that it's what you would like to implement > anyway sometime so lets take it as real world example (althougth I > don't want to say which mapserver it is :-). > > what is necessary to recompute: > when viking wants to get scale 13, 11 is fine - so there is need to > subtract 2 :-) > when x is 115d it need to request 80e0 > when x is 115e it need to request 8100 > so the evaluation should be like 32*(%d-3414) > > when y is 0xACA it needs 82c0 > when y is 0xACB it needs 82a0 > it leads to 32*(3808-%d) > > I tried to tune _get_uri function with smth like > gint32 srcscale=17 - src->scale -2; > gint32 srcx=32*(src->x -3414); > gint32 srcy=32*(3808 - src->y); > > Unfortunately my C lang days are far far away so I get nowhere after > few hours :-( > > BTW: to understand how the tiling works I made s small cgi script > maps.cgi which acts as mapserver and returns dynamic png with scale, x > and y coordinates.. > > tested on maps.xml with (04x is very useful) > <object class="VikSlippyMapSource"> > <property name="label">test</property> > <property name="hostname">localhost</property> > <property name="url">/pathtorewrite/%d_%04x000_%04x000</property> > <property name="id">201</property> > </object> > > on apache side I added > <Directory "pathtorewrite"> > RewriteEngine on > RewriteRule ^([\d\w]+)_([\w\d]+)_([\w\d]+)$ /maps.cgi?z=$1&x=$2&y=$3 [L] > </Directory> > and then used this "map source" with alpha... > > I think that similar aproach could be temporary used as a "proxy" for > sources which needs some finetuning (ie. swap scale to the end).. > > bye Radek ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Viking-devel mailing list Viking-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viking-devel Viking home page: http://viking.sf.net/