|
POST
|
What exception are you getting? Could you share a sample app + kml that reproduces this error?
... View more
02-01-2011
07:57 AM
|
0
|
0
|
933
|
|
POST
|
And here�??s a slightly different approach where it only shows the label on hover. Very maptip�??ish. This performs a lot better, because it doesn�??t render the label unless it needs to (the blur effect is expensive), and has a much less cluttered look. It's great when you don't want to overload the user with information, but still make it easily accessible:
<esri:MarkerSymbol x:Key="labelSymbol" OffsetX="6" OffsetY="6">
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="labelOnHover" Storyboard.TargetProperty="Visibility" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation From="0" To="1" Storyboard.TargetName="labelOnHover" Storyboard.TargetProperty="Opacity"
Duration="0:0:.25" />
</Storyboard>
</VisualState>
<VisualState x:Name="Normal" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<!--Marker-->
<Ellipse Width="12" Height="12" Fill="Red"
HorizontalAlignment="Left" VerticalAlignment="Top" />
<!--Label-->
<Grid Margin="-200,-8,-200,0" MaxWidth="400" x:Name="labelOnHover" Visibility="Collapsed"
HorizontalAlignment="Center" VerticalAlignment="Top" IsHitTestVisible="False">
<!--Text halo using a white blurred text-->
<TextBlock Foreground="White" FontWeight="Bold" Text="{Binding Attributes[NAME]}" >
<TextBlock.Effect>
<BlurEffect Radius="5" />
</TextBlock.Effect>
</TextBlock>
<!--Text-->
<TextBlock Foreground="Black" FontWeight="Bold" Text="{Binding Attributes[NAME]}" />
</Grid>
</Grid>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>
Note: Compared to the previous example, the label has been moved to the upper center. This is because when hovering on the graphic, the mousecursor gets in the way of the label, so this moves it out of the way (but of course also to demonstrate how to center a label, as mentioned in my last reply).
... View more
01-31-2011
09:39 AM
|
0
|
0
|
1500
|
|
POST
|
Below is a label symbol I often use. The trick here is two textblocks on top of each other (in addition to the red ellipse that marks the "spot"). The top one is black foreground, the back one is white with a blur effect added to it. That way you get a white "halo" around the text (note that the blur effect can be a bit of an overhead when rendering, so avoid that part if you have A LOT of points).
<esri:MarkerSymbol x:Key="labelSymbol" OffsetX="6" OffsetY="6">
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Grid>
<!--Marker-->
<Ellipse Width="12" Height="12" Fill="Red" HorizontalAlignment="Left" VerticalAlignment="Top" />
<!--Label-->
<Grid Margin="8,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" IsHitTestVisible="False">
<!--Text halo using a white blurred text-->
<TextBlock Foreground="White" Text="{Binding Attributes[NAME]}" >
<TextBlock.Effect>
<BlurEffect Radius="5" />
</TextBlock.Effect>
</TextBlock>
<!--Text-->
<TextBlock Foreground="Black" Text="{Binding Attributes[NAME]}" />
</Grid>
</Grid>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol> Replace 'NAME' with whatever attribute you need to display as label. Here the text is tied to the lower right corner using the margin property. If you need it centered, a simple trick is to set the alignment to center and provide some large enough negative margins on both left and right side to hold the text. That way you don't need to recalculate the offset of the margin. As Dominique mentioned above, a custom control can also do this using the MeasureOverride and ArrangeOverride methods, but this is also a much more advanced (albeit better) approach.
... View more
01-31-2011
09:18 AM
|
0
|
0
|
1500
|
|
POST
|
Note that Silverlight only supports a subset of styles that ArcMap supports, so try and keep your symbology fairly simple if its meant to be consumed by a WebMap client using client side rendering.
... View more
01-31-2011
09:06 AM
|
0
|
0
|
967
|
|
POST
|
map.resolution will be NaN until the map and layers has been initialized. This won't happen until shortly after you added the map to the UI.
... View more
01-31-2011
09:04 AM
|
0
|
0
|
648
|
|
POST
|
Perhaps this is what you are looking for: http://help.arcgis.com/EN/webapi/javascript/gmaps/index.html AFAIK this is also the only 'legal' way to do it.
... View more
01-31-2011
09:00 AM
|
0
|
0
|
2594
|
|
POST
|
Pretty annoying that there is no labeling available for wpf solutions. It's not like it's a completely new feature I'm looking for, labeling is a quite basic operation... This is a client API, which means its primarily a light-weight client to ArcGIS Server, which does full-blown labelling. The trick I often use to create a label with a background, is two textblocks on top of each other. The top one is black foreground, the back one is white with a blur effect added to it. That way you get a white "halo" around the text. You can see this in action here: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ShowCoordinatesBehavior The effect is subtle on this basemap, but if you move the mousecursor outside the map area to the green background, you can easier see it. See my two examples of this in this forum post: http://forums.arcgis.com/threads/22169-Custom-Marker-Symbol-with-Labels?p=73298&posted=1#post73298
... View more
01-31-2011
08:57 AM
|
0
|
0
|
1443
|
|
POST
|
This blogpost might also help you get started on building a service: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/03/11/Sending-geometry-between-Silverlight-and-the-server-using-WCF.aspx All you really need is to add a SQL query to that sample...
... View more
01-31-2011
08:51 AM
|
0
|
0
|
1605
|
|
POST
|
1. Don't use the bing one (its obsolete). Use the ESRI.ArcGIS.Client.Projection.WebMercator class instead (that way you don't need a reference to the Bing assembly either). 2. If you get invalid spatial reference, then your input points are not WebMercator, and you will need to use the GeometryService task to perform the projection serverside (note: Don't try this on mousemove, which would swamp your server in requests).
... View more
01-31-2011
08:46 AM
|
0
|
0
|
949
|
|
POST
|
I would recommend against using WKT. Parsing it is a huge overhead. It's MUCH faster to parse WKB, not to mention building a parser for it is much simpler. First converting from SqlGeometry, to String, back to numbers, populate a SharpMap geometry, then re-create the geometry as ESRI geometry is quite an overhead. The simplest approach is to use the SqlGeometry classes directly in your project, and parse those directly into ESRI geometry. That way you only will have one conversion., don't have to mess with Well-known-* or other geometry libraries. Worst case, SharpMap is open source, so you could just take the SharpMap.Converters.WellKnownText.GeometryFromWKT and tweak it to return ESRI geometry instead (or even better use it's WKB classes). That shouldn't be much work. (Still I recommend using SqlGeometry directly, instead of converting to WKT/B).
... View more
01-31-2011
08:41 AM
|
0
|
0
|
3945
|
|
POST
|
ArcGIS Server v9.x only returns a maximum of 500 features at a time, v10 the limit is 1000. You can do multiple queries if you need (ie set a where clause where ObjectID>XXX where XXX what the largest value from previous response), or you can configure your rest server to return more results (not recommended). However, if you need to load that much data you should seriously reconsider your approach. Its a lot of load to put on the users network, your server, and for rendering on the client. You will likely see poor performance in all 3 areas. Instead rethink your idea, and try only to load data that the user really needs (no one needs to interact with 5000 features). Combine it with a dynamic layer for rendering large amounts of data as well. You can use the featurelayers OnDemand mode to only load features that are in the current view, and only enable the layer when zoomed in beyond a specific scale range (use Layer.MaximumResolution setting for that). At that zoomlevel turn off the dynamic layer, so the featurelayer takes over on higher resolutions.
... View more
01-27-2011
10:47 AM
|
0
|
0
|
380
|
|
POST
|
See if you can't somehow get a PC up and running with Fiddler. Without it, it will all only be guesswork. With it, I'll give it 99% chance that it will pinpoint exactly what the problem is.
... View more
01-26-2011
12:04 PM
|
0
|
0
|
2586
|
|
POST
|
Isn't it the args.FeatureSet.Features that you want to add the attribute to, and not the graphics layer? (since this is what you bind to the listbox).
... View more
01-26-2011
12:00 PM
|
0
|
0
|
1735
|
|
POST
|
XamlReader.Load is actually not that inelegant (apart from building the string of course). Creating a complex UI using XamlReader is faster than "building" it up using UI Elements one by one. Anyway I'm glad you went the resourcedictionary route. Its the best way to do it. You might want to consider optimizing it a bit so you only load the resource dictionary the first time you need it, and reuse it after that.
... View more
01-26-2011
11:55 AM
|
0
|
0
|
815
|
|
POST
|
Yes there is. To do this, get your head around "Control Templating" for Silverlight. Its easiest to do in Expression Blend. Open your project there, select the navigation control, right-click it and select craete a copy of the control template. Now you get access to the individual elements of the template, and can remove the buttons you don't want by simply selecting and deleting them. I covered this at the DevSummit 2009, which is available here: http://resources.arcgis.com/gallery/video/arcgis-api-for-silverlightwpf/details?entryID=AD6EB60D-1422-2418-7FC9-E3FCEE4EB057 Jump forward to roughly ~35min.
... View more
01-26-2011
11:54 AM
|
0
|
0
|
995
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 05-11-2026 07:05 AM | |
| 2 | 03-19-2026 06:03 PM | |
| 1 | 03-03-2026 04:41 PM | |
| 1 | 02-26-2018 07:53 AM | |
| 1 | 02-26-2018 07:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|