Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all 2097 articles
Browse latest View live

Popup Config

$
0
0
I am trying to configure feature popups in the Flex viewer. Basically I want the popup to resemble the popups used in ArcGIS Explorer online. Two columns like a table. I have tried standard html code with no success. Any help would be greatly appreciated. I have attached an image of the popup schema I would like to use in my Flex application.
Attached Thumbnails
Click image for larger version

Name:	10-24-2012 11-43-36 AM.jpg‎
Views:	N/A
Size:	23.7 KB
ID:	18689  

How do I put my layers editable?

$
0
0
How do I put my layers editable? I can not use the widget to edit,... the layers are in a dataset in SDE. I'm using version 3.

I have a message No editable Layers :(
Is configfiguration of Server in SDE??

PopupRenderSkin with radio buttons part 2

$
0
0
I have taken the snippets from here:
http://forums.arcgis.com/threads/479...d=1#post243845

and am trying to get a radio button on the bottom of my popup window that turns on/off thier respective label service.
Everything seems to be working fine as far as the radio buttons, but the infoWinClose_Handler is giving me some issues. It works just fine for the first item/layer clicked on, however, if I get popup info from a "different" layer, I get reference to null object error when I close any other popup window (other than the first one I click on).

Here is what I've gotten so far (well, at least the portions I've added) I have tried several "if" statements to try to get it to only change visibility if it was one of the "toggle" layers, and ignore the "other" popups so I don't get the null issues, but have had no luck.

I need it to close the layer that was toggled on when the widget is closed. Would really be nice if it would close the toggled on layer when "switching" to a different layer as well. This would probalby solve the null issues.

The code that determines which layer to load, toggle on and off, and whether or not to include the toggle buttons is working fine, only the on close function that I'm having issues with.

Any ideas?

R_


Code:

        <fx:Script>
                <![CDATA[

                        [Bindable] var RBlabel:String;            // variable used to capture the current (identified) layer name
                        [Bindable] var RBlayer:String;          //variable used to tell which layer to toggle on/off
                        [Bindable] var RBonsel:Boolean = false;  // variable used to capture "selected" state of the radio button
                        [Bindable] var RBoffsel:Boolean = true;  // variable used to capture "selected" state of the radio button

                        private function skin_preinitializeHandler(event:FlexEvent):void
                        {
                                // set the link styles
//My Add
                                  off.visible = false;
                                on.visible = false;
                                RBlayer = "";
                                RBlabel = "";
                               
                                if (hostComponent.featureLayer.url == "http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/Buildings/MapServer/3"){
                                        off.visible = true;
                                        on.visible = true;                               
                                        RBlayer = "Buildings";
                                        RBlabel = "Building Labels";
                                }
                                if (hostComponent.featureLayer.url == "http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/All_Waste_Sites/MapServer/1"){
                                        off.visible = true;
                                        on.visible = true;                               
                                        RBlayer = "WasteSites";
                                        RBlabel = "Point Labels";
                                }
                                if (hostComponent.featureLayer.url == "http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/All_Waste_Sites/MapServer/2"){
                                        off.visible = true;
                                        on.visible = true;                               
                                        RBlayer = "WasteSites";
                                        RBlabel = "Line Labels";
                                }
                                if (hostComponent.featureLayer.url == "http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/All_Waste_Sites/MapServer/3"){
                                        off.visible = true;
                                        on.visible = true;                               
                                        RBlayer = "WasteSites";
                                        RBlabel = "Poly Labels";
                                }
//End My add
                                textLayoutConfiguration = new Configuration();
                                var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
                                textLayoutFormat.color = getStyle("linkActiveColor")
                                textLayoutFormat.textDecoration = TextDecoration.UNDERLINE;
                                textLayoutConfiguration.defaultLinkActiveFormat = textLayoutFormat;

                                vGroup.addElement(ToggleLayers);  // My Add - this is not where I have it, just wanted to include it somewhere.


//My Add
                        protected function layerRBgroup_changeHandler(event:Event):void
                        {
                                var map:Map = hostComponent.map;
                                if (event.currentTarget.selectedValue == "on"){
                                            map.getLayer(RBlabel).visible = true;
                                                RBonsel = true;
                                                              RBoffsel = false;
                                        }
                                if (event.currentTarget.selectedValue == "off"){
                                    map.getLayer(RBlabel).visible = false;
                                    RBoffsel = true;
                                        RBonsel = false;
                        }
                        }
                        private function infoWinClose_Handler(event:Event):void
                        {
                                var map:Map = hostComponent.map;
                                        map.getLayer(RBlabel).visible = false;
                                        RBoffsel = true;
                                        RBonsel = false;
                                }
                        }                       
//End My add
                ]]>
        </fx:Script>
                <fx:Declarations>
                <!--- @private -->
                <s:RadioButtonGroup id="layerRBgroup" change="layerRBgroup_changeHandler(event)" />
                                <!--- @private -->
                <s:HGroup gap="6" verticalAlign="middle" id="ToggleLayers">
                        <s:RadioButton id="on" value="on" group="{layerRBgroup}" label="Turn Labels On" selected="{RBonsel}" />
                        <s:RadioButton id="off" value="off" group="{layerRBgroup}" label="Turn Labels Off" selected="{RBoffsel}" />
                </s:HGroup>
        </fx:Declarations>
</s:SparkSkin>

Solution - switching between tiled services in different projections.

$
0
0
Hi everyone, I would like to share with you some thoughts about the topic of this discussion. We had to edit the Flex Viewer source code to enable changing map spatial reference for our project and I saw that a lot of people were asking similar question here so I think I can give you my solution.
First of all I would like to thank Dasa Paddock for some thoughts in this thread: http://forums.arcgis.com/threads/693...is-it-possible.
I'm aware my solution might not be the best solution out there but still it might give someone some insight on the topic. Before I start with some code I need to make sure you understand that this is solution specific for our project! Few things are needed but few things you will have to adjust to your needs(i will mark them in code).
Ok let's start:
Config.xml -> map tag, change the mapwraparound180 to false.
In MapManager.mxml we defined these variables:
Code:

//needed
private var opLayerArr:Array = new Array();
private var timer:Timer = new Timer(200); // delay of the timer is
private var visibleLayers:ArrayCollection;
private var mPoint:MapPoint;
private var visibleBasemaps:ArrayCollection = new ArrayCollection();
private var tiled:String = "tiled";
private var osm:String = "osm";
private var bing:String = "bing";
//for our project
private var webMercator:Number = 102100;
private var pol92:Number = 2180;
private var Compass:String = "Compass";

Now i want to populate opLayerArr with operational layers loaded from config.xml. So in MapManager.mxml find function "addLayerToMap", change the definition of this function:
Code:

private function addLayerToMap(layerObject:Object, isOperationalLayer:Boolean):void
//next inside this function add:
if(isOperationalLayer == true)
{       
      opLayerArr.push(layer);
}

Now find functions: private function loadNextOpertionalLayer():void and private function loadNextBasemapLayer():void
Code:

private function loadNextBasemapLayer():void
{
      var basemapLayerObject:Object = m_basemapLayers[m_basemapLayerIndex];
      addLayerToMap(basemapLayerObject, false);
      configureLayerRenderer(basemapLayerObject, false);
}
private function loadNextOpertionalLayer():void
{
      var optLayerObject:Object = m_operationalLayers[m_operationalLayerIndex];
      addLayerToMap(optLayerObject, true);
      configureLayerRenderer(optLayerObject, true);
}

Now go to private function basemapSwitchHandler(event:AppEvent):void
Code:

if (layer.id == basemapLabel)
{
      if (layer.id == selectedLabel)
      {
          var layerType:String = configBasemaps[i].type; //get type of the basemap service
            LoadBaseMaps(selectedLabel, layerType, layer, i, layers);
//call LoadBaseMaps function
      }
      else
      {
            layer.visible = false;
      }
}

Now function LoadBaseMaps:
Code:

var currentCenterPoint:MapPoint = map.extent.center;
var currentWKID:Number = map.spatialReference.wkid;
if(layerType == tiled || layerType == osm || layerType == bing)
{
        var toWKID:Number;
        (selectedLabel == Compass) ? toWKID = pol92 : toWKID = webMercator; // ok this is for our project you
        // will have to adjust this to your needs- we know that only one mapservice has different spatial reference and rest is in
        // web mercator

        if(toWKID != currentWKID)
        {
                ProjectPoint(currentCenterPoint, toWKID);
                ChangeSpatialRef(toWKID);
                map.lods = layers[i].tileInfo.lods;
                visibleBasemaps.addItem(layer);
        }
        else
        {
                layer.visible = true;
                map.lods = layers[i].tileInfo.lods;
        }
}
else
{
        layer.visible = true;
}
//if layer is tiled(or bing or osm) do some logic, else just turn it visible

Now project map.extent.center to new spatial reference so we can pan the map to the right place:
Code:

private function ProjectPoint(mapPoint:MapPoint, toWKID:Number):void
{
        try
        {
                var projectParams:ProjectParameters =  new ProjectParameters();
                projectParams.geometries = [mapPoint];
                projectParams.outSpatialReference = new SpatialReference(toWKID);
                geometryService.project(projectParams);
        }
        catch(er:Error)
        {
                //your logic for error                       
        }
}

Next is ChangeSpatialRef function:
Code:

private function ChangeSpatialRef(toWKID:Number):void
{
        map.spatialReference.wkid = toWKID;
        RefreshLayers();
}

After changing spatial reference we need to refresh all operational layers plus I want to 'remember' which op layers were visible:
Code:

private function RefreshLayers():void
{
        visibleLayers = new ArrayCollection();
        for each (var layer:Layer in opLayerArr)//this is what why we need the opLayerArr                                       
        {
                for each(var layerW:Layer in map.layers)
                {
                        if(layer == layerW)
                        {
                                if(layerW.visible == true)
                                {
                                        visibleLayers.addItem(layerW);
                                        layerW.visible = false;
                                }
                                layerW.refresh();
                        }
                }
        }
}

Now when the Geometry Service completes projection do this:
Code:

private function onProjectComplete(event:GeometryServiceEvent):void
{
        mPoint = event.result[0] as MapPoint;
        map.centerAt(mPoint);
        timer.start();//i want to be sure that map recentered so i will check it with timer
        // in private function this_creationCompleteHandler():void add -> timer.addEventListener(TimerEvent.TIMER, CheckExtent);
}

Ok so let's check the extent(to be precise - let's check the center point of extent). I dont know why but honestly from the beginning there was a problem with recentering the map in onProjectComplete function so we had to add timer to make sure the extent will change.
Code:

private function CheckExtent(event:TimerEvent):void
{
        if(map.extent.center != mPoint)
        {
                map.centerAt(mPoint);
                SetLayersVisible();
                timer.stop();
        }
        else
        {
                SetLayersVisible();
                timer.stop();
        }
}

And the last function(note: I wanted to be sure that I turn on layers only when the extent is correct so making them visible is the last thing to do)
Code:

private function SetLayersVisible():void
{
        for each(var l:Layer in visibleBasemaps)
        {
                l.visible = true;
        }
        for each(var layer:Layer in visibleLayers)
        {
                for each(var lay:Layer in map.layers)
                {
                        if(layer == lay)
                        {
                                lay.visible = true;
                        }
                }
        }
        visibleBasemaps.removeAll();
        visibleLayers.removeAll();
}

So this is it. I'm aware many of you would do this better, faster etc. but this is a discussion so you can point me few things that should be done different.
Few notes:
1.You will have to deal with LODs for dynamic/wms map services - if you don't want them just clear the map.lods array -> you can show dynamic services in scales of one of your tiled service.
2.We tested this with LayerListWidget, Legend and few other(CoordinateMenuWidget, BookmarkWidget[*], DrawAndMeasureWidget..) and they all works. No errors at all.
3.As I said - adjust this to your project!
4.Solution for OverviewMap in next post - this is already too long;)
*In bookmark widget you'll have to make few changes to make it work in all spatial refenerces in your project.

Regards
MDruzgala

MapServicesWidget for 3.0

$
0
0
Hey guys, I have successfully been using the very useful MapServices widget in my 2.4 viewers. I am migrating to 3.0 at the minute and wondered if anyone knew if there was an upgraded MapServicesWidget compatibile for 3.0 available?
I am not skilled enough to modify the code, and currently i just recieve the error #2036 when testing it out.

Look forward to hearing back from you.

All the best,

Caroline

Search widget

$
0
0
Does the search widget not work well when using an integer field in the expression? I was having some major issues when entering an id that was an integer. When I created a new string field and moved the ids over to that field and then changed the expression to the new field, everything worked great. Perhaps it is just how the expression was written.

Id = '[value]' original set up with integer field
Cause = '[value]' new setup that works with the new string field

[value] supposed to be something different for integers? The only example in the help looks like the above. It really at this point isn't an issue since I changed the field type but I was wondering for future reference the more appropriate way to deal with this.

Basic Search 3.0 returns 500 results ALWAYS!

$
0
0
Hello folks,

For the past 6 months or so we've had a basic parcel mapping flex viewer in place. One of the most-used features is the ability to locate a parcel based on street address. This is done via the "out of the box" Search widget.

This has worked well for several months, but recently anytime a search is performed, 500 results are returned - and strangely always the same 500. This happened more or less out of the blue, no modifications ahve been made to the viewer in quite some time.

I have checked both the viewer config file as well as the search widget config file (see both below) and see no glaring issues. I also have opened the map that the pertinent service is based on and cannot re-create the error using the FIND tool in Desktop.
I also have restarted and re-published the pertinent service; I have also physically restarted the server. No progress.

The text of the .xml files for each are attached. We are running Flexviewer 3.0 and Server/SDE 9.31

Any thoughts on what might be going on?

Thanks in advance!
Sean
Attached Files

eSearch Widget on Graphical Search

$
0
0
I want to disable some of the functions on Graphical Search. See the attachment file. I commented out some of the functions but my spatial seach won't function correctly after commented out these lines:

<s:Image toolTip="{includetextquerywarnTip}" visible="{(cboLayerGraphical.selectedItem != cboLayerText.selectedItem)}"
width="{includeTextQuery.width}" height="{includeTextQuery.height}"
source="{WIDGET_URL + 'blank.png'}" fillMode="repeat"
includeInLayout="{(cboLayerGraphical.selectedItem != cboLayerText.selectedItem)}"/>
<s:CheckBox id="includeTextQuery" selected="false" label="{lblInclueTextQuery}"
enabled="{(cboLayerGraphical.selectedItem == cboLayerText.selectedItem)}" />

Please show me the easy ways.

Thanks.
Attached Thumbnails
Click image for larger version

Name:	search.png‎
Views:	N/A
Size:	38.1 KB
ID:	18721  

Load Shapefile for flexviewer 3.0

$
0
0
One our users raised the question if it is possible to upload a shapefile with GPS points into our flexviewer web map.

I don't have the right solution. Will one of the existing widget eventual do this.

Thanks for any good ideas.

Ivan Baehr
Web GIS Specialist
UNOSAT

where is the close icon in the widget window?

$
0
0
i am from China and just begin to learn flexviwer , i user flash builder 4.5.
why the popwindow of widget can not be see? how can i do? i try to find answer in baseWidget.as but failed.
Attachment 18761
Attached Thumbnails
Click image for larger version

Name:	no_close.jpg‎
Views:	N/A
Size:	14.6 KB
ID:	18761  

Question about editwidget

$
0
0
Is this possible with the editwidget or some other widget: Allow users via the webviewer to click on a feature in a featurelayer and have a popup show the value for a particular field for that featuer and allow the user to edit that value (from a dropdown of selections)? I don't see how to do this. Any help is appreciated.

Draw Show Measurements not working

$
0
0
Hello

I added the standard Draw & Measure tool to a Flex Viewer application - all worked fine.

I then added the Coordinate Menu widget to the site so that I had copy and go to XY options in the context menu when I right clicked on the map.

To get the Coordinate Menu tool to work I started the in built Geometry Service and pointed the site and the config.xml to this geometry service. The Coordinate Menu works fine, the corrdinates in the bottom of my screen work fine, however the Draw tool errors when the Show Measurements option is ticked.

The error message is:
[FaultEvent fault=[RPC Fault faultString="Error executing project" faultCode="500" faultDetail=""] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]

Have I missed something - I'm using ArcGIS Server 10.1.
Any ideas would be much appreciated as I'm completely stumped by this

Thanks
Emma

Confused, need suggestions on best way to consume my flex-builder maps

$
0
0
So. I have started working with flex viewer-App builder and have successfully created a few Web Apps that function really well. But now I am confused as to whether or not I am going in the wrong direction when it comes to be able to deploy these maps to our field people. We ultimately want to have our field crews using tabulates. I understand that Apples IOS does not support flash plug-ins. And that Android does. now I am reading, hearing that Android is not the way to go because Adobe is doing something with flash and the new androids will not support flash plug-ins. So needless to say I am very confused at this point with what direction I should be headed in. Is it best then to buy adobe flash builder and learn how to create my own map apps that will allow us to use our flex viewer builder maps that I have created or should I be concentrating my efforts somewhere else. I have little to no programming experience which is why I liked builder a lot. If someone could please give me an idea as to what tabulates would be best for us to use or which is the easiest ones to create web apps for if that's what we need to do. We are a smaller organization so our field crews don't edit data just view and query, look at linked drawings, in the field. From my reading I am guessing that building map apps in adobe flash builder with Arcviewer flex API is probably the best route to ensure that any tabulate we use will consume my builder web apps. Please help me be less confused. Sorry for such a long post but in need of some guidance/ideas.
Erik

IdentifyTask and Select By Rectangle

$
0
0
Is it possible to use the Identifytask with a 'Select By Rectangle' tool that would allow an option to select features within the rectangle and not intersecting it?

private vs protected

$
0
0
I'm a big fan of inheritance. It lets you build on someone else's work without needing to clone or fork it, plus you automatically benefit from future fixes and enhancements. Seems perfect for open source development, right? I can't help noticing that everything in the ArcGIS Flex Viewer and its widgets are declared private though, making inheritance impossible. Is there a reason why everything is private and not protected?

Advanced Print - Map annotation error

$
0
0
Hello

I'm running Server v10.1 with the newest Flex Viewer and have followied the online tutorial to configure the Print widget to use my own print geoporcessing service for advanced print/map exporting.

I have added 4 custom print templates.

The tool works fine with all my layers and the custom layouts. However I get odd results when trying to print a map with lines and squares added using the standard draw tool.

If I add a square to the map that has no outline it prints correctly but if I add one with an outline then the outline appears on the print page so wide it obscues the rest of the map, even though it looks correct on the map screen! Wierdly this only occurs when I use my custom made print layouts, the default MAP_ONLY layout shows anything I've added to the map fine.

Have I done something wrong when I've made my custom layouts?

Thanks

Emma

Application running very slow on public side

$
0
0
I have created a Flexviewer application and I am having problems with it rendering very slowly on the public viewing side. Depending on the computer and Internet Speed, it takes up to 30-60 seconds for the page to fully load. Our ArcGIS server is not public so I set up a virtual directory on our Counties webserver connecting to the application on our ArcGIS server. I am using a proxy page to get to the data out.

Does any else have this problem? Could the proxy be what is slowing this down? I have most of the data in the mapped cached so I don't think that is the problem.

Flex Viewer Search Periodically does not Search

$
0
0
Has anybody had a problem with the Flex Viewer Search Widget periodically not working for a short period of time, than continuing to work again? When it does not work, if the search button is clicked, it does not do anything. I have been unable to narrow it down to a certain time of day that these outages occur, but they are usually maybe 15-30 min. in length.

http://maps.hamiltontn.gov/hcflex/

Is a link to my site. It is the Search Widget (binoculars) where the problem occurs. If anybody has a solution, or any tips that might be causing this. Your input would be greatly appreciated.

Thanks,
Ray

Creating a hyperlink that will work in the search widget

$
0
0
Hello all,

I'm trying to create a hyperlink to a picture of our tax cards. The link is stored in a field in the parcels attribute table and looks like this:

<a href="http://208.88.162.36/inVizeDA/view.aspx?section=30&folder=12811" target="_blank">Tax_Card</a>

The code for the search widget looks like this

<layer>
<name>Address</name>
<url>http://radfordgis.radford.va.us/ArcGIS/rest/services/RealestateData/MapServer/3</url>
<expression>LOCADDR LIKE '%[value]%'</expression>
<textsearchlabel>Search by Full Address [ex. 123 Monroe St]:</textsearchlabel>
<graphicalsearchlabel>Use one of the graphical search tools to select addresses</graphicalsearchlabel>
<fields>
<field name="LOCADDR" alias="Address" />
<field name="TAXACCT" alias="Tax Account"/>
<field name="OWNER1" alias="Owner" />
<field name="Legal1" />
<field name="TotVal1" />
<field name="CARDLINK" alias="Tax card link"/>
</fields>
<titlefield>ADDRNUM</titlefield>
<linkfield>CARDLINK</linkfield>
<gridfields>FULLADDR</gridfields>
<gridhyperfields showalias="true"/>
<zoomscale>2000</zoomscale>
</layer>

When I identify a parcel and click on the link that looks like a triangle on the right side of the widget it opens a new tab and has this error message "Bad Request" and the URL in the address bar is:

http://radfordgis.radford.va.us/flex...x_Card%3C/a%3E

Any help getting this link to work would be great,

Thanks!

Esearch Widget - Popup and Results Window Records

$
0
0
Hi all -

Is it possible to show different records in the results and popup windows using the Esearch Widget? I'd like to show just one or two fields in the results window, but then show all 10 fields in the popup window, including any attachments. The xml Robert provided is helpful with showing or not showing on the datagrid etc, but was wondering if I'm missing a popup component.

Thanks, Meg
Viewing all 2097 articles
Browse latest View live