<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MXML checkbox toggle mappoints on/off in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587459#M13174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anthony, thanks - I had considered doing that (using layers); the ESRI/Flex demo code showed how to do on/off toggling using layers.&amp;nbsp; I have seen layers used for shapes, but not so much for mappoints, but I guess that's possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will give using layers a shot!&amp;nbsp; Thanks, Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jan 2014 11:58:19 GMT</pubDate>
    <dc:creator>TomRauch</dc:creator>
    <dc:date>2014-01-29T11:58:19Z</dc:date>
    <item>
      <title>MXML checkbox toggle mappoints on/off</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587457#M13172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I am stumped about how to turn on and off a set of mappoints that meet a certain criteria indicated in MXML checkbox choices.&amp;nbsp; In my application, I want to be able to show facilities of a particular size (Large, Medium, Small).&amp;nbsp; When a user clicks "Large" on the checkbox, only facilities identified as Large appear as mapoints; the same would be true for Medium and Small.&amp;nbsp; When the user unclicks "Large" those facilities (and their associated mappoints) are cleared.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far, in the code below, I can get a large red square to appear when the user clicks the "Large" checkbox; however, when the user unclicks "Large" that red square persists.&amp;nbsp; I know the code is running to the "else" condition because I have a trace set up that appears when I debug.&amp;nbsp; I suspect it has something to do with "wmp2_Q1" which is a WebMercatorMapPoint, but I can't figure out how to remove it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help/guidance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;protected function checkbox1_clickHandler(event:MouseEvent):void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
if (Q1_cb.selected) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
var employees_from_facility_Q1: Array = from_query.filter(set_population);
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 for (var i:uint = 0; i &amp;lt; employees_from_facility_Q1.length; ++i){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; var myGraphicMarker_Q1: Graphic = new Graphic(new WebMercatorMapPoint(employees_from_facility_Q1&lt;I&gt;.facility_lon, employees_from_facility_Q1&lt;I&gt;.facility_lat), new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 30, 0xFF3333, 0.5));
&amp;nbsp; var wmp2_Q1: WebMercatorMapPoint = new WebMercatorMapPoint(employees_from_facility_Q1&lt;I&gt;.facility_lon, employees_from_facility_Q1&lt;I&gt;.facility_lat);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; myGraphicsLayer.add(myGraphicMarker_Q1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; myMap.centerAt(wmp2_Q1);&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; myGraphicsLayer.refresh(); }}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; 
else {
 myGraphicsLayer.remove(myGraphicMarker_Q1);

 trace ("selected false");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 myGraphicsLayer.refresh();}}
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

private function set_population(element:*, index:int, arr:Array): Boolean{
 return (element.employees_per_facility &amp;gt; markerQ2);}
&amp;nbsp;&amp;nbsp; &lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 00:30:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587457#M13172</guid>
      <dc:creator>TomRauch</dc:creator>
      <dc:date>2014-01-29T00:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: MXML checkbox toggle mappoints on/off</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587458#M13173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tom,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I would do is on load of the widget create 3 graphics layers one for each size, large, medium and small. Add the graphics you want on each layer and add the layers to the map but set the visible attribute of the layer to false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then all you need to do when the checkbox is selected/deselected is make the corresponding graphics layer visibility equal to the checkbox selected value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anthony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 05:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587458#M13173</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-01-29T05:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: MXML checkbox toggle mappoints on/off</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587459#M13174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anthony, thanks - I had considered doing that (using layers); the ESRI/Flex demo code showed how to do on/off toggling using layers.&amp;nbsp; I have seen layers used for shapes, but not so much for mappoints, but I guess that's possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will give using layers a shot!&amp;nbsp; Thanks, Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 11:58:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587459#M13174</guid>
      <dc:creator>TomRauch</dc:creator>
      <dc:date>2014-01-29T11:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: MXML checkbox toggle mappoints on/off</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587460#M13175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anthony, thanks - that approached worked!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Feb 2014 13:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587460#M13175</guid>
      <dc:creator>TomRauch</dc:creator>
      <dc:date>2014-02-01T13:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: MXML checkbox toggle mappoints on/off</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587461#M13176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tom,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No probs glad you got your solution. Please don't forget to mark the post as answered.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anthony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Feb 2014 13:29:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/mxml-checkbox-toggle-mappoints-on-off/m-p/587461#M13176</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-02-01T13:29:50Z</dc:date>
    </item>
  </channel>
</rss>

