POST
|
Or if you wish to try, here is an xml configurable keyboard shortcut widget. The widget config file lets you put in the widget label (as defined in the viewers main config xml), the key and optional boolean values for ctrl, alt and shift keys. The default for these is false. eg key=s and ctrl=true is CTRL+s key=s and ctrl=false is s Add to your main config file in the UI Elements part <!-- UI elements -->
<widget config="widgets/KeyboardShortcuts/KeyboardShortcutsWidget.xml"
url="widgets/KeyboardShortcuts/KeyboardShortcutsWidget.swf"/> Let me know if you think this is useful, and I can upload to the code gallery with compiled version.
... View more
03-24-2011
03:00 PM
|
0
|
0
|
431
|
POST
|
Interesting problem here....when using your Selection Widget in a flexviewer where Robert Scheitlin's TOC widget is open, the TOC widget populates with whatever layers are placed into the Selection Widget XML. Please see above fix in this thread to KDAGIS on the 03-07-2011 02:58 PM, as it sounds like the same thing is happening. I will update the source code on the download page with this fix.
... View more
03-22-2011
01:01 PM
|
0
|
0
|
509
|
POST
|
KDAGIS(March 4, 2011) I really like this widget, thank you! I have one issue. The layers that I have specified to be in the query drop down list get added to the layers I have listed under my More... button. Even though they are already there. So I wind up then having each layer listed twice under my More... button. I've looked around in the code but haven't identified what code I could take out to make it not add the layers to the More.. button. Nice pickup, I have looked into this and it seems to be a "feature" of TOC component in the MapSwitcher Widget. TOC.as in com.esri.viewer.components.toc has en event listener on the map for MapEvent.LAYER_ADD. It automatically adds the FeatureLayers to the TOC when the map fires the event. There is a workaround however. In the MapSwitcher.xml file you can tell it to exclude layers. <layerlist visible="true"> <excludelayer>Louisville Police Facilities</excludelayer> <excludelayer>Counties</excludelayer> <excludelayer>States</excludelayer> </layerlist> Edit: Here is a fix for the issue. (Ignore the above workaround.) Add this listener to the init() function in the SelectionWidget.mxml file. Just add as the first line in init() private function init():void
{
map.addEventListener(MapEvent.LAYER_ADD, onLayerAdd, false, 100); The 100 at the end of the listener gives the listener a high priority. Add the function in the SelectionWidget.mxml file. private function onLayerAdd(event:MapEvent):void
{
event.stopImmediatePropagation();
} This will stop the TOC.as from being notified that a layer was added to the map. I will update the source code and recompile on the download page when I get a chance.
... View more
03-07-2011
01:58 PM
|
0
|
0
|
509
|
POST
|
Sertact(February 24, 2011) Great widget. Many thanks for the great job. A small question. When make the selection and the results are returned. The results are not displayed at their correct locations on the map. When I double click from the grid it kind of centers the correct location for that record but again all the others are not displayed correctly. My map service and map are at the same datum which is WGS84. One other thing at your SelectionWidgetUtil.as I realized that you add/subtract 5000 to get the graphic extent of the records selected. I think this value is a bit high if one is using Decimal degrees with wgs84 datum. Any suggestions for these. Many thanks again. Sertact, The results are returned as a featurelayer which is a direct representation of the GIS data. If it is not in the correct place it sounds like some sort of projection issue?? If you put the base map that you are using with this widget into ArcGIS and overlay your data on top of it, does it line up correctly. Is your data available externally? The zoom function in SelectionWidgetUtil.as is copied from one of my other projects which is using projected data. The 5000 was for metres (5 kilometres) So for decimal degrees it would be a bit high. I will update this at some stage (maybe use pan to point xy instead).
... View more
02-28-2011
12:14 PM
|
0
|
0
|
618
|
POST
|
Hi Daniel, The widget is based on the FlexViewer's built in search widget, with the addition of Robert's unionGeom function. That function is brilliant as it is client side and so quick. It is definately worth looking at what others have done and reusing there work (if permitted of course). I did think about including graphical selection tools but there were a few widgets that already did this sort of thing, so I decided against it. But yes a select by Graphic option like ArcGIS would be good. I will see about adding one. (I am also happy to include contributions and enhancements from others.)
... View more
02-24-2011
02:55 PM
|
0
|
0
|
618
|
POST
|
Jeff, I think this might be to do with the fully qualified field names. eg SLOCO.SDE.SLO_PARCEL_CD_LU.APN instead of APN I am guessing you are doing this because your link field is from a different featureclass? The intended use is that all the fields come from the same featureclass.(layer in the .xml config) Your link field should be a field in the SLO_PARCEL_CD_LU layer. Is the link the same for all parcels or different? Test out your layer without the link field and without the fully qualified names and see if that works.
... View more
02-24-2011
02:35 PM
|
0
|
0
|
618
|
POST
|
Jeff, "when I hover over the table the information is highlighted on the map" So you can see the attribute data in the infowindow? Is this for all of your layers or just one. Is the data you are querying available external so I can have a look. Could you post your SelectionWidget.xml file. Alias are net set up for this widget.
... View more
02-24-2011
10:44 AM
|
0
|
0
|
618
|
POST
|
Yes, The version of AlicePDF included with this sample is 0.1.4.9 The latest download of AlivePDF is 0.1.5RC You can use the latest AlivePDF but you will have to redo the AlivePDF code in the layout templates. This sample is really just to show the concept.
... View more
02-22-2011
11:27 AM
|
0
|
0
|
550
|
POST
|
The Selection widget has a "Select by Attributes" and "Select by Location" option similar to ArcGIS. It has options where you can set your selection type eg New Selection, Add to Selection, Remove from Selection. Select from multiple layers that interstect/contain etc another layer. You can view the results for each layer in a datagrid, and export to tab delimited text file. Widget link: http://www.arcgis.com/home/item.html?id=20ed6af9ab204548bbf092d51b51fef8 I built this because it seemed like a fun project and the temptation of a Flex a Widget T-shirt was too much to resist.:o If you download please leave feedback and rate the widgets (this should apply to any widget you download) as the feed back really helps to know what users are after.
... View more
02-21-2011
11:55 AM
|
0
|
50
|
6590
|
POST
|
Hi Melony, Here is a modified version of my Print example. This one has included a PDF button on the PrintPreview. Previously the map layouts eg A5_Portrait.mxml were based on Canvas. All layouts now need to be based on my new MXML Component PrintLayoutCanvas (which is based on Canvas). PrintLayoutCanvas has some functions which the layouts need to generate the PDF. The two functions are overriden in the layouts. One of the functions returns an AlivePDF pdf object. You set up the pdf 'layout' in each layout. I have also updated the two layouts (A5_Portrait, and A5_Landscape to be actually A5 in size. My original example had them at A6 size!) The .zip file can be imported into flex as an archive project. You might need to go to project - clean, once it has been imported. I hope this all makes sense.
... View more
02-20-2011
05:40 PM
|
0
|
0
|
550
|
POST
|
Hi, This project sounded like a fun way to wind down before the break, so here you are. (rename to .mxml) You can add/remove maps, click a map to make it "active" then change base layers on that map. Change extent on the "active" map and all other maps will follow the extent. If you are not sure how something is working I am happy to try to explain. Merry Christmas.
... View more
12-22-2010
07:46 PM
|
0
|
0
|
308
|
POST
|
Hi Carmen, I too am the only developer where I work and I find that the best design for flex is usin Flex's built in event driven framework, and creating loosely coupled components. By doing this you are essentially using a very basic mvc architecture. I have attached three files, one is the main application the other two are componets for NavMenuBar and MainMenuBar . (rename to .mxml instead of .txt the two components go into src/components folder). I have set up the NavMenuBar component to dispatch an event "navToolActivated" when the esri:NavigationTool is activated. The event is set to bubble, so Flex application knows it is dispatched. The MainMenuBar is set to listen for an event called "navToolActivated". When it hears that event it will deactivate its own esri:DrawTool. MainMenuBar is also set up to dispatch an event called "drawToolActivated", NavMenuBar listens for it and acts accordingly. The components are independant from each other(loosely coupled). I hope that helps. (Load these into a flash builder 4 project to see how it works)
... View more
12-15-2010
07:19 PM
|
0
|
0
|
482
|
POST
|
Hi Robert, Sorry, I re read my previous post and its not very clear at all. The method you are using is the Google Analytics Javascript api, that can be put in html pages. There is also a Google Analytics Action Script 3 api available, analytics.swc, that can be put in the libs folder of a flex project. The calls to Google analytics can be made from within the flex application's actionscript code. You can see in my sample report that I am logging a lot of things. The base layers that are being used, the buttons that are being used, the searches that are being used etc. Each out to there own analytics page. Well worth the effort to see how the site is being used or how it could potentially be better. (and managers love reports with graphs 😄 ) Here is the concept of what you could do in FlexViewer. Within each widget you could use tracker.trackPageview( "/pagename"). The simple code below would create 4 "pages" in the google analytics report. Pages: Initial, Widget1_load, Widget1_table, Widget2_load <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
minWidth="955" minHeight="600"
addedToStage="onComplete()">
<mx:Script>
<![CDATA[
import com.google.analytics.GATracker;
import com.google.analytics.AnalyticsTracker;
public var tracker:AnalyticsTracker;
private function onComplete():void
{
tracker = new GATracker( this, "UA-111-222", "AS3", false );
tracker.trackPageview( "/Initial");
}
protected function b1_clickHandler(event:MouseEvent):void
{
tracker.trackPageview( "/Widget1_load");
}
protected function b2_clickHandler(event:MouseEvent):void
{
tracker.trackPageview( "/Widget1_table");
}
protected function b3_clickHandler(event:MouseEvent):void
{
tracker.trackPageview( "/Widget2_load");
}
]]>
</mx:Script>
<mx:Panel id="p1">
<mx:Button id="W1_load" click="b1_clickHandler(event)"/>
<mx:Button id="W1_table" click="b2_clickHandler(event)"/>
<mx:Button id="W2_load" click="b3_clickHandler(event)"/>
</mx:Panel>
</mx:Application>
... View more
11-24-2010
11:15 AM
|
0
|
0
|
737
|
POST
|
I use it on my site directly from within flex. (not flexviewer though) Like the link that Gady provided. This allows you to log flex events as "pages" in google analytics. eg Each time a user clicks on the print button, it is logged as a "page" in google analytics. To use in flexviewer you would have to set the "tracker" as a global variable. Then each event you want to log as a page, you would use tracker.trackPageview( "/PrintButton") Where the argument is the page name logged in Analytics. This is useful to find out what functionality is being used on our site, what is not being used. Then you can ask questions like why is it not being used, hard to find, too many clicks, not user friendly etc. Very useful tool. We have been using it for over 12 months. See attached for an example of the output I get.
... View more
11-23-2010
06:43 PM
|
0
|
0
|
737
|
POST
|
Here's something that might help you. It updates the values in the array sent to the pdf grid. For testing purposes there is a field that get a $ sign added to it in a labelfunction. When exported to AlivePDF the dollar sign shows up.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
creationComplete="initData()">
<mx:Script>
<![CDATA[
import mx.controls.dataGridClasses.DataGridColumn;
import org.alivepdf.fonts.CoreFont;
import mx.collections.ArrayCollection;
import org.alivepdf.colors.IColor;
import org.alivepdf.colors.RGBColor;
import org.alivepdf.data.Grid;
import org.alivepdf.data.GridColumn;
import org.alivepdf.saving.Method;
import org.alivepdf.display.Display;
import org.alivepdf.layout.Size;
import org.alivepdf.layout.Unit;
import org.alivepdf.layout.Orientation;
import org.alivepdf.pdf.PDF;
private var dgArray:Array = [
{Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99},
{Artist:'Pavement', Album:'Brighten the Corners', Price:11.99},
{Artist:'test2', Album:'junk1', Price:11.99},
{Artist:'test2', Album:'junk2', Price:22.99},
{Artist:'test3', Album:'junk3', Price:11.99},
{Artist:'test3', Album:'junk4', Price:11.99},
{Artist:'test4', Album:'junk1 and Enchanted', Price:35.99},
{Artist:'test4', Album:'Slanted and junk1', Price:6.99},
{Artist:'test5', Album:'Slanted junk1', Price:89.99},
{Artist:'test5', Album:'junk1 Enchanted', Price:33.12}];
[Bindable] public var dgArrayColl:ArrayCollection;
private function initData():void
{
dgArrayColl=new ArrayCollection(dgArray);
}
private function myLabelFunc(data:Object, column:DataGridColumn):String
{
return "$" + data.Price;
}
private function sendToPDF():void
{
var PDFcolumns:Array = getPDFColumns(dg);
var resultsArray:Array = dg.dataProvider.toArray();
formatPDFGridData(resultsArray, dg);
var pdf:PDF = new PDF(Orientation.PORTRAIT,Unit.MM,Size.A4);
pdf.addPage();
pdf.setAutoPageBreak(false,1);
pdf.setDisplayMode ( Display.FULL_PAGE );
pdf.setFont(new CoreFont(),10);
pdf.textStyle(new RGBColor(0x000000));
var rgbWhite:IColor = new RGBColor(0xFFFFFF);
var rgbBlack:IColor = new RGBColor(0x000000);
var rgbGray:IColor = new RGBColor(0xCCCCCC);
var grid:Grid = new Grid(resultsArray,0,dg.height,rgbGray,rgbWhite,false,rgbBlack);
grid.columns = PDFcolumns;
pdf.addGrid(grid,25,10);
pdf.save(Method.REMOTE, "http://localhost/createPDF/create.aspx", Download.ATTACHMENT, "report.pdf");
} // end function sendToPrinter
private function getPDFColumns(datagrid:DataGrid):Array
{
// This will create an array suitable for use as columns in AlivePDF
// The columns are based on a datagrid's columns.
// If the datagrid column is visible it will be included.
//The width of each column is calculated assuming mm are the units used in the pdf.
//1 pt = 0.35 mm
//1 mm = 2.83 pt
var PDFcolumns:Array = new Array;
var dataGridColumn:DataGridColumn;
//loop through each datagridcolumn in the datagrid
for( var i:Number = 0; i < datagrid.columns.length; i++ )
{
dataGridColumn = datagrid.columns;
if (dataGridColumn.visible)
{
// add to the pdfcolumn array
var gridColumn:GridColumn = new GridColumn(dataGridColumn.headerText,
dataGridColumn.dataField,
dataGridColumn.width * 0.35);
PDFcolumns.push(gridColumn);
}
}
return PDFcolumns;
}
private function formatPDFGridData(arr:Array, datagrid:DataGrid):void
{
var dataGridColumn:DataGridColumn;
// loop through the array
for (var i:int = 0; i<arr.length; i++)
{
//go through each datagridColumn in the datagrid
for( var iCols:Number = 0; iCols < datagrid.columns.length; iCols++ )
{
dataGridColumn = datagrid.columns[iCols];
// If there is a labelfunction on the column,
// update the data in the array using its return value
if (dataGridColumn.labelFunction != null)
{
arr[dataGridColumn.dataField] = dataGridColumn.labelFunction(arr,dataGridColumn);
}
}
}
}
]]>
</mx:Script>
<mx:DataGrid id="dg" dataProvider="{dgArrayColl}" width="450">
<mx:columns>
<mx:DataGridColumn dataField="Artist" width="100"/>
<mx:DataGridColumn dataField="Album" />
<mx:DataGridColumn dataField="Price" width="100" visible="true" labelFunction="myLabelFunc"/>
</mx:columns>
</mx:DataGrid>
<mx:Button label="PDF" click="sendToPDF()"/>
</mx:Application>
... View more
08-30-2010
09:43 PM
|
0
|
0
|
239
|
Title | Kudos | Posted |
---|---|---|
1 | 11-02-2016 07:09 PM | |
3 | 11-03-2016 02:53 PM | |
1 | 10-12-2016 08:12 PM | |
1 | 10-27-2016 02:37 PM | |
1 | 10-12-2016 09:01 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|