<?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: Manually fire mapClick with infoWindowRenderersEnabled=true in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648950#M14391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have managed to dispatch a MapMouseEvent and get the relevent handler to fire but am getting an exception thrown:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;TypeError: Error #1009: Cannot access a property or method of a null object reference.
 at com.esri.ags.events::MapMouseEvent/get stageX()&lt;C&gt;
 at com.esri.ags.handlers::InfoWindowRendererHandler/map_clickHandler()&lt;C&gt;
 at flash.events::EventDispatcher/dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at mx.core::UIComponent/dispatchEvent()&lt;/C&gt;&lt;/C&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would appear that the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;InfoWindowRendererHandler.map_clickHandler()&lt;/SPAN&gt;&lt;SPAN&gt; requires the stageX/Y values to be set on the MapMouseEvent but there's no way to programatically do this (that I can figure out). Instantiating a new MapMouseEvent doesn't set these values and they're read-only on the object once it's been created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This feels like a bug / shortcoming of either the MapMouseEvent constructor for not populating these values, or of the InfoWindowRendererHandler.map_clickHandler() for requiring these values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideas on workarounds or solutions would be greatly appreciated! Unfortunately, the code for the MapMouseEvent and the InfoWindowRendererHandler is compiled into the API and not available to me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 03:30:36 GMT</pubDate>
    <dc:creator>NicholasRanicar</dc:creator>
    <dc:date>2021-12-12T03:30:36Z</dc:date>
    <item>
      <title>Manually fire mapClick with infoWindowRenderersEnabled=true</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648949#M14390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if you click the map in the Flex Viewer when infoWindowRenderersEnabled is true, a popup is displayed that contains details of all features found at that location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I programatically dispatch a MapMouseEvent.MAP_CLICK event to the map, nothing happens.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know which object is handling this map click event, or how I can programatically fire it to get the infoWindow to display?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nic&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 14:45:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648949#M14390</guid>
      <dc:creator>NicholasRanicar</dc:creator>
      <dc:date>2012-11-29T14:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Manually fire mapClick with infoWindowRenderersEnabled=true</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648950#M14391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have managed to dispatch a MapMouseEvent and get the relevent handler to fire but am getting an exception thrown:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;TypeError: Error #1009: Cannot access a property or method of a null object reference.
 at com.esri.ags.events::MapMouseEvent/get stageX()&lt;C&gt;
 at com.esri.ags.handlers::InfoWindowRendererHandler/map_clickHandler()&lt;C&gt;
 at flash.events::EventDispatcher/dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at mx.core::UIComponent/dispatchEvent()&lt;/C&gt;&lt;/C&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would appear that the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;InfoWindowRendererHandler.map_clickHandler()&lt;/SPAN&gt;&lt;SPAN&gt; requires the stageX/Y values to be set on the MapMouseEvent but there's no way to programatically do this (that I can figure out). Instantiating a new MapMouseEvent doesn't set these values and they're read-only on the object once it's been created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This feels like a bug / shortcoming of either the MapMouseEvent constructor for not populating these values, or of the InfoWindowRendererHandler.map_clickHandler() for requiring these values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideas on workarounds or solutions would be greatly appreciated! Unfortunately, the code for the MapMouseEvent and the InfoWindowRendererHandler is compiled into the API and not available to me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:30:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648950#M14391</guid>
      <dc:creator>NicholasRanicar</dc:creator>
      <dc:date>2021-12-12T03:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Manually fire mapClick with infoWindowRenderersEnabled=true</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648951#M14392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've done some more investigation and playing around...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var mme:MapMouseEvent = new MapMouseEvent(MapMouseEvent.MAP_CLICK, map, idResult.point);
var result:Boolean = dispatchEvent(mme);&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;No exceptions are thrown but nothing happens either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var mme:MapMouseEvent = new MapMouseEvent(MapMouseEvent.MAP_CLICK, map, idResult.point);
var result:Boolean = &lt;STRONG&gt;map.&lt;/STRONG&gt;dispatchEvent(mme);&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I get the exception listed in the original posting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Conclusion: it looks like the event needs to be dispatched by the map object as well as the event having a reference to the map object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var result:Boolean = map.dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false));&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;No exceptions are thrown but nothing happens either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Conclusion: it looks like the event needs to be a MapMouseEvent, not just a regular MouseEvent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Finally, if I do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var mme:MapMouseEvent = new MapMouseEvent(MapMouseEvent.MAP_CLICK, map, idResult.point);
var sp:Point = map.toScreen(idResult.point);
mme.localX = sp.x;
mme.localY = sp.y;
var result:Boolean = map.dispatchEvent(mme);&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I still get the exception thrown in the original posting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Conclusion: setting coordinates on the MapMouseEvent makes no difference, so I'm really not sure how to prevent the exception thrown in the original posting...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:44:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648951#M14392</guid>
      <dc:creator>NicholasRanicar</dc:creator>
      <dc:date>2021-12-12T16:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Manually fire mapClick with infoWindowRenderersEnabled=true</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648952#M14393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you please explain your use case?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, this sample may help you:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Display_popups_programmatically/01nq0000008v000000/"&gt;http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Display_popups_programmatically/01nq0000008v000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 20:27:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648952#M14393</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2012-12-14T20:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Manually fire mapClick with infoWindowRenderersEnabled=true</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648953#M14394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dasa,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've found an alternative solution which is working well, however, what I was trying to do was to programatically launch the default map infoWindowRenderer at a given map point. I wanted to use the Identify task to find features within an extent and then use the mouseOver event for each of the found features to display all features falling under the center point of that feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I knew that I could manually build up popup renderers from the Identify task results but was hoping to make use of all of the configuration work already done for popups for each layer in the default map viewer config.xml. It would be nice to be able to configure layer definitions just once in the application and use that throughout the application, rather than have each widget need its own configuration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nic&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 20:52:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/manually-fire-mapclick-with/m-p/648953#M14394</guid>
      <dc:creator>NicholasRanicar</dc:creator>
      <dc:date>2012-12-14T20:52:44Z</dc:date>
    </item>
  </channel>
</rss>

