Oh so MyMap belongs to MainPage.xaml but you need to update it's properties in WindowPanel.xaml. Does WindowPanel contain MainPage? If yes, you probably have something like: <local:MainPage x:Name="MainPage"/> Provide this instance a name so you can access MyMap by using this.MainPage.MyMap...
<local:MainPage x:Name="MainPage"/>
"MyMap" in the code I posted is the name of the map from the sample. You might have renamed the map to something else, you should use that name instead.
Are you referring to this sample? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#IdentifyIf yes, you can clear the graphics layer by doing the following: GraphicsLayer layer = this.MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; if (layer != null) layer.Graphics.Clear(); // or layer.ClearGraphics(); where "MyGraphicsLayer" is the ID of the layer whose graphics you need to clear.Also to ensure that IdentifyTask is no longer performed on MouseClick, you can either* unsubscribe to this event so succeeding MouseClicks do not perform an IdentifyTask, orthis.MyMap.MouseClick -= QueryPoint_MouseClick;* use a private boolean to denote if IdentifyTask need to be created and check if that is true/false before performing an IdentifyTask.bool identifyTaskEnabled = false; //set to true/falseprivate void QueryPoint_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e){if (!identifyTaskEnabled ) return; // to skip the code that follows... //IdentifyTask code goes here}
GraphicsLayer layer = this.MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; if (layer != null) layer.Graphics.Clear(); // or layer.ClearGraphics();
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.