Re: [Libosmscout-development] Multitouch zoom
Library for OpenStreetMap offline rendering and routing
Status: Beta
Brought to you by:
tteuling
|
From: Jane J. K. <jan...@un...> - 2016-08-16 07:43:43
|
Hi Tim,
yes, that definitely is a big help! Million thanks again!
Was there an OSM Sommercamp? Some photos would be funny ;)
Viele Grüße
Jean
-----Ursprüngliche Nachricht-----
Von: Tim Teulings [mailto:ti...@fr...]
Gesendet: Freitag, 12. August 2016 19:41
An: lib...@li...
Betreff: Re: [Libosmscout-development] Multitouch zoom
Hello Jane,
> I am currently implementing the pinch zoom function but I am stuck for
> a couple of hours trying to guess how the magnification conversion
> should be. For esthetic purposes, I need the points on which my
> fingers touch in the beginning to remain points where my fingers are
> at the end of the pinch action.
Right. That sounds reasonable.
> Can anybody shed some light? Which document or previous email exchange
> explains the computation of the zoom factor with respect to the
> variable "osmscout::Magnification magnification"?
Magnification.cpp
...
void Magnification::SetMagnification(double magnification)
{
this->magnification=magnification;
this->level=(uint32_t)log2(this->magnification);
}
void Magnification::SetMagnification(Mag magnification)
{
this->magnification=magnification;
this->level=(uint32_t)log2(this->magnification);
}
...
So magnification*2 <==> level+1.
With:
enum Mag {
magWorld = 1, // 0
magContinent = 16, // 4
magState = 32, // 5
magStateOver = 64, // 6
magCounty = 128, // 7
magRegion = 256, // 8
magProximity = 512, // 9
magCityOver = 1024, // 10
magCity = 2*1024, // 11
magSuburb = 2*2*1024, // 12
magDetail = 2*2*2*1024, // 13
magClose = 2*2*2*2*1024, // 14
magCloser = 2*2*2*2*2*1024, // 15
magVeryClose = 2*2*2*2*2*2*1024, // 16
magBlock = 2*2*2*2*2*2*2*2*1024, // 18
magStreet = 2*2*2*2*2*2*2*2*2*1024, // 19
magHouse = 2*2*2*2*2*2*2*2*2*2*1024 // 20
};
> Thank you again in advance and enjoy some time away from the computer
> this weekend! :)
The OSM Sommercamp is definitely not "away from computer". Everybody in the room has a laptop in front of it (though most are not doing "development"). Possibly I send a photo soon...:-)
The actual projection code is in Projection.cpp as is mainly a standard Mercator projection.
Does that help?
--
Gruß...
Tim
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Libosmscout-development mailing list
Lib...@li...
https://lists.sourceforge.net/lists/listinfo/libosmscout-development
|