Select to view content in your preferred language

Could someone share some code for the Locate Widget?

2274
1
12-19-2011 09:59 AM
SteveNelson
Frequent Contributor
Hi guys,
I searched unsuccessfully for some code regarding the Locate Widget.

I'd just like users to enter the street name, then I'd like to hide the hardcoded city/town name.  Now when users enter a street name, they're returned results for all over north america (using the out of the box locator widget).

I'm aware of the configuration file for locate Widget help page, but I just need a cheat sheet on how to get started adding additional fields.
This is the page I'm familiar with http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Locate_Widget/01m30000000r000000/

And I'd just like help getting to this stage:
Where I ask the user to enter street name, city, etc...just need some hints.

Thanks for any help/code you don't mind sharing.
(I'm using Flex Viewer 2.4 still)
Steve

*EDIT*
I'm trying this, but with not much luck

<?xml version="1.0" ?>
<configuration>
<fields>
<field name="Address"/>
<field name="City" defaultvalue="Banff"/>
<field name="State" defaultvalue="Alberta"/>
<field name="Country" defaultvalue="Canada"/>
</fields>
    <locator wkid="4326">http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer</locator>
    <minscore>40</minscore>
    <zoomscale>10000</zoomscale>
</configuration>

<!--
    See Locate widget documentation at
    http://links.esri.com/locatewidget
-->
Tags (2)
0 Kudos
1 Reply
SteveNelson
Frequent Contributor
Figured it out.  I was missing the <usesingleline> tag

<?xml version="1.0" ?>
<configuration>
<usesingleline>false</usesingleline>
<fields>
<field name="Address" alias="Street Address"/>
<field name="City" defaultvalue="Banff"/>
<field name="State" alias="Province" defaultvalue="Alberta"/>
<field name="Zip" visible="false"/>
<field name="Zip4" visible="false"/>
<field name="Country" defaultvalue="Canada"/>
</fields>
    <locator wkid="4326">http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer</locator>
    <minscore>40</minscore>
    <zoomscale>10000</zoomscale>
</configuration>

<!--
    See Locate widget documentation at
    http://links.esri.com/locatewidget
-->
0 Kudos