Module: nagvis Branch: master Commit: c51cabce1c7ffe3afc867a2f376e99550e798e80 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=c51cabce1c7ffe3afc867a2f376e99550e798e80
Author: Andriy Skuratov <[email protected]> Date: Wed Aug 19 14:20:00 2009 +0300 gmap: Now showing the selected link. --- uifx/src/modules/gmap/mate/UIInitEM.mxml | 5 + .../modules/gmap/view/controls/GMapControl.mxml | 2 + .../modules/gmap/view/controls/GMapLinkControl.as | 107 ++++++++++++++++++++ uifx/src/modules/gmap/view/controls/LinkLine.as | 2 +- uifx/src/services-config.xml | 1 - 5 files changed, 115 insertions(+), 2 deletions(-) diff --git a/uifx/src/modules/gmap/mate/UIInitEM.mxml b/uifx/src/modules/gmap/mate/UIInitEM.mxml index fb7fa80..c4dd8a9 100644 --- a/uifx/src/modules/gmap/mate/UIInitEM.mxml +++ b/uifx/src/modules/gmap/mate/UIInitEM.mxml @@ -30,6 +30,7 @@ import modules.gmap.view.controls.GMapLocationControl; import modules.gmap.view.controls.GMapLocationsControl; import modules.gmap.view.controls.GMapLocationsExtControl; + import modules.gmap.view.controls.GMapLinkControl; import modules.gmap.view.controls.GMapLinksControl; import modules.gmap.view.DialogViewpoint; import modules.gmap.view.DialogLocation; @@ -99,6 +100,10 @@ <PropertyInjector targetKey="dataProvider" source="{LocationsExtData}"/> </Injectors> + <Injectors target="{GMapLinkControl}"> + <PropertyInjector targetKey="link" source="{CurrentLink}" sourceKey="link"/> + </Injectors> + <Injectors target="{GMapLinksControl}"> <PropertyInjector targetKey="dataProvider" source="{LinksData}"/> </Injectors> diff --git a/uifx/src/modules/gmap/view/controls/GMapControl.mxml b/uifx/src/modules/gmap/view/controls/GMapControl.mxml index 5557b88..cceb860 100644 --- a/uifx/src/modules/gmap/view/controls/GMapControl.mxml +++ b/uifx/src/modules/gmap/view/controls/GMapControl.mxml @@ -69,6 +69,7 @@ locationsControl.map = map; locationsExtControl.map = map; + linkControl.map = map; linksControl.map = map; } @@ -82,5 +83,6 @@ <controls:GMapLocationControl id="locationControl"/> <controls:GMapLocationsControl id="locationsControl"/> <controls:GMapLocationsExtControl id="locationsExtControl" visible="false"/> + <controls:GMapLinkControl id="linkControl"/> <controls:GMapLinksControl id="linksControl"/> </mx:Canvas> diff --git a/uifx/src/modules/gmap/view/controls/GMapLinkControl.as b/uifx/src/modules/gmap/view/controls/GMapLinkControl.as new file mode 100644 index 0000000..a2b53d7 --- /dev/null +++ b/uifx/src/modules/gmap/view/controls/GMapLinkControl.as @@ -0,0 +1,107 @@ +/***************************************************************************** + * + * Copyright (C) 2009 NagVis Project + * + * License: + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + *****************************************************************************/ + +package modules.gmap.view.controls +{ + import com.google.maps.LatLng; + import com.google.maps.Map; + import com.google.maps.overlays.Polyline; + import com.google.maps.overlays.PolylineOptions; + import com.google.maps.styles.StrokeStyle; + + import modules.gmap.domain.Link; + + import mx.core.UIComponent; + + public class GMapLinkControl extends UIComponent + { + private var _map : Map; + private var _link : Link; + private var _line : Polyline; + + public function GMapLinkControl() + { + super(); + } + + public function get map():Map + { + return _map; + } + + //Already initialized map has to be set here + //TODO: support uninitialized map + public function set map(value : Map) : void + { + if (_map !== value) + { + _map = value; + + reinitLine(); + } + } + + public function get link():Link + { + return _link; + } + + public function set link(value:Link):void + { + if(_link !== value) + _link = value; + + reinitLine(); + } + + protected function reinitLine():void + { + if(_map) + { + if(_link) + { + var point1 : LatLng = LatLng.fromUrlValue(_link.location1.point); + var point2 : LatLng = LatLng.fromUrlValue(_link.location2.point); + + var options : PolylineOptions = new PolylineOptions({ + strokeStyle: new StrokeStyle({ + color: 0, + thickness: 2, + alpha: 1 + }) + }); + + _line = new Polyline([point1, point2], options); + + _map.addOverlay(_line); + } + else + { + if(_line) + { + _map.removeOverlay(_line); + _line = null; + } + } + } + } + } +} \ No newline at end of file diff --git a/uifx/src/modules/gmap/view/controls/LinkLine.as b/uifx/src/modules/gmap/view/controls/LinkLine.as index bf4eed1..79a9f10 100644 --- a/uifx/src/modules/gmap/view/controls/LinkLine.as +++ b/uifx/src/modules/gmap/view/controls/LinkLine.as @@ -45,7 +45,7 @@ package modules.gmap.view.controls var options : PolylineOptions = new PolylineOptions({ strokeStyle: new StrokeStyle({ color: chooseColor(link.state), - thickness: 4, + thickness: 10, alpha: 1 }) }); diff --git a/uifx/src/services-config.xml b/uifx/src/services-config.xml index c3db985..543df5e 100644 --- a/uifx/src/services-config.xml +++ b/uifx/src/services-config.xml @@ -7,7 +7,6 @@ <destination id="zend"> <channels> <channel ref="zend-endpoint-secure"/> - <channel ref="zend-endpoint"/> </channels> <properties> <source>*</source> ------------------------------------------------------------------------------ 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
