I wrote a transcoder which transcodes svg files to renderables and vice versa on world wind. I am now facing an issue that if I have a renderable drawn on world wind canvas at a particular position and I transcode it to svg, I get an svg file with x and y location for the renderable figure on screen. So when I reload the svg it is created on the screen at that x,y coordinate without regard to the view elevation etc. To by pass this I store in db the eye position of that view(or the complete view state) when the renderable was converted and saved as svg. Now I have two strategies to redraw the renderable from the svg:
أكثر...
- I set the view to the eye position(or the view state) from db ANDthen do a canvas redraw. Then I call the transcoder to convert svgback to renderable. This strategy works but since I have to call thecanvas.redrawNow() method, the screen changes to the view (I thenmake it change back to original). My question 1 is: Is there a wayto update the view without the canvas.redrawNow() being called. Itis NOT visually pleasing and not how I want it .
- When I save the svg file from the renderable on screen. I save thepixel distance at that view level and the position of the renderable. Then when I want to draw the renderable from the saved svg all I do is draw the renderable at the current view and then resize the rendered renderable based on the current and stored pixel distance. Then I move it to the stored position(Location). This also works (partially) but the problem is it doesnot take curvature in consideration hence if at higher elevation levels the rendered renderable is slightly disoriented and smaller in size as well. My question 2 is: is there a correction value i can multiply my renderable resize ratio with to get curvature of earth considered as well?
أكثر...