|
POST
|
I just upgraded our code base from using 2.2 to 2.4 of the ArcGIS WPF API. I really like that the map now has a Scale property and that Feature Layers obey the scales set in the service. So thanks for that! My question/issue now is the legend does not show the check box grayed out for service layers (feature layers) in the legend. I have the legend setup pretty much like the Silverlight example but in a control template (I actually made my own check box that only grays out and doesn't disable, but same concept/issue): <CheckBox Content="{Binding Label}" IsChecked="{Binding IsEnabled, Mode=TwoWay}" IsEnabled="{Binding IsInScaleRange}" > </CheckBox> Now that Feature Layers obey their scale, I would like to disable their checkbox too, but IsInScaleRange doesn't exist... Any ideas on how to do this? Only thing I can think of is to derive a new layer from FeatureLayer and make a property that returns if in scale range. Thanks a lot for any help!
... View more
02-03-2012
02:28 PM
|
0
|
2
|
2607
|
|
POST
|
Can you check whether 'SQL Server SDE View' has a column whose value uniquely identifies each row in the result? Tanu, thanks a lot for that info. I eventually had figured this problem out, sorry, should have posted back... the problem was just as you said. The views unique column was set to the Object Id, which in this case was not unique. I didn't know at the time that you could register a different column as being the unique one, so once I ran the SDE command "sdetable -o alter_reg" to change this, it worked great. So my assumption is that ArcMap uses this unique column, where ArcGIS Server does not. Thanks a lot for the help!
... View more
10-13-2011
12:14 PM
|
0
|
0
|
1041
|
|
POST
|
Character symbols, which in turn become picture symbols from the AGS, display differently: - From the REST endpoint, they look a bit washed out. - From the WPF legend control, they look even more washed out, but not terrible. - From a WPF ArcGISDynamicMapServiceLayer they are not washed out at all, but seem to be missing a few lines of resolution (usually looks like the left most column and bottom most row of pixels are cropped off). - From a WPF FeatureLayer they look pretty much the same as in the legend. I have tried publishing with no Anti-Aliasing and also with Normal, doesn't seem to make a difference. I also tried changing ArcGISDynamicMapServiceLayer.ImageFormat to all the different options with no difference. I have attached a screenshot to help show the difference. The primary display that I would like to get fixed is of the ArcGISDynamicMapServiceLayer, but having all the different areas of display looking just as crisp as they do in ArcMap would be ideal. Is there just a setting I am missing here? In the AGS? In the WPF app? Thanks a lot for any help!
... View more
10-01-2011
12:06 PM
|
0
|
0
|
1845
|
|
POST
|
Thanks for all the info Jennifer! Good to know on number 1 and I got number 3 worked out... Still working on number 2; I am looping through each graphic trying to change it's Symbol.ControlTemplate. I understand how the VisualStates work, but not real sure how to copy a ControlTemplate and inject a VisualState into it.... also, the Symbol needs a ScaleTransform, how do I inject that? Here are a few things I was trying but don't work:
DependencyObject symbolDependencyObject = graphic.Symbol.ControlTemplate.LoadContent();
FrameworkElement symbolFrameworkElement = symbolDependencyObject as FrameworkElement;
symbolFrameworkElement.RenderTransform = new ScaleTransform(50, 50); //Scaling big initially just to see if scale works
var storyboard = new Storyboard();
var doubleAnimation = new DoubleAnimation(50, 1, new Duration(TimeSpan.Zero));
Storyboard.SetTarget(doubleAnimation, symbolFrameworkElement);
Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath("RenderTransform.ScaleX"));
storyboard.Children.Add(doubleAnimation);
var storyboard2 = new Storyboard();
var doubleAnimation2 = new DoubleAnimation(1, 50, new Duration(TimeSpan.Zero));
Storyboard.SetTarget(doubleAnimation2, symbolFrameworkElement);
Storyboard.SetTargetProperty(doubleAnimation2, new PropertyPath("RenderTransform.ScaleX"));
storyboard2.Children.Add(doubleAnimation2);
var stateGroup = new VisualStateGroup { Name = "MouseOverState" };
stateGroup.States.Add(new VisualState { Name = "MouseOut", Storyboard = storyboard });
stateGroup.States.Add(new VisualState { Name = "MouseOver", Storyboard = storyboard2 });
var sgs = VisualStateManager.GetVisualStateGroups(symbolFrameworkElement);
sgs.Add(stateGroup);
I also tried just adding a trigger, but again do not have a ScaleTransform plus it throws this error "After a 'TriggerCollection' is in use (sealed), it cannot be modified.", so guess this is a no go.
Trigger trigger = new Trigger();
trigger.Property = FrameworkElement.IsMouseOverProperty;
trigger.Value = true;
Setter setter = new Setter();
setter.Property = ScaleTransform.ScaleXProperty;
setter.Value = 50;
trigger.Setters.Add(setter);
graphic.Symbol.ControlTemplate.Triggers.Add(trigger);
Still poking around this code, but any help or ideas would be great! Thanks! And with number 4, there really isn't anything special with the code; the map is referencing some internal services and some ESRI services. It has something to do with our network here I think. When ESRI started using the Amazon cloud, it dynamically routes traffic so services.arcgisonline.com will give different IPs. Some of these IPs were in our routers block list, after allowing them this hanging of the layers loading went down drastically. It still happens every once in a while (a lot yesterday though) and I think it now is some issue with our proxy. I have our network guys looking into it (kind of hard though since it is temperamental). Anyway, I guess the only question I have is if there is a way to set/control the timeout of a layer? Maybe I can set it to give up after 15 seconds or something? So at least other layers can then load. Thanks a ton for all your great help!
... View more
09-09-2011
02:55 PM
|
0
|
0
|
831
|
|
POST
|
Jennifer, The DataContext on a parent control was indeed set, I changed this around and it works great! Thanks a lot!
... View more
09-09-2011
07:03 AM
|
0
|
0
|
1091
|
|
POST
|
Update, I lied... MXD Doctor did work! The first time under the treatment options I left the "Transfer all non broken" option checked. I unchecked this and check all the boxes except for the "VBA Project" one (which I assume strips out the old VBA then) and it works now! Thanks a lot!
... View more
09-08-2011
07:56 AM
|
0
|
0
|
895
|
|
POST
|
Duncan, Great idea, thanks! I ran it through the MXD doctor and the fixed map unfortunatly still crashes though :(. Thanks for the great idea though!
... View more
09-08-2011
07:47 AM
|
0
|
0
|
895
|
|
POST
|
Hey Shawn, Sorry, I don't have an answer for you... but wanted to report that I am trying to help one of our users solve this exact same problem. Everytime he double clicks to open ThisDocument it crashes. Other maps of his he can open it just fine, but just this map crashes every time.
... View more
09-08-2011
07:16 AM
|
0
|
0
|
895
|
|
POST
|
Thanks a lot for that example, that is great... I didn't even think to pass the FeatureLayer that way. I am still having issues with the binding though. If I do the binding as in your example:
<esriPrimitives:SymbolDisplay Symbol="{Binding Converter={StaticResource attributeToSymbolConverter}}" />
It does not bind to the attribute collection, but to the parent UserControl that hosts the ESRI map control... kind of wierd. I also tried this binding
<esriPrimitives:SymbolDisplay Symbol="{Binding /, Converter={StaticResource attributeToSymbolConverter}}" />
And it seems to bind to the first item in the attribute collection, but not the collection itself... I'll keep playing with the bindings, I'm still a bit new to SL/WPF... If you have any ideas though that would be great. Thanks a ton for all the help!
... View more
09-07-2011
04:31 PM
|
0
|
0
|
1091
|
|
POST
|
Jennifer, Thanks a lot of the reply! Hmm, the FeatureLayer's service does contain a "drawingInfo", It has too right, to get the symbology from the server? The FeatureLayer's Renderer is NOT null, but each graphic.Symbol is NOT null either... Could you please provide an example on how to set the DataContext to the Graphic (and not the Attributes collection)? I have tried every binding I could think of but cannot get the graphic... I also made a value converter, if it is even needed, but not sure how to get access to the FeatureLayer in it to call FeatureLayer.GetSymbol(graphic)... but I will worry about that if the above doesn't work. Thank you much and thanks for any more help!!!
... View more
09-06-2011
07:41 PM
|
0
|
0
|
1091
|
|
POST
|
Using a FeatureLayer that has different symbols coming from the server... Is there a way to bind the graphics corresponding symbol inside the map tip? This way when using a clusterer (that hides the symbol) it would still show in the map tip! Example:
<sdl:MapTip>
<StackPanel Margin="10">
<esriPrimitives:SymbolDisplay Symbol="{Binding Symbol}" /> <!-- Trying to get symbol displayed here -->
<TextBlock Text="{Binding [sgnl_type_desc]}" FontWeight="Bold" FontSize="12" Foreground="Black" />
<TextBlock Text="{Binding [ENTY_NME]}" FontSize="10" Foreground="Black" />
</StackPanel>
</sdl:MapTip>
Thanks a lot for any help or ideas!
... View more
09-03-2011
09:22 AM
|
0
|
6
|
1495
|
|
POST
|
A few questions and issues: 1) Issue: After selecting (in code via graphic.Select()) several points (symbol is red circle with black outline) the features on the screen are selected (with the light blue fill). But any features off the screen when panned to have a hollow fill. Also a feature that was selected fine at first, when panned off the screen and back on, will then be hollow as well. Any ideas? 2) What is the best way on mouse over of a feature (in a FeatureLayer) to slightly enlarge the symbol size (selected or not)? Just to show the user it has the mouse over focus... I don't want to change the symbol provided by the service though by overriding the whole Symbol Control Template. 3) Is there a way to set the selected graphics to have a higher Z order, to be on top of other non-selected features? *Update* Currently I control this by using SetZIndex() in custom select/unselect methods to make the Z index either 1 or 0 respectively, but this doesn't work if these methods are not used. Since SelectedGraphics doesn't have a CollectionChanged event, not sure if there is a better way? 4) Issue: This is a temperamental issue that is true with all Layer types; We have a loading bar on the screen until Map.Layers.LayersInitialized is called, then the loading bar is closed in the event handler. Well, sometimes this event is never fired, but neither is layer.InitializationFailed (which is set on each layer in Map.Layers)... so the loading bar never closes. Is there a bug here? Is there a better way to implement this? Thanks a lot for any help!
... View more
08-31-2011
05:16 PM
|
0
|
2
|
2773
|
|
POST
|
I would try these two items: 1) In the ArcGIS Server Manager, open the "Properties" for your service and go to the "Parameters" tab. There is an option "Maximum Number of Records Returned by Server"... try making this something like 30,000. 2) In your WPF app, use a clusterer on the FeatureLayer. See this example: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SimpleClusterer Notes: - Now if you do return all 30,000 records when the map loads, it might take 10+ seconds or so, so you might want to show some type of loading bar (and make sure your users are ok with this delay). - Also, if the FeatureLayer.Mode is set to OnDemand, I would set the OnDemandCacheSize to around 30,000 too to prevent trips back to the server. - If you do NOT use the clusterer with this many points, it will likely lock up your application... just too much for the client to render. - And if you do not need any of the benefits of FeatureLayers (MapTips, Clustering, Client Side Filtering, etc), then by all means, just use an ArcGISDynamicMapServiceLayer. - Search both the WPF and Silverlight forums (Silverlight API is practically the same as the WPF), there are other topics on this... Morten, one of the API developers created OnDemandMapTips which are nice to help the initial load time. These are just some of the things I have tried and found, others might have other opinions and ideas�?� Hope this helps a little.
... View more
08-31-2011
04:12 PM
|
0
|
0
|
1290
|
|
POST
|
For FeatureLayers, ArcGIS Server 9.3 only returns 500 features by default and ArcGIS Server 10 only returns 1000. By chance do you have more features than this? This might be the issue. If you open the "Properties" for your service and go to the "Parameters" tab on your service there is an option "Maximum Number of Records Returned by Server"... try making this bigger. Careful though, because returning too many features can slow down or even crash your map. Hope that helps some...
... View more
08-30-2011
01:48 PM
|
0
|
0
|
1290
|
|
POST
|
The map I am publishing has a layer with a definition query, In ArcMap the attribute table for this layer says it has 9154 rows... but if I run a query against this same layer after publishing this same map as an MSD to ArcGIS Server 10 SP2, with the where set to "1=1", I get 12472 rows... why aren???t these counts the same? Same map querying the same source!!! My WPF app has a FeatureLayer that is returning this same count of 12472, which lead me to find that the REST query does the same. Thanks a lot for any help! *UPDATE* A few things I have found, maybe it is something I am not understanding about ArcMap - Querying the SQL Server SDE View directly with the same query, there are indeed 12472 records. - If I set the symbology from single to unique values, and hit the count column, i get 12472. - If I select all features in the layer I get 9154. - As mentioned earlier, the attribute table is 9154. Does this maybe have something to do with the SDE View being one to many? I tried finding the count of duplicate joins in the view, and that makes the count close, but still not quite the same. If this is the case, maybe I need to find out how to do one to many joins in an SDE view properly... still odd that Server is different than ArcMap though.
... View more
08-29-2011
06:16 PM
|
0
|
3
|
3803
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-24-2023 10:43 AM | |
| 1 | 10-02-2023 02:23 PM | |
| 1 | 11-16-2016 02:05 PM | |
| 1 | 07-05-2017 09:30 AM | |
| 15 | 11-19-2010 08:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
05-01-2024
08:25 PM
|