Module: nagvis
Branch: master
Commit: ff1c3a75fc9eff34c85b560bd68c2524ebe12e10
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=ff1c3a75fc9eff34c85b560bd68c2524ebe12e10

Author: Roman Kyrylych <[email protected]>
Date:   Thu Aug 13 13:49:10 2009 +0300

gmap: Implemented saving Google Maps key from GUI

Signed-off-by: Roman Kyrylych <[email protected]>

---

 share/netmap/Geocode.php                       |    8 ++++++++
 uifx/src/modules/gmap/mate/GeneralEM.mxml      |    5 +++++
 uifx/src/modules/gmap/view/DialogSettings.mxml |    9 ++++++++-
 3 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/share/netmap/Geocode.php b/share/netmap/Geocode.php
index 94b0341..90fb1ea 100644
--- a/share/netmap/Geocode.php
+++ b/share/netmap/Geocode.php
@@ -70,6 +70,14 @@ class Geocode
 
                return $locations;
        }
+
+       public function saveKey($key)
+       {
+               if (file_put_contents('GoogleMaps.key', $key) !== FALSE)
+                       return;
+               else
+                       throw new Exception('Could not write GoogleMaps.key');
+       }
 }
 
 ?>
diff --git a/uifx/src/modules/gmap/mate/GeneralEM.mxml 
b/uifx/src/modules/gmap/mate/GeneralEM.mxml
index 25d63bd..6f298e4 100644
--- a/uifx/src/modules/gmap/mate/GeneralEM.mxml
+++ b/uifx/src/modules/gmap/mate/GeneralEM.mxml
@@ -5,6 +5,7 @@
 >

        <mx:Script>

                <![CDATA[

+                       import modules.gmap.events.GoogleMapsKeyEvent;

                        import mx.controls.Alert;

                

                        import com.asfusion.mate.events.UnhandledFaultEvent;

@@ -28,4 +29,8 @@
                <MethodInvoker generator="{MapMD}" method="onModeChanged" 
arguments="{[event.oldMode, event.newMode]}"/>

        </EventHandlers>

                

+       <EventHandlers type="{GoogleMapsKeyEvent.SAVE}">

+               <RemoteObjectInvoker destination="zend" source="Geocode" 
method="saveKey" arguments="{event.key}"/>

+       </EventHandlers>

+

 </EventMap>

diff --git a/uifx/src/modules/gmap/view/DialogSettings.mxml 
b/uifx/src/modules/gmap/view/DialogSettings.mxml
index eeb9809..54402a9 100644
--- a/uifx/src/modules/gmap/view/DialogSettings.mxml
+++ b/uifx/src/modules/gmap/view/DialogSettings.mxml
@@ -23,6 +23,11 @@
        contracted="addEventListener(MouseEvent.CLICK, onClick)"
        expanded="removeEventListener(MouseEvent.CLICK, onClick)"
 >
+    <mx:Script>
+       <![CDATA[
+               import modules.gmap.events.GoogleMapsKeyEvent;
+       ]]>
+    </mx:Script>
     <mx:Metadata>
         [Event(name="getGMapKey", type="flash.events.Event")]
     </mx:Metadata>
@@ -45,6 +50,8 @@
                        icon="@Embed(source='modules/gmap/img/key.png')"
                        click="dispatchEvent(new Event('getGMapKey'))"
                />
-               <mx:Button label="Apply" right="0" bottom="0" height="22"/>
+               <mx:Button label="Apply" right="0" bottom="0" height="22"
+                       click="dispatchEvent(new 
GoogleMapsKeyEvent(GoogleMapsKeyEvent.SAVE, key.text))"
+               />
        </mx:Canvas>
 </EdgeBox>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to