[Marble-commits] KDE/kdeedu/marble/src/plugins/runner/monav
Dennis Nienhüser
earthwings at gentoo.org
Mon Oct 11 20:50:57 CEST 2010
SVN commit 1184893 by nienhueser:
Make a 2D bounding box check when determining whether a given point is contained by a map. Fixes re-routing not working because of the altitude being set by the GPS device.
M +6 -1 MonavPlugin.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/runner/monav/MonavPlugin.cpp #1184892:1184893
@@ -128,8 +128,13 @@
return false;
}
+ // GeoDataLinearRing does a 3D check, but we only have 2D data for
+ // the map bounding box. Therefore the 3D info of e.g. the GPS position
+ // must be ignored.
+ GeoDataCoordinates flatPosition = point;
+ flatPosition.setAltitude( 0.0 );
foreach( const GeoDataLinearRing &box, m_tiles ) {
- if ( box.contains( point ) ) {
+ if ( box.contains( flatPosition ) ) {
return true;
}
}
More information about the Marble-commits
mailing list