|
POST
|
Sorry for the delay. I've updated the source code this morning. http://www.arcgis.com/home/item.html?id=c663df2846d04a6b9add92b66c637728 You can now define the output Spatial Reference wkid for your Locator service so that it will match your map services. I tested it briefly without issue, but if anything does not work please let me know. Thanks.
... View more
03-09-2011
07:28 AM
|
0
|
0
|
1141
|
|
POST
|
I'll look over the code, but there is a section when I initialize the locator, that I set the output Spatial Reference to geographic. I've been meaning to add that as an xml option.
... View more
03-08-2011
09:40 AM
|
0
|
0
|
1141
|
|
POST
|
I checked the source and I don't block geocoding if there is no city/zip, but depending on the Locator service you are using, you may have to change this in the source code. widgets.BatchGeocoder.helpers
/**
* Will parse the item passed to this class and prepare it for
* use with ArcGIS Server geocoder.
* @param item
* @return
*/
protected function buildAddressObject(item:Object):Object
{
var address:String = "";
var city:String = "";
var state:String = "";
var zip:String = "";
var country:String = "USA";
if (_addressField.length > 0)
address = item[_addressField];
if (_cityField.length > 0)
city = item[_cityField];
if (_stateField.length > 0)
_stateField = item[_stateField];
if (_zipField.length > 0)
zip = item[_zipField];
if (_countryField.length > 0)
country = item[_countryField];
// You may need to modify these fields to work with your
// particular locator service
return {
Address:address,
City:city,
State:state,
Zip:zip,
Country:country
};
}
That is the address object that gets created when you map the fields from your dbf. You may need to change Address to Street. You may even be able to eliminate all fields except for address in your case. I test against this geocodeserver. http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA/GeocodeServer
... View more
03-07-2011
04:39 PM
|
0
|
0
|
1141
|
|
POST
|
I'll check over source when I get home. This could be left over from a limitation I had in my code where our internal locator required a city or zip. I'll see if I can fix that. Thanks for pointing it out.
... View more
03-07-2011
07:42 AM
|
0
|
0
|
1141
|
|
POST
|
Looking at the Query Widget, it looks like the query is just run the one time on the first load and results parsed and stored in queryResultAC. This is probably to save the time of having to rerun the query each time you close/open the widget. If you'd like to zoom the query results each time the widget is open, you can listen for the addedToStage event on something. I tried it out and added it to the QueryResultDataGroup <Query:QueryResultDataGroup id="queryResultDG" addedToStage="queryResultDG_addedToStageHandler(event)" ... Then do something like this.
protected function queryResultDG_addedToStageHandler(event:Event):void
{
if (graphicsLayer) // need this because on first load, value is null
map.extent = GraphicUtil.getGraphicsExtent(ArrayCollection(graphicsLayer.graphicProvider).toArray());
}
That should get you started.
... View more
03-03-2011
01:13 PM
|
0
|
0
|
449
|
|
POST
|
Ok, it's updated. http://www.arcgis.com/home/item.html?id=bed0140d93ee49d8b8f8f1a5b7310c6f You can check out a demo here. http://odoe.net/thelab/flex/flexviewer/index.html?config=config-layersmanager.xml If you really wanted to change the text color, you could edit the LegendManageraSkin.mxml as such.
<s:Scroller height="100%"
width="100%">
<!-- add a color value for the DataGroup -->
<s:DataGroup id="legendDataGroup" color="0xffff00"
itemRendererFunction="itemRenFunc">
<s:layout>
<s:VerticalLayout gap="2"
horizontalAlign="justify" />
</s:layout>
</s:DataGroup>
</s:Scroller>
I've thought about swf loadable stylesheets, but wasn't sure about it for widgets. (i.e. compile css to swf for widget swfs)
... View more
03-03-2011
10:20 AM
|
0
|
0
|
522
|
|
POST
|
I've been meaning to fix the itemRenderers for this. Probably best solution would be to open these 2 itemRenderers in the source. LayerListItemRenderer.mxml LayerListDynamicItemRenderer.mxml change the alpha value of the <s:Rect> to 0.
<s:Rect left="0"
right="0"
top="0"
bottom="0">
<s:fill>
<s:SolidColor color="#F0F8FF"
alpha="0" /> <!-- change this from 0.6 t0 0 -->
</s:fill>
</s:Rect>
I'll update the source and compiled swc in zip after lunch today.
... View more
03-03-2011
10:01 AM
|
0
|
0
|
522
|
|
POST
|
Not too familiar with the innards of the Flexviewer framework, but looking at the WidgetTemplate and BaseWidget, I don't think calling the MouseEvent is the best way to go about it. After some tinkering I was able to close a widget programatically this way.
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_CHANGE_STATE, {id: this.widgetId, state:WidgetStates.WIDGET_CLOSED}));
So if you can iterate through the widget ids, you should be able to dispatch that event for each widget you want to close. Looking at the event chain on the close_clickHandler for the WidgetTemplate, you may want to set the widget.widgetState before dispatching the ViewContainer event. Just tested on multiple widgets, nevermind, that doesn't work either.
... View more
03-03-2011
08:25 AM
|
0
|
0
|
880
|
|
POST
|
You want to add a field to your attributes to hold the selection, something like isSelected:Boolean arrayCollection1.addItem({filename:filename, isSelected: true}); Then in your checkbox itemrenderer <?xml version="1.0" encoding="utf-8"?>
<s:MXDataGridItemRenderer
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<s:CheckBox id="cb" horizontalCenter="0" selected={data.isSelected}/>
</s:MXDataGridItemRenderer> Then use that when you want to figure out what items to export.
... View more
03-03-2011
03:02 AM
|
0
|
0
|
477
|
|
POST
|
This widget has been updated to that you can now edit your results and attempt to rematch the addresses to get a better score.
... View more
02-22-2011
04:45 AM
|
0
|
0
|
1141
|
|
POST
|
Not sure if this will help, but I had found this somewhere to check out licenses and it has worked for me so far. This will initialize the lowest available license
package org.lacsd.services.helpers;
import java.io.IOException;
import java.net.UnknownHostException;
import com.esri.arcgis.system.AoInitialize;
import com.esri.arcgis.system.EngineInitializer;
import com.esri.arcgis.system.esriLicenseProductCode;
import com.esri.arcgis.system.esriLicenseStatus;
public class LicenseHelper {
/**
* Initializes the lowest available ArcGIS License
*/
public static AoInitialize initializeArcGISLicenses()
{
EngineInitializer.initializeEngine();
AoInitialize aoInit = null;
try {
aoInit = new AoInitialize();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try
{
System.out.println("license type: " + esriLicenseStatus.esriLicenseAvailable);
if (aoInit.isProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeEngine) == esriLicenseStatus.esriLicenseAvailable)
{
aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
}
else if (aoInit.isProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcServer) == esriLicenseStatus.esriLicenseAvailable)
{
aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeArcServer);
}
else if (aoInit.isProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcInfo) == esriLicenseStatus.esriLicenseAvailable)
{
aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo);
}
else
{
System.err.println("Could not initialize an Engine or ArcView license. Exiting application.");
System.exit(-1);
}
// do any extra checkouts here, could probably expand to make sure extension available
// aoInit.checkOutExtension(com.esri.arcgis.system.esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork);
}
catch (Exception e)
{
e.printStackTrace();
}
return aoInit;
}
}
... View more
02-17-2011
08:37 AM
|
0
|
0
|
1645
|
|
POST
|
This might help you out. I just saw that someone put this up the other day http://www.arcgis.com/home/item.html?id=bdd12eac11e14b5ebe11d011b0207120
... View more
02-16-2011
10:28 AM
|
0
|
0
|
511
|
|
POST
|
myWS.getWebServiceData(selectedMortarSize, numStepMaxCharge.value, piIllum, piUSAmmo);
// this happens before data is returned
mortarChargeData = myWS.MortarChargeData;
The problem you are having is you are trying to get the results of your service call from your myWS object before myWS has had a chance to get the process the results. You could have your myWS object dispatch an Event.COMPLETE when it's done, so it would look like
// have your myWS extend EventDispatcher
protected function myResultHandler(event:ResultEvent):void
{
myMortarChargeData = new ArrayCollection();
myMortarChargeData = event.result.Tables.mortarChargeData.Rows;
dispatchEvent(new Event(Event.COMPLETE));
}
Then listen for it
// just an example, you should probably use a named function
myWS.addEventListener(Event.Complete, function(e:Event):void { mortarChargeData = myWS.MortarChargeData; });
myWS.getWebServiceData(selectedMortarSize, numStepMaxCharge.value, piIllum, piUSAmmo);
... View more
02-16-2011
10:24 AM
|
0
|
0
|
379
|
|
POST
|
Try adding a "/" in front of the path in your app like "/assets/images/cross_cursor.png" The mxmlc compiler can be picky about that when using embeds in your app.
... View more
02-11-2011
06:40 AM
|
0
|
0
|
649
|
|
POST
|
I'm having a similar problem with map.setExtent(). It will work the first time that I try it, but will refuse to set the extent after that. Here is how I load my features into my map.
function onResults(results) {
var features = results.features;
var len = features.length;
annexDict = {};
map.graphics.clear();
var sel = dojo.byId("annexSelect");
while (sel.hasChildNodes()) {
sel.removeChild(sel.lastChild);
}
var j = 0;
for (j = 0; j < features.length; j++) {
var feature = features ;
var item = feature.attributes;
var c = dojo.doc.createElement("option");
c.innerHTML = "TEST: " + item.ANNEXATION;
c.value = item.ANNEXATION;
sel.appendChild(c);
annexDict[c.value] = {
annex: item.ANNEXATION,
graphic: feature
}
map.graphics.add(feature);
}
} My results get added a Multiselect list and a dictionary object. Then when an item in the list is clicked, I handle it like this.
function onAnnexInListClicked(e) {
console.log("option was clicked");
if (e.target) {
try {
var targ = e.target;
console.log(targ.value);
var item = annexDict[targ.value];
console.log("from dictionary: Annexation = " + item.annex);
var g = item.graphic;
var geom = g.geometry;
var ext = geom.getExtent();
// tried to explicitly create a new extent, but same result
var xmin = ext.xmin;
var ymin = ext.ymin;
var xmax = ext.xmax;
var ymax = ext.ymax;
var sr = new esri.SpatialReference({wkid: 102100});
var gExt = new esri.geometry.Extent(xmin, ymin, xmax, ymax, sr);
map.setExtent(gExt);
// map.setExtent(ext); // this had the same result
console.log("map extent changed");
} catch(err) {
console.log("error in setting map extent to graphic extent");
console.log(err);
}
}
}
The first time an item is clicked, the map will zoom to the proper location. After that, all subsequent requests to change the map extent seem to have no effect. My console traces show that I am clicking on a new item and no errors are being thrown, so I'm a bit stumped at this point. Any help would be appreciated, thanks.
... View more
02-10-2011
10:22 AM
|
0
|
0
|
1050
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | 12-09-2025 08:20 AM | |
| 1 | 11-13-2025 03:13 PM | |
| 2 | 11-06-2025 11:10 AM | |
| 3 | 11-05-2025 02:54 PM |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|