Plans [was: Re: Gconf or GSettings? - leading to a wider question]
Robert C. Helling
helling at atdotde.de
Tue Jan 22 15:03:55 PST 2013
On Jan 21, 2013, at 7:25 PM, Linus Torvalds wrote:
> I'm not proud of it. It's a dirty disgusting hack, but it happens to
> work. It makes several assumptions about the map, most notable of them
> that the map translation is a pure cylindrical translation of
> latitude/longitude. That happens to be right for OSM (at least the
> form we use), so it seems to _work_, but it sure is hacky. It just
> does a "let's try to center the map at random locations and see how
> close we get to the target", where the "random locations" are just a
> binary rectangular search.
>
> The "binary rectangular search" is why it wouldn't work if OSM showed
> the world using some other map projection than the purely cylindrical
> one.
>
> It also wouldn't work correctly if OSM did the right thing and wrapped
> the world view - but again, OSM seems to do a pure rectangular mapping
> of lat/long to x/y.
>
> So this gets us the "correct" zooming behavior, but I want somebody
> else to look at the code. If you can stand it, commit it and add my
> sign-off. But I'll understand if anybody goes "that is too ugly to
> live, please just nuke it from space, that's the only way to make
> sure".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zoom_at_pointer.patch
Type: application/octet-stream
Size: 2571 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130123/92e601e7/attachment.obj>
-------------- next part --------------
Hi,
here is an alternative patch that does it with a bit of algebra instead of the binary search.
There is just one awkward problem: It should do nothing when trying to scroll out from minimal zoom or scroll in from maximal zoom. My understanding of http://nzjrs.github.com/osm-gps-map/docs/reference/html/OsmGpsMap.html#OsmGpsMap.properties
is that there are "properties" zoom, max-zoom, min-zoom of the map widget that should allow to test these cases. Unfortunately, my gtk knowledge is not existent and I have not managed to obtain these. This needs to be looked at by someone else.
But the "zoom fixes position under mouse pointer" works.
Best
Robert
--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling Elite Master Course Theoretical and Mathematical Physics
Scientific Coordinator
Ludwig Maximilians Universitaet Muenchen, Dept. Physik
print "Just another Phone: +49 89 2180-4523 Theresienstr. 39, rm. B339
stupid .sig\n"; http://www.atdotde.de
More information about the subsurface
mailing list