|
POST
|
Craig, I had similar problem a few years ago, and I think that you have to call the Update method after the feature layer has been initialized. So, try this:
public SecurityControl()
{
InitializeComponent();
securityFeatureLayer = new FeatureLayer()
{
Url = "http://xxxxxxxxx/FeatureServer/1",
AutoSave = false,
Where="1=1"
};
securityFeatureLayer.UpdateCompleted += securityFeatureLayer_UpdateCompleted;
securityFeatureLayer.Initialized += securityFeatureLayer_Initialized;
}
private void securityFeatureLayer_Initialized(object sender, EventArgs args)
{
securityFeatureLayer.Update();
}
Good Luck!
... View more
05-10-2012
05:57 AM
|
0
|
0
|
364
|
|
POST
|
I am experiencing the same behavior with SP3. All Join_Count values are 1, but most of the output fields are empty. Two fields are populated, but all of the others are empty. What would you suggest for a workaround until a patch is available? Thank you! Edit: Dan thank you for the article. I saw your post when I submitted mine. I will try it!
... View more
04-23-2012
08:22 AM
|
0
|
0
|
562
|
|
POST
|
Don, Try Where="PAGsde.dbo.Projects.Archived = 'False'" and Where="PAGsde.dbo.Projects.Archived = 'True'"
... View more
03-16-2012
11:26 AM
|
0
|
0
|
468
|
|
POST
|
Muzammil, See this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Union Good Luck! Edit: Now that I see Dominique's response, I realize that you probably want to keep the polygons separate, so Union is probably not what you need.
... View more
03-14-2012
08:48 AM
|
0
|
0
|
1222
|
|
POST
|
Chad, I believe the problem is in a missing "/" after "services":
IdentifyTask identifyTask = new IdentifyTask("http://geoservices.dnr.illinois.gov/ArcGIS/rest/services" +
"WHPTS/MapServer");
Try this:
IdentifyTask identifyTask = new IdentifyTask("http://geoservices.dnr.illinois.gov/ArcGIS/rest/services/" +
"WHPTS/MapServer");
If this is not the problem, please, tell us what line of code causes the error. Good Luck!
... View more
03-06-2012
03:56 AM
|
0
|
0
|
449
|
|
POST
|
Foram, There are AGSSOM.exe files under the bin/debug folders. Try using them. Good Luck!
... View more
01-23-2012
04:03 PM
|
0
|
0
|
569
|
|
POST
|
Hi Foram, You can probably use this app to schedule the restarting of the services: http://arcscripts.esri.com/details.asp?dbid=16293
... View more
01-23-2012
06:22 AM
|
0
|
0
|
569
|
|
POST
|
Hi Anh, The easiest thing to do in your case is to convince your users that they don't need a PDF. Just kidding! 😉 About 2 years ago, when printing was a real problem with Silverlight, I did export to PDF to allow users to print the map and the data. My PDF is created on the server though, and the exported data comes directly from the database, and not from the FeatureDataGrid (but it is exactly the same data). To do this, I used iTextSharp library (on the sever, not the silverPDF). When the user queries the data and displays it in the DataGrid, the user has the option to export the data to PDF. At this point, I send all the query parameters back to server, and query the data directly from the database using a stored procedure (I am using an XY table, and can directly use T-SQL, and the data is updated nightly, so it doesn't change), which is then bound to an ASP.Net GridView, which then is rendered to a PDF. It is probably not the best solution, but the only one could find at the time. If you can't find an easier way to this, and would like to try it, I will send you some code. Try convincing your users first. 😄 Good Luck! P.S. If you can use T-SQL to query your data directly, you could probably use some kind of reporting tool like Crystal Reports or SSRS to produce the PDF. Send the query parameters, produce the report and spit it out as a PDF. I have done this long ago with SSRS and ArcIMS. Just another idea.
... View more
01-12-2012
07:33 AM
|
0
|
0
|
865
|
|
POST
|
Gabriel, You can perform a query using multiple fields, but you will have to use the "Where" property of the "Query" object instead of "Text". http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Query_members.html Search the API Reference for more info: http://help.arcgis.com/en/webapi/silverlight/apiref/api_start.htm
... View more
01-11-2012
05:55 AM
|
0
|
0
|
1047
|
|
POST
|
Gabriel, In QueryTask_ExecuteCompleted you can do something like this:
private void QueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args)
{
FeatureSet featureSet = args.FeatureSet;
if ((args.UserState as string) == "incidentQuery")
{
DateTime incidentDate;
foreach (Graphic graphic in args.FeatureSet.Features)
{
if (DateTime.TryParse(graphic.Attributes["IndidentDate"].ToString(), out incidentDate))
graphic.TimeExtent = new TimeExtent(incidentDate);
}
//...... more code (if you have any)
}
}
Good Luck!
... View more
01-09-2012
06:55 AM
|
0
|
0
|
697
|
|
POST
|
Gabriel, You will have to bind the Value of the TimeSlider to the Map.TimeExtent property. And also each one of the graphics in the feature set returned by the query task will need its TimeExtent property set to the IncidentDate. [HTML]<esri:Map TimeExtent="{Binding ElementName=timeSliderName,Path=Value}" />[/HTML]
//loop through all graphics and set the time extent
graphic.TimeExtent = new TimeExtent(incidentDateOfTheGraphic);
I did the binding of the Map TimeExtent property in code behind, but I hope the xaml above is correct, and will work also. Good Luck!
... View more
01-06-2012
08:57 AM
|
0
|
0
|
697
|
|
POST
|
John, If I understand correcty what you are doing, I believe it can be acheived in a different way. Here is what I am thinking: Instead of using a second graphics layer to add the speed and bearing info, use only one graphics layer that you cluster the way you do now. But add a TextBlock in the marker symbol (the pin) for the the standalone graphics to label them. See attached image for an example. Of course, you can make it as pretty as you want. Good Luck!
... View more
11-01-2011
12:09 PM
|
0
|
0
|
1110
|
|
POST
|
The Code Attachment is only a sample of how the MapTip was designed (without the chart part). This sample uses the ESRI Standard Map Application, which is integrated in Visual Studio when the ArcGIS Silverlight API is installed (it can be also downloaded from the link below, it is the Standard Application Template). The complete Crime Map application is a combination of two of the Templates provided by ESRI (the link posted by Jeniffer): http://help.arcgis.com/en/webapi/silverlight/samples/TemplateGalleryWeb/start.htm The two templates are the Glass and the Frosted Tab Menus. Please, let me know which template you are interested in, the MapTip sample, or the Crime Map application. Darina
... View more
10-17-2011
07:43 AM
|
0
|
0
|
427
|
|
POST
|
Ben, Change PropertyName="{Binding Path=Coordinates}" to PropertyName="Coordinates", and it will work. 🙂
... View more
10-14-2011
07:22 AM
|
0
|
0
|
2141
|
|
POST
|
Brandon, This is a very interesting and cool approach. Thank you for sharing! I am still trying to wrap my head around MVVM. I am sure that I am not alone. That's why I would like to continue this discussion. I believe, it will help us all in our struggles with MVVM. I see a few other ways of achieving this. I will post them here, and I would love to get some input from experienced MVVM developers: what is a MVVM "Yes, yes", and what is a MVVM "No, no". Note: I agree with Brandon that using a MapPoint instead of string is a better approach, but I use string for less code in the samples. 1. Using the Messenger - LightMvvm public class MouseCoordinatesAction : TriggerAction<Map>
{
/// <summary>
/// Invokes the action.
/// Search for the user provided address
/// </summary>
/// <param name="parameter">The parameter to the action. If the Action does not require a parameter, the parameter may be set to a null reference.</param>
protected override void Invoke(object parameter)
{
Messenger.Default.Send(GetCoordinateString(parameter as MouseEventArgs), "FromMainViewModel");
}
private string GetCoordinateString(MouseEventArgs e)
{
//this is the body of the method, but I will remove it to make the code shorter
return mouseCoordString;
}
}
//**************************** Inside MainViewModel *************************
//A string with the current mouse point coordinates
private string _currentMapPoint;
/// <summary>
/// A string with the current mouse point coordinates
/// </summary>
public string CurrentMapPoint
{
get { return _currentMapPoint; }
set
{
if (_currentMapPoint != value)
{
_currentMapPoint = value;
OnNotifyPropertyChanged("CurrentMapPoint");
}
}
}
public MainViewModel()
{
//requires a reference to GalaSoft.MvvmLight.SL4
Messenger.Default.Register<string>(this, "FromMainViewModel", (e => this.CurrentMapPoint = e));
}
//********************** In MainView xaml - Trigger is inside the Map control***********************
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseMove">
<actions:MouseCoordinatesAction />
</i:EventTrigger>
</i:Interaction.Triggers>
<TextBlock Text="{Binding CurrentMapPoint}"
x:Name="mouseCoordinates" Width="200" Height="22"
VerticalAlignment="Bottom" HorizontalAlignment="Right"/> 2. Using Brandon's suggestion to use the ViewModel as a target of the Action: public class MouseCoordinatesAction : TargetedTriggerAction<MainViewModel>
{
/// <summary>
/// Invokes the action.
/// Search for the user provided address
/// </summary>
/// <param name="parameter">The parameter to the action. If the Action does not require a parameter, the parameter may be set to a null reference.</param>
protected override void Invoke(object parameter)
{
Target.CurrentMapPoint = GetCoordinateString(parameter as MouseEventArgs);
}
private string GetCoordinateString(MouseEventArgs e)
{
//removing the body for shortness
return mouseCoordString;
}
}
//**************************** Inside MainViewModel *************************
//A string with the current mouse point coordinates
private string _currentMapPoint;
/// <summary>
/// A string with the current mouse point coordinates
/// </summary>
public string CurrentMapPoint
{
get { return _currentMapPoint; }
set
{
if (_currentMapPoint != value)
{
_currentMapPoint = value;
OnNotifyPropertyChanged("CurrentMapPoint");
}
}
}
//********************** In MainView xaml - Trigger is inside the Map control***********************
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseMove">
<actions:MouseCoordinatesAction TargetObject="{Binding DataContext, ElementName=LayoutRoot}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<TextBlock Text="{Binding CurrentMapPoint}"
x:Name="mouseCoordinates" Width="200" Height="22"
VerticalAlignment="Bottom" HorizontalAlignment="Right"/> 3. Using a dependency property inside the Action: public class MouseCoordinatesAction : TriggerAction<Map>
{
/// <summary>
/// Invokes the action.
/// Search for the user provided address
/// </summary>
/// <param name="parameter">The parameter to the action. If the Action does not require a parameter, the parameter may be set to a null reference.</param>
protected override void Invoke(object parameter)
{
MousePoint = GetCoordinateString(parameter as MouseEventArgs);
}
private string GetCoordinateString(MouseEventArgs e)
{
//removing code for shortness
return mouseCoordString;
}
/// <summary>
/// The symbol used to display the addresss point buffer on the map
/// </summary>
public string MousePoint
{
get { return (string)GetValue(MousePointProperty); }
set { SetValue(MousePointProperty, value); }
}
public static readonly DependencyProperty MousePointProperty =
DependencyProperty.Register("MousePoint", typeof(string), typeof(MouseCoordinatesAction), null);
}
//**************************** Inside MainViewModel *************************
//A string with the current mouse point coordinates
private string _currentMapPoint;
/// <summary>
/// A string with the current mouse point coordinates
/// </summary>
public string CurrentMapPoint
{
get { return _currentMapPoint; }
set
{
if (_currentMapPoint != value)
{
_currentMapPoint = value;
OnNotifyPropertyChanged("CurrentMapPoint");
}
}
}
//********************** In MainView xaml - Trigger is inside the Map control***********************
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseMove">
<actions:MouseCoordinatesAction MousePoint="{Binding CurrentMapPoint,Mode=TwoWay" />
</i:EventTrigger>
</i:Interaction.Triggers>
<TextBlock Text="{Binding CurrentMapPoint}"
x:Name="mouseCoordinates" Width="200" Height="22"
VerticalAlignment="Bottom" HorizontalAlignment="Right"/> Thank you! Darina
... View more
10-14-2011
07:02 AM
|
0
|
0
|
2141
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-08-2025 09:04 AM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2025
01:12 PM
|