[Digikam-devel] [Bug 111560] Be able to locate photos on a map

Gilles Caulier caulier.gilles at free.fr
Fri Sep 29 11:04:38 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=111560         




------- Additional Comments From caulier.gilles free fr  2006-09-29 12:04 -------
SVN commit 590109 by cgilles:

kipi-plugins from trunk : GPSSync tool : The GPS location editor dialog now display the Google Maps view like a real widget, without margin and depending of the dialog size. If you reduce or increase dialog size, the world map size will be updated in live.

CCMAIL: gerhard kulzer net, kde-imaging ke org

BUG: 133359
CCBUGS: 111560

 M  +24 -6     getlonlat.php  
 M  +13 -0     gpseditdialog.cpp  
 M  +2 -0      gpseditdialog.h  
 M  +24 -11    gpsmapwidget.cpp  
 M  +9 -0      gpsmapwidget.h  


--- trunk/extragear/libs/kipi-plugins/gpssync/getlonlat.php #590108:590109
 @ -1,7 +1,7  @
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html>
 
-<!--
+<?php
 /* ============================================================
  * Authors: Caulier Gilles <caulier dot gilles at kdemail dot net>
  * Date   : 2006-09-22
 @ -10,9 +10,17  @
  * 
  * Copyright 2006 by Gilles Caulier
  * 
- * Note : this script use Google Map api:
- *        http://www.google.com/apis/maps/documentation
+ * Notes : This script use Google Map api:
+ *         http://www.google.com/apis/maps/documentation
+ *         This script must be copied to host kipi-plugins
+ *         web project page.
+ *         This script accept some values from url:
+ *           - 'alt' : picture altitude.
+ *           - 'lon' : picture longitude. 
+ *           - 'wth' : width of map.
+ *           - 'hgt' : height of map.
  *
+ *
  * This program is free software; you can redistribute it
  * and/or modify it under the terms of the GNU General
  * Public License as published by the Free Software Foundation;
 @ -25,7 +33,7  @
  * GNU General Public License for more details.
  * 
  * ============================================================ */
--->
+?>
 
 <head>
 <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAy_Vv5rc03ctmYvwfsuTH6RSK29CRGKrdb78LNYpP1_riKtR3zRRxy4unyuWAi2vp7m1isLwuHObXDg" 
 @ -82,7 +90,17  @
 </script>
 </head>
 
-<body onLoad="loadMap()">
-<div id="map" style="width: 640px; height: 480px"></div>
+<body onLoad="loadMap()" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
+
+<?php
+    echo "<div id=\"map\" ";
+    echo "style=\"width: ";
+    echo $_GET['wth'];
+    echo "px; height: ";
+    echo $_GET['hgt'];
+    echo "px\">";
+?>
+
+</div>
 </body>
 </html>
--- trunk/extragear/libs/kipi-plugins/gpssync/gpseditdialog.cpp #590108:590109
 @ -20,6 +20,7  @
 
 // Qt includes.
 
+#include <qtimer.h>
 #include <qlabel.h>
 #include <qlayout.h>
 #include <qpushbutton.h>
 @ -131,6 +132,7  @
             this, SLOT(slotNewGPSLocationFromMap(const QString&, const QString&)));
 
     readSettings();
+    QTimer::singleShot(0, this, SLOT(slotUpdateWorldMap()));
 }
 
 GPSEditDialog::~GPSEditDialog()
 @ -145,6 +147,17  @
     e->accept();
 }
 
+void GPSEditDialog::slotUpdateWorldMap()
+{
+    d->worldMap->resized();
+}
+
+void GPSEditDialog::resizeEvent(QResizeEvent *e)
+{
+    if (!e) return;
+    slotUpdateWorldMap();
+}
+
 void GPSEditDialog::slotCancel()
 {
     saveSettings();
--- trunk/extragear/libs/kipi-plugins/gpssync/gpseditdialog.h #590108:590109
 @ -50,9 +50,11  @
     void slotOk();
     void slotCancel();
     void slotNewGPSLocationFromMap(const QString& lat, const QString& lon);
+    void slotUpdateWorldMap();
 
 protected:
 
+    void GPSEditDialog::resizeEvent(QResizeEvent *);
     void closeEvent(QCloseEvent *);
 
 private:
--- trunk/extragear/libs/kipi-plugins/gpssync/gpsmapwidget.cpp #590108:590109
 @ -35,16 +35,14  @
 GPSMapWidget::GPSMapWidget(QWidget* parent, const QString& lat, const QString& lon)
             : KHTMLPart(parent)
 {
-    view()->resize(640, 480);
+    m_latitude  = lat;
+    m_longitude = lon;
     setJScriptEnabled(true);     
     setDNDEnabled(false);
     setEditable(false);
-    QString url("http://digikam3rdparty.free.fr/gpslocator/getlonlat.php");
-    url.append("?lat=");
-    url.append(lat);
-    url.append("&lon=");
-    url.append(lon);
-    openURL(KURL(url));
+    view()->setVScrollBarMode(QScrollView::AlwaysOff);
+    view()->setHScrollBarMode(QScrollView::AlwaysOff);
+    view()->setMinimumSize(480, 360);
 }
 
 GPSMapWidget::~GPSMapWidget()
 @ -59,11 +57,26  @
     {
         status.remove(0, 5);
         status.truncate(status.length()-1);
-        QString lat = status.section(",", 0, 0);
-        QString lon = status.section(",", 1, 1);
-        lon.remove(0, 5);
-        emit signalNewGPSLocationFromMap(lat, lon);
+        m_latitude  = status.section(",", 0, 0);
+        m_longitude = status.section(",", 1, 1);
+        m_longitude.remove(0, 5);
+        emit signalNewGPSLocationFromMap(m_latitude, m_longitude);
     }
 }
 
+void GPSMapWidget::resized()
+{
+    QString url("http://digikam3rdparty.free.fr/gpslocator/getlonlat.php");
+    url.append("?lat=");
+    url.append(m_latitude);
+    url.append("&lon=");
+    url.append(m_longitude);
+    url.append("&wth=");
+    url.append(QString::number(view()->width()));
+    url.append("&hgt=");
+    url.append(QString::number(view()->height()));
+    openURL(KURL(url));
+    kdDebug( 51001 ) << url << endl;
+}
+
 }  // namespace KIPIGPSSyncPlugin
--- trunk/extragear/libs/kipi-plugins/gpssync/gpsmapwidget.h #590108:590109
 @ -29,6 +29,8  @
 
 #include <khtml_part.h>
 
+class QResizeEvent;
+
 namespace KIPIGPSSyncPlugin
 {
 
 @ -41,6 +43,8  @
     GPSMapWidget(QWidget* parent, const QString& lat, const QString& lon);
     ~GPSMapWidget();
 
+    void resized();
+
 signals:
 
     void signalNewGPSLocationFromMap(const QString&, const QString&);
 @ -48,6 +52,11  @
 protected:
 
     void khtmlMouseReleaseEvent(khtml::MouseReleaseEvent *);
+
+private:
+
+    QString m_latitude;
+    QString m_longitude;
 };
 
 }  // namespace KIPIGPSSyncPlugin



More information about the Digikam-devel mailing list