POST
|
Hi Charlie, Thank you for your post! I have experienced the same behavior with the ArcGISDynamicMapServiceLayer last Friday. I am programmatically changing Opacity, VisibleLayers and LayerDefinitions, calling Refresh after that. After a few calls to the Refresh the memory consumptions jumps very high, and the application becomes unusable, or very slow. I had to change my design and avoid using the ArcGISDynamicMapServiceLayer - it was possible in my scenario. Hope, this will be resolved soon!
... View more
10-18-2010
12:50 PM
|
0
|
0
|
454
|
POST
|
Hi Kevin, If nothing else works, try the script in this thread, it works for me (I scheduled it to run every 15 minutes): http://forums.esri.com/Thread.asp?c=158&f=2276&t=228654&mc=137#812067 Good Luck!
... View more
10-12-2010
06:08 AM
|
0
|
0
|
221
|
POST
|
Hello xaria, Here is a sample, that you can see in the Symbol Gallery: [HTML] <esri:MarkerSymbol x:Name="CustomSelectRectangleMarkerSymbol" OffsetX="10" OffsetY="10"> <esri:MarkerSymbol.ControlTemplate> <ControlTemplate> <Grid Width="20" Height="20" x:Name="RootElement"> <vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup x:Name="CommonStates"> <vsm:VisualState x:Name="MouseOver" /> <vsm:VisualState x:Name="Normal" /> </vsm:VisualStateGroup> <vsm:VisualStateGroup x:Name="SelectionStates"> <vsm:VisualState x:Name="Selected"> <Storyboard> <ColorAnimation BeginTime="00:00:00" Storyboard.TargetName="myrectangle" Storyboard.TargetProperty="(Rectangle.Stroke).(SolidColorBrush.Color)" To="Red" Duration="0:0:.25" /> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="myrectangle" Storyboard.TargetProperty="StrokeThickness" Duration="0:0:.5" RepeatBehavior="Forever"> <LinearDoubleKeyFrame KeyTime="0" Value="3" /> <LinearDoubleKeyFrame KeyTime="00:00:0.25" Value="1" /> <LinearDoubleKeyFrame KeyTime="00:00:0.5" Value="3" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </vsm:VisualState> <vsm:VisualState x:Name="Unselected" /> </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups> <Rectangle x:Name="myrectangle" RadiusX="4" RadiusY="4" Fill="White" Cursor="Hand" Stroke="Blue" StrokeThickness="3" /> </Grid> </ControlTemplate> </esri:MarkerSymbol.ControlTemplate> </esri:MarkerSymbol> [/HTML] Look at the SelectionStates - Selected and Unselected. And here is the link to the Gallery, so you can find some other samples: http://help.arcgis.com/en/webapi/silverlight/samples/SymbolGalleryWeb/start.htm Good Luck!
... View more
10-06-2010
05:43 AM
|
0
|
0
|
138
|
POST
|
Hi Shaning, I think you are seeing an issue with the OverviewMap discussed in this forum: http://forums.arcgis.com/threads/10033-Overview-map-does-not-show-contents-until-after-view-extent-changed?highlight=overviewmap I am looking for a workaround of the same issue. Hope, someone has already found it. 🙂 I will post back when I come up with a solution.
... View more
10-06-2010
05:32 AM
|
0
|
0
|
212
|
POST
|
Yes. Well, I wanted an easy answer, but the message needs to have more than 10 characters. 😄
... View more
10-06-2010
05:26 AM
|
0
|
0
|
126
|
POST
|
Hi bpangtay, Yes, you can change the where clause of the FeatureLayer at runtime. All you have to do is: FeatureLayer fLayer = Map.Layers["queryLayer"] as FeatureLayer;
string where = "STATE_NAME LIKE 'NORTH%'";
//set the where clause of the feature layer
fLayer.Where = where;
fLayer.Update();
And if you need to manipulate the Graphics on the layer after they have been updated, you can handle the UpdateCompleted event. Good Luck!
... View more
10-06-2010
05:24 AM
|
0
|
0
|
405
|
POST
|
Hi guys, I have played with the TimeSlider today a little bit (very cool BTW), and while trying to make a HeatMapLayer change when the Value of the TimeSlider changes by handling the ValueChanged event I noticed that my NewValue and OldValue of the ValueChangedEventArgs class are reversed. Example: On the slider, I change the date from 09/20/2010 to 09/19/2010, and I expect my OldValue.End to be 09/20/2010, and NewValue.End to be 09/19/2010, but they are reversed. Is this a bug, or I am not interpreting the properties correctly? Thank you!
... View more
10-01-2010
12:15 PM
|
0
|
1
|
335
|
POST
|
Hi Russel, I am using the aliases to show more meaningful field names in DataGrids, MapTips, ... //The parameter "aliases" is a Dictonary<string, string> and you can hardcode it,
//get the data form XML config file, or from a database.
//Here is how you can create it:
Dictionary<string, string> aliases = new Dictionary<string, string>();
aliases.Add("OriginalFieldName1", "FieldNameAlias1");
aliases.Add("OriginalFieldName2", "FieldNameAlias2");
aliases.Add("OriginalFieldName3", "FieldNameAlias3");
aliases.Add("OriginalFieldName4", "FieldNameAlias4"); This will only work though if your DataGrid has the same aliases as headers. And here is where my code doesn't work, because I always use Aliases, and I did not cover the scenario when Aliases are not used. (Sorry, my bad). I don't have time to do any testing, but try to add the "if statement" below, and see if it will work with no aliases (see the comments): foreach (Graphic data in dGrid.ItemsSource)
{
lstFields.Clear();
foreach (DataGridColumn col in dGrid.Columns)
{
string strValue = string.Empty;
string dataField = string.Empty;
// Add this if statement
if (aliases == null)
{
dataField = col.Header.ToString();
}
else
{
foreach (KeyValuePair<string, string> kv in aliases)
{
if (col.Header.ToString() == kv.Value)
{
dataField = kv.Key;
break;
}
}
}
// End if statement
if (excludedColumns != null)
{
foreach (string columnName in excludedColumns)
{
if (col.Header.ToString() == columnName)
continue;
else
strValue = data.Attributes[dataField].ToString();
}
}
else
strValue = data.Attributes[dataField].ToString();
lstFields.Add(FormatField(strValue, strFormat));
}
BuildStringOfRow(strBuilder, lstFields, strFormat);
} Then you can change the call: YourNamespace.DataGridExtensions.ExportDataGrid(theGrid, null, null); And you can do this if your DataGrid displays the real field names. If the code fix doesn't work, try creating the aliases parameter with the same OriginalFieldName and FieldNameAlias just to see if it will work. I will go back and simplify this method when I get a chance. Gotta go! Good Luck!
... View more
09-28-2010
05:25 AM
|
0
|
0
|
648
|
POST
|
Hi Russel, I have used the first link to export DataGrid to Excel. I have modified the code to work for Graphics data. public static class DataGridExtensions
{
public static void Export(this DataGrid dg, List<string> excludedColumns, Dictionary<string, string> aliases)
{
ExportDataGrid(dg, excludedColumns, aliases);
}
public static void ExportDataGrid(DataGrid dGrid, List<string> excludedColumns, Dictionary<string, string> aliases)
{
SaveFileDialog objSFD = new SaveFileDialog() { DefaultExt = "csv", Filter = "CSV Files (*.csv)|*.csv|Excel XML (*.xml)|*.xml|All files (*.*)|*.*", FilterIndex = 1 };
if (objSFD.ShowDialog() == true)
{
string strFormat = objSFD.SafeFileName.Substring(objSFD.SafeFileName.IndexOf('.') + 1).ToUpper();
StringBuilder strBuilder = new StringBuilder();
if (dGrid.ItemsSource == null) return;
List<string> lstFields = new List<string>();
if (dGrid.HeadersVisibility == DataGridHeadersVisibility.Column || dGrid.HeadersVisibility == DataGridHeadersVisibility.All)
{
foreach (DataGridColumn dgcol in dGrid.Columns)
{
if (excludedColumns != null)
{
foreach (string columnName in excludedColumns)
{
if (dgcol.Header.ToString() == columnName)
{
continue;
}
else
{
lstFields.Add(FormatField(dgcol.Header.ToString(), strFormat));
}
}
}
else
lstFields.Add(FormatField(dgcol.Header.ToString(), strFormat));
}
BuildStringOfRow(strBuilder, lstFields, strFormat);
}
foreach (Graphic data in dGrid.ItemsSource)
{
lstFields.Clear();
foreach (DataGridColumn col in dGrid.Columns)
{
string strValue = string.Empty;
string dataField = string.Empty;
foreach (KeyValuePair<string, string> kv in aliases)
{
if (col.Header.ToString() == kv.Value)
{
dataField = kv.Key;
break;
}
}
if (excludedColumns != null)
{
foreach (string columnName in excludedColumns)
{
if (col.Header.ToString() == columnName)
continue;
else
strValue = data.Attributes[dataField].ToString();
}
}
else
strValue = data.Attributes[dataField].ToString();
lstFields.Add(FormatField(strValue, strFormat));
}
BuildStringOfRow(strBuilder, lstFields, strFormat);
}
StreamWriter sw = new StreamWriter(objSFD.OpenFile());
if (strFormat == "XML")
{
//Let us write the headers for the Excel XML
sw.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
sw.WriteLine("<?mso-application progid=\"Excel.Sheet\"?>");
sw.WriteLine("<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\">");
sw.WriteLine("<DocumentProperties xmlns=\"urn:schemas-microsoft-com:office:office\">");
sw.WriteLine("<Author>Arasu Elango</Author>");
sw.WriteLine("<Created>" + DateTime.Now.ToLocalTime().ToLongDateString() + "</Created>");
sw.WriteLine("<LastSaved>" + DateTime.Now.ToLocalTime().ToLongDateString() + "</LastSaved>");
sw.WriteLine("<Company>Atom8 IT Solutions (P) Ltd.,</Company>");
sw.WriteLine("<Version>12.00</Version>");
sw.WriteLine("</DocumentProperties>");
sw.WriteLine("<Worksheet ss:Name=\"Silverlight Export\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\">");
sw.WriteLine("<Table>");
}
sw.Write(strBuilder.ToString());
if (strFormat == "XML")
{
sw.WriteLine("</Table>");
sw.WriteLine("</Worksheet>");
sw.WriteLine("</Workbook>");
}
sw.Close();
}
}
private static void BuildStringOfRow(StringBuilder strBuilder, List<string> lstFields, string strFormat)
{
switch (strFormat)
{
case "XML":
strBuilder.AppendLine("<Row>");
strBuilder.AppendLine(String.Join("\r\n", lstFields.ToArray()));
strBuilder.AppendLine("</Row>");
break;
case "CSV":
strBuilder.AppendLine(String.Join(",", lstFields.ToArray()));
break;
}
}
private static string FormatField(string data, string format)
{
switch (format)
{
case "XML":
return String.Format("<Cell><Data ss:Type=\"String\">{0}</Data></Cell>", data);
case "CSV":
return String.Format("\"{0}\"", data.Replace("\"", "\"\"\"").Replace("\n", "").Replace("\r", ""));
}
return data;
}
} And then in your Export button click event handler call this method: YourNamespace.DataGridExtensions.ExportDataGrid(theGrid, null, aliases); Where: - theGrid is the DataGrid with the data to be exported - null is for excludedColumns (I just needed to not export some of the columns) - aliases is a Dictionary<string, string>, where the key is the real Field Name, and value is the Field Alias that I have used to display in the DataGrid headers Good Luck!
... View more
09-22-2010
10:42 AM
|
0
|
0
|
648
|
POST
|
Hi Morten, Thank your for your suggestion. If I don't call Update() it ignores my Where clause and loads all the features on the map, and that is not what I want. It is working for now, and I have just fixed all of the other breaking errors from the conversion. I will break it another time for more testing. 😉
... View more
09-16-2010
09:01 AM
|
0
|
0
|
343
|
POST
|
OK, I spoke too soon! I had to move the code that was calling the Update method to the FeatureLayer Initialized event, because now that was creating it in code, it was not initialized at the moment when I was calling the method before. Problem resolved, but I don't know why the new version wouldn't allow FeatureLayer's Url to be set after it has been initialized. I personally use configuration files to set all of the services' URLs, so I don't have to rebuild and redeploy every time I change a service Url.
... View more
09-15-2010
12:41 PM
|
0
|
0
|
343
|
POST
|
Hi Stephen, Have you resolved your problems? I am getting the same errors trying to upgrade an application from 1.2 to 2.0. I cannot set the Url of a FeatureLayer after it has been initialized, so I create the layer in code behind. But then I get an "Object not set to an instance" error on the line where I call the Update method: fLayer.Update() And fLayer is not null, but a valid FeatureLayer object. Any thoughts and ideas are greatly appreciated.
... View more
09-15-2010
12:19 PM
|
0
|
0
|
343
|
POST
|
Hi Jacek, Here is how you set up a proxy page: http://help.arcgis.com/en/webapi/silverlight/help/Secure_services.htm It is under "Using ArcGIS Server" topic in the Silverlight API help: http://help.arcgis.com/en/webapi/silverlight/help/index.html Once you set up your proxy page (config and ashx), add proxyUrl to your services. I haven't used proxy page for your purpose, but I it is worth to give it a try. I think, it will work. Good Luck!
... View more
09-14-2010
07:08 AM
|
0
|
0
|
422
|
POST
|
Hi Rouf, It sounds like you are looking for the FullExtent property of the GraphicsLayer/FeatureLayer. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.GraphicsLayer_members.html Here is a link to the Silverligth API reference: http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm Good Luck!
... View more
09-13-2010
05:42 AM
|
0
|
0
|
245
|
POST
|
Hi Chris, Have you tried the AddressToLocation sample in the Interactive Samples library? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddressToLocation Depending on your Locator, you might have to remove some lines of code in XAML and code behind(for City, Zip, State, LatLon, ...), and you have to replace the geocoding service's url with your url. If you are still having troubles, you will have to give us more info about your geocoding service. Good Luck!
... View more
09-03-2010
11:08 AM
|
0
|
0
|
221
|
Title | Kudos | Posted |
---|---|---|
1 | 05-04-2022 06:11 PM | |
2 | 05-05-2023 01:24 PM | |
1 | 02-09-2023 02:52 PM | |
2 | 02-15-2023 10:49 AM | |
1 | 12-22-2022 01:36 PM |
Online Status |
Offline
|
Date Last Visited |
a month ago
|