Hi Oliver: Am 22.05.11 20:54 schrieb(en) Oliver Eichler:
This is for Garmin Custom Map export. If you have a raster map (qmap collection) you can export an area as kmz. The newer devices will show this kmz maps. QLGT will export and re-project the selected area and call map2gcm to convert the exported map into a kmz.
Ah! I see... Attached is the proposed patch which shifts map2gcm into the bundle folder, and re-directs the shared Qt framework refs accordingly. Of course, it is still possible to run the application manually from the terminal, just the path is somewhat ugly (like "/Applications/QLandkarte GT/..."). The hunk to 3rdparty/map2gcm/main.cpp is purely cosmetic - the output of the application is utf-8, but the text browser seems to interpret it as latin-1.
I would need an example map. I can not see why it hides stuff as the filling color is 100% transparent. Thus I need an example to investigate.
I'll send it off-list, as it is somewhat large... Thanks, Albrecht.
Index: src/CMapQMAPExport.cpp
===================================================================
--- src/CMapQMAPExport.cpp (revision 2762)
+++ src/CMapQMAPExport.cpp (working copy)
@@ -81,8 +81,13 @@
proc1.waitForFinished();
has_map2jnx = proc1.error() == QProcess::UnknownError;
path_map2jnx = MAP2JNX;
+#if defined(Q_WS_MAC)
+ // MacOS X: application is stored in the bundle folder
+ path_map2gcm = QString("%1/Resources/map2gcm").arg(QCoreApplication::applicationDirPath().replace(QRegExp("MacOS$"), ""));
+#else
path_map2gcm= "map2gcm";
#endif
+#endif
groupBirdsEye->hide();
groupJPEG->hide();
groupDevice->hide();
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt (revision 2762)
+++ src/CMakeLists.txt (working copy)
@@ -577,7 +577,8 @@
MACOSX_PACKAGE_LOCATION Resources
)
add_executable(${PROGNAME} MACOSX_BUNDLE ${qlandkarte_ALLINP} ${MAC_EXTRA_RES})
- add_custom_target(mac-deploy macdeployqt "${MAC_BUNDLE_PATH}")
+ add_custom_target(mac-deploy macdeployqt "${MAC_BUNDLE_PATH}"
+ COMMAND ${CMAKE_SOURCE_DIR}/MacOSX/map2gcm-libs.sh "${MAC_BUNDLE_PATH}")
else(APPLE)
add_executable(${PROGNAME} WIN32 ${qlandkarte_ALLINP})
endif(APPLE)
Index: MacOSX/map2gcm-libs.sh
===================================================================
--- MacOSX/map2gcm-libs.sh (revision 0)
+++ MacOSX/map2gcm-libs.sh (revision 0)
@@ -0,0 +1,14 @@
+#!/bin/sh
+# $Id:$
+
+if [ -z "$1" ] ; then
+ echo "usage: $0 <bundle path>"
+ exit 1
+fi
+
+MAP2GCM=$1/Contents/Resources/map2gcm
+QTLIBS=$(otool -L "$MAP2GCM" | sed -n -e 's/^[[:space:]]*\(Qt[^ ]*\).*$/\1/p')
+for l in $QTLIBS ; do
+ install_name_tool -change "$l" "@executable_path/../Frameworks/$l" "$MAP2GCM"
+done
+
Property changes on: MacOSX/map2gcm-libs.sh
___________________________________________________________________
Added: svn:executable
+ *
Index: 3rdparty/map2gcm/main.cpp
===================================================================
--- 3rdparty/map2gcm/main.cpp (revision 2762)
+++ 3rdparty/map2gcm/main.cpp (working copy)
@@ -163,7 +163,7 @@
if(pj_is_latlong(file.pj))
{
printf("\narea (top/left, bottom/right): %f %f, %f %f", file.lat1, file.lon1, file.lat2, file.lon2);
- printf("\nxscale: %f °/px, yscale: %f °/px", file.xscale, file.yscale);
+ printf("\nxscale: %f deg/px, yscale: %f deg/px", file.xscale, file.yscale);
}
else
{
Index: 3rdparty/map2gcm/CMakeLists.txt
===================================================================
--- 3rdparty/map2gcm/CMakeLists.txt (revision 2762)
+++ 3rdparty/map2gcm/CMakeLists.txt (working copy)
@@ -53,6 +53,12 @@
${QM_FILES}
)
+if(APPLE)
+set_target_properties( map2gcm PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY ${MAC_BUNDLE_PATH}/Contents/Resources
+)
+endif(APPLE)
+
if(WIN32)
target_link_libraries( map2gcm
${GDAL_LIBRARIES}
pgpEWQEqglP5Y.pgp
Description: PGP signature
------------------------------------------------------------------------------ What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________ Qlandkartegt-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users
