|
POST
|
Take a look at the Draw sample that Jennifer posted. In the method Draw_Complete(), you have access to a graphic object that represents the shape you just drew. You can use this shape to interrogate the features in any other graphicslayer. Here's a useful bit of code for doing that (taken from the ESRI Contrib project😞
public static bool IsPointInPolygon( PointCollection points, MapPoint point )
{
int i;
int j = points.Count - 1;
bool inPoly = false;
for( i = 0; i < points.Count; i++ )
{
if( points[ i ].X < point.X && points[ j ].X >= point.X
|| points[ j ].X < point.X && points[ i ].X >= point.X )
{
if( points[ i ].Y + ( point.X - points[ i ].X ) / ( points[ j ].X - points[ i ].X ) * ( points[ j ].Y - points[ i ].Y ) < point.Y )
{
inPoly = !inPoly;
}
}
j = i;
}
return inPoly;
}
You can call Graphic.Select() or whatever on any graphics objects that fall inside the shape.
... View more
01-13-2011
07:18 AM
|
0
|
0
|
690
|
|
POST
|
It looks like you're confusing the two different MapTip classes. The ESRI.ArcGIS.Client.MapTip class would probably work better for what you're trying to do:
private void GPTask_ExecuteCompleted(object sender, GPExecuteCompleteEventArgs e)
{
var graphicslayer = new GraphicsLayer()
{
ID = "xxx",
Renderer = cbr,
MapTip = new ContentControl()
{ ContentTemplate = (DataTemplate)Resources["gpTaskMapTipTemplate"] }
};
graphicslayer.MapTip.SetBinding(ContentControl.ContentProperty, new System.Windows.Data.Binding());
Map.Layers.Add(graphicslayer);
}
then on your usercontrol XAML page:
<UserControl.Resources>
<DataTemplate x:Key="gpTaskMapTipTemplate">
<Border Background="White">
<StackPanel>
<TextBlock Text="{Binding [grid_code]}" Foreground="White" />
</StackPanel>
</Border>
</DataTemplate>
</UserControl.Resources>
If you would rather use the ESRI.ArcGIS.Client.Toolkit.MapTip control, you have to declare it separately and add it to your usercontrol's visual tree, whether through XAML or code.
... View more
01-13-2011
06:38 AM
|
0
|
0
|
958
|
|
POST
|
You aren't by chance using the WPF ESRI.ArcGIS.Client.dll API anywhere in your web project are you?
... View more
01-11-2011
04:32 PM
|
0
|
0
|
402
|
|
POST
|
Most likely the WMS does not support Bing's spatial reference (WKID 102100). If you have Fiddler or Firebug, watch the HTTP requests and see what the WMS's response to the GetCapabilities query says. It will return an XML document that contains listings of layers, supported spatial references, etc. Example: http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?%20&service=WMS&request=GetCapabilities&version=1.3.0 In the response, inside <Service><Capability><Layer>, you will see the following supported spatial references: <CRS>EPSG:4326</CRS> <CRS>EPSG:900913</CRS> <CRS>EPSG:102100</CRS> <CRS>EPSG:3857</CRS> Another gotcha is that you often need to supply a proxy to the WMS class, since Silverlight cannot download from servers without a clientaccesspolicy.xml or crossdomain.xml file at the server's root.
... View more
01-10-2011
05:11 AM
|
0
|
0
|
1270
|
|
POST
|
The simplest and fastest way to set up a service is to use WCF RIA Services and create a domain service. You can tag any operation with attributes like [RequiresAuthentication] and [RequiresRole("Admin")]. You can use ASP.NET forms authentication (or, if you're brave, Integrated Windows authentication) to secure all your endpoints. It's extremely easy to get up and running with this technology.
... View more
01-08-2011
09:05 AM
|
0
|
0
|
494
|
|
POST
|
I won't claim its the best possible design, but I would just create a WCF service endpoint to do this. You can pass any type of object that way, and if you desire you can encrypt the parameters.
... View more
01-07-2011
08:05 AM
|
0
|
0
|
494
|
|
POST
|
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddLayerDynamically
... View more
01-06-2011
05:07 PM
|
0
|
0
|
290
|
|
POST
|
Thanks Dominique. That works on my end. I thought I would share a couple of snippets I added/modded to MapPrinter.theme.xaml: [HTML]<ControlTemplate TargetType="local:MapPrinter"> ... <!-- Body--> <Grid Grid.Row="1"> <!-- Map--> <esri:Map x:Name="PrintMap" ... </esri:Map> <!-- Scale Bar --> <esri:ScaleBar Map="{Binding ElementName=PrintMap}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="20" TextColor="Black" RenderTransformOrigin="0,1"> <esri:ScaleBar.RenderTransform> <RotateTransform Angle="{Binding Rotation, ElementName=PrintMap}" /> </esri:ScaleBar.RenderTransform> </esri:ScaleBar> <!-- North Arrow --> <Grid Width="50" Height="50" Margin="20" HorizontalAlignment="Right" VerticalAlignment="Top" RenderTransformOrigin=".5,.5" Opacity="0.7"> <Grid.RenderTransform> <RotateTransform Angle="{Binding Rotation, ElementName=PrintMap}" /> </Grid.RenderTransform> <Path Data="M0.5,0 L0,1 L0.5,0.8 L1,1 z" Fill="White" Stretch="Fill" Stroke="Black" UseLayoutRounding="False" /> <TextBlock Text="N" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontSize="22" RenderTransformOrigin="0.5,0.5" > <TextBlock.RenderTransform> <CompositeTransform TranslateY="4"/> </TextBlock.RenderTransform> </TextBlock> </Grid> ... </Grid> ... </ControlTemplate>[/HTML]
... View more
01-06-2011
08:59 AM
|
0
|
0
|
721
|
|
POST
|
Dominique, Thanks again for your excellent work on the printing sample. I have been using the direct printing sample a lot. After your most recent changes, it appears that the direct printing sample is broken. I have a feeling it's related to the code you've added to free the cloned map layers, but I don't know for sure. -Dan
... View more
01-05-2011
10:39 AM
|
0
|
0
|
721
|
|
POST
|
<ListBox x:Name="listBox" ItemsSource="{Binding Layers.[Karachi].Layers, ElementName=listBox}"> . . . <CheckBox x:Name="checkBox" Content="{Binding Name, ElementName=checkBox}" IsChecked="{Binding DefaultVisibility, ElementName=checkBox, Mode=TwoWay}" Tag="{Binding ID, ElementName=checkBox}" /> For starters, remove the ElementName from your bindings. ElementName tells Silverlight to look for another XAML control by name to specify the source of the binding. In your case the source of all the checkbox bindings will be understood by Silverlight to be the individual (sub)layers, since the control is in the ItemTemplate. Also, it looks like you're trying to create a listbox with checkboxes to show and hide the sublayers. Binding the checkbox to layer.DefaultVisibility will set the layer visibilty on startup, but it won't toggle the layer visibility at runtime. Several users on this forum have done this in other ways, Here is an example. You might also look at this interactive sample for a pattern. Hope this helps you!
... View more
01-04-2011
03:12 AM
|
0
|
0
|
785
|
|
POST
|
This is probably a server question, not a Silverlight one. But when you migrated, did you copy your MXD files over and just update the data source? Perhaps your old MXD referenced a .style file that didn't make it onto the new server.
... View more
01-02-2011
10:05 AM
|
0
|
0
|
889
|
|
POST
|
I'm not certain, but I think you should upgrade your SDE instance to v. 10 as well and migrate your data over. A pain, I know. You should probably post this problem in the server forum, as this is almost certainly an issue between AGS and SDE.
... View more
01-02-2011
09:48 AM
|
0
|
0
|
889
|
|
POST
|
It's difficult to tell exactly what you are trying to do. Could you perhaps post some of your code? In general I have found it tough to setup complex bindings using Blend. 🙂
... View more
12-28-2010
03:36 PM
|
0
|
0
|
785
|
|
POST
|
That message is not configurable or hide-able. It's built into Silverlight to warn users and prevent malicious applications from deceiving users.
... View more
12-24-2010
10:52 AM
|
0
|
0
|
432
|
|
POST
|
I'm no expert on the topic, but I believe Morten is referring to the "problem" of having too many graphic objects in your visual tree and the UX and performance suffering as a consequence. Clustering reduces the number of symbols directly in the client, whereas the FeatureService OnDemand mode only downloads the graphics from the server that are defined for your current view. The latter would obviously work best for services that have layers limited by map zoom level, so you don't get all the features at once.
... View more
12-23-2010
11:20 AM
|
0
|
0
|
840
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-16-2015 10:23 AM | |
| 2 | 09-25-2015 10:36 AM | |
| 1 | 06-29-2015 08:24 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|