<?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 Map Mouse Click and Draw in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/map-mouse-click-and-draw/m-p/18997#M513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to reproduce some code in Silverlight that I originally wrote in the Flex API. Basically I am drawing a polyline on the map and need to capture the coordinate of each mouse click as I create the line. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The approach I have taken is to add an event handler to the map mouse click and then capture each map click coordinate as I'm drawing. The problem is that this event seems to get disabled as soon as the draw object is enabled and therefore the event handler never gets fired. I am also using the map's mouse move event which does not seem to get affected the same way by the draw object. This was not the case in Flex so I'm wondering whether this is intentional and if anyone has any suggestions on how to tackle this. I did look at the events on the draw class to see if there was anything there I could use but didn't see anything that would work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Oct 2010 12:37:52 GMT</pubDate>
    <dc:creator>JamesStreet1</dc:creator>
    <dc:date>2010-10-14T12:37:52Z</dc:date>
    <item>
      <title>Map Mouse Click and Draw</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/map-mouse-click-and-draw/m-p/18997#M513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to reproduce some code in Silverlight that I originally wrote in the Flex API. Basically I am drawing a polyline on the map and need to capture the coordinate of each mouse click as I create the line. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The approach I have taken is to add an event handler to the map mouse click and then capture each map click coordinate as I'm drawing. The problem is that this event seems to get disabled as soon as the draw object is enabled and therefore the event handler never gets fired. I am also using the map's mouse move event which does not seem to get affected the same way by the draw object. This was not the case in Flex so I'm wondering whether this is intentional and if anyone has any suggestions on how to tackle this. I did look at the events on the draw class to see if there was anything there I could use but didn't see anything that would work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Oct 2010 12:37:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/map-mouse-click-and-draw/m-p/18997#M513</guid>
      <dc:creator>JamesStreet1</dc:creator>
      <dc:date>2010-10-14T12:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Map Mouse Click and Draw</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/map-mouse-click-and-draw/m-p/18998#M514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use MouseLeftButtonDown on the map and get the MapPoint this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; void MyMap_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; Point screenPoint = e.GetPosition(MyMap);
&amp;nbsp;&amp;nbsp; MapPoint mapPoint = MyMap.ScreenToMap(screenPoint);
&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also use VertexAdded on the draw object and get the MapPoint this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; void MyDrawObject_VertexAdded(object sender, VertexAddedEventArgs e)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; MapPoint mapPoint = e.Vertex; 
&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MouseClick is not raised when Draw is enabled is by design.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:46:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/map-mouse-click-and-draw/m-p/18998#M514</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-10T20:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Map Mouse Click and Draw</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/map-mouse-click-and-draw/m-p/18999#M515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The draw object also has an event that gets fired each time a vertex is added that you can use instead.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Oct 2010 16:44:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/map-mouse-click-and-draw/m-p/18999#M515</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2010-10-15T16:44:23Z</dc:date>
    </item>
  </channel>
</rss>

