Select to view content in your preferred language

Enhanced Search not honoring zoomScale

2637
14
05-12-2011 01:09 PM
JayGeisen
Regular Contributor
For some reason, when I click on a returned record in the eSearch widget, it zooms all the way in instead of honoring the scale I have set in the xml file.  Any ideas why this might be (probably my doing I would bet)?
Tags (2)
0 Kudos
14 Replies
JayGeisen
Regular Contributor
Now that I look more closely, it appears that the zoom is set to "zoom to selected records" instead of a specific scale.  Is this expected behavior?  What might be causing this?
0 Kudos
MikeKellison
Deactivated User
Jay, I am having the same problem.  Any fix yet?
0 Kudos
JayGeisen
Regular Contributor
Nothing yet.  I'm thinking this might be the default behavior (zoom to selected) maybe?  It never used to be the case though.  I actually kind of like the option to zoom to selected, but I wish it would honor the scale if one is specified.  I'm wondering if anyone else is experiencing this?
0 Kudos
DanielMunoz
Regular Contributor
I'm experiencing the same problem. I even changed:

private var zoomScale:Number = 5000;

in the SearchWidget.mxml

but not luck.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Guys,

   This is fixed in the latest version with the addition of a new attribute in the SearchWidget.xml. look for usegeometry on the zoomscale for each layer. In both of your case you will not have to add this attribute because you are wanting it to use your scale and not the geometry.
0 Kudos
MikeKellison
Deactivated User
Works great now.  Thanks Robert!
0 Kudos
JayGeisen
Regular Contributor
Hey Robert,

I am still getting this behavior, regardless of whether I use version 2.4 of the eSearch or my current (version 2.31) one.  If using version 2.31, I add in the code from 2.4 that specifies the usegeometry variable.  Any ideas?

Thanks,
Jay
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jay,

   Are you setting the usegeometry="false" attribute?

This works fine:

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Louisville Zoning</name>
            <url>http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/2</url>
            <expressions>
                <expression alias="Zoning Code" textsearchlabel="Search Zoning Code [ Example: OR1 ]:" userlist="OR1,C2,OTF" >upper(ZONING_CODE) = upper('[value]')</expression>
                <expression alias="Zoning Type" textsearchlabel="Search Zoning Type [ Example: RESIDENTIAL ]:">upper(ZONING_TYPE) = upper('[value]')</expression>
                <expression alias="Zoning Name" textsearchlabel="Search Zoning Name [ Example: RES MULTI-FAMILY ]:">upper(ZONING_NAME) LIKE upper('%[value]%')</expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Zoning</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>ZONING_NAME</titlefield>
            <linkfield linkprefix="" linksuffix=""></linkfield>
            <icon isfield="true" iconprefix="" iconsuffix=""></icon>
            <fields all="true" />
            <zoomscale usegeometry="false">10000</zoomscale>
        </layer>
0 Kudos
JayGeisen
Regular Contributor
Yes, I added that line in the xml file and the following to the mxml:

if ((lyrList.zoomscale.@usegeometry) && (lyrList.zoomscale.@usegeometry == "true"))
 {
      zoomScale = Number.NaN;
 }else{
      if (Number(lyrList.zoomscale) > 0)
    zoomScale = Number(lyrList.zoomscale);
 }      
// if (Number(lyrList.zoomscale) > 0)
// zoomScale = Number(lyrList.zoomscale);
0 Kudos