POST
|
thanks for your response. i can see how this helps for databinding and so forth, but going from 1 to 2 and then back to 1 seems not correct. I would imagine it going from 1 to 0 to 1. This is also happening in certain cases. It depends on the location of the new selected feature. If it's before or after the original one. before: 1 to 0 to 1. after: 1 to 2 to 1. anyway, thanks for you quick response!! it's appreciated. It nice to see that the actual developers take time to answer our questions!
... View more
11-11-2010
08:13 AM
|
0
|
0
|
290
|
POST
|
You are right that when a selection on Graphics is made, "SelectionCount" and "SelectedGraphics" PropertyChanged are both raised. Can you share your code for selecting and unselecting graphic? If you wish to maintain just a single selection at one time, I suspect that you deselect the previous graphic before you select the next graphic. Is that right? It's not related to the fact that both SelectionCount and SelectedGraphics are being raised. It's the fact that SelectionCount (and SelectedGraphics, but not relevant for example) is raised twice when i'm only changing once. For example, i got two roads on my FeatureLayer. I select the first one, the PropertyChanged event is raised and shows me the SelectionCount is 1, which makes sense. Then I use the selection tool to select road 2, which will automatically deselects road 1 for you, but that will raise two PropertyChanged events! first the SelectionCount is 2, probably because road 1 is still selected and road 2 is added. Then the SelectionCount is 1 because road 1 is deselected. That's why i'm thinking your code is probably doing this: this.raiseSelectedGraphicsChange(newGraphic, true);
this.raiseSelectedGraphicsChange(oldGraphic, false); But it shouldn't raise the SelectedGraphics Changes twice. It should add the new graphic, remove the old graphic and THEN raise the Change event. Hope this clarifies it a bit more. I'm not selection features through code, but by using the editorwidget on the map with 'new' selection. (http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Editor~Select.html)
... View more
11-05-2010
11:51 AM
|
0
|
0
|
290
|
POST
|
also make sure your application pool is running in 32bits mode if you are using (serverside) ArcObjects.
... View more
11-05-2010
11:42 AM
|
0
|
0
|
258
|
POST
|
looking at reflector, you are problaby doing the following this.raiseSelectedGraphicsChange(newGraphic, true);
this.raiseSelectedGraphicsChange(oldGraphic, false); which throws the SelectedGraphics and SelectionCount property change to be thrown twice instead of once. from reflector: private void raiseSelectedGraphicsChange(Graphic g, bool isSelected)
{
if (isSelected)
{
this.selectedGraphics.Add(g);
}
else
{
this.selectedGraphics.Remove(g);
}
base.OnPropertyChanged("SelectedGraphics");
base.OnPropertyChanged("SelectionCount");
}
... View more
11-05-2010
11:19 AM
|
0
|
0
|
290
|
POST
|
If you select a feature on the featurelayer the PropertyChanged event is trigged with the e.PropertyName ="SelectionCount". If you select a feature(Graphic) and then select just one other feature (Graphic) which is further down in the list of Graphics of that FeatureLayer the SelectionCount temporarily jumps to two before it jumps back to one. So selecting first feature: SelectionCount = 1 Selecting the second feature (discarding the first selected feature) SelectionCount = 2 SelectionCount = 1 So the propertyChanged event is triggered twice but should only be called once. I didn't select a second feature, but just another feature. It would also be nice if we could hoke to a SelectionChanged event. I want to prevent the user from selecting more then one feature. hope this helps improving the API. Let me know if you need more input/clarification.
... View more
11-05-2010
11:03 AM
|
0
|
5
|
2277
|
POST
|
Hi, just want to point everybody with the same problem to the following two pages http://viswaug.wordpress.com/2009/02/10/automating-startstop-ags-and-ags-services-2/ http://www.spoiledtechie.com/post/How-to-publish-a-ArcMap-to-the-ArcGIS-Servere280a6.aspx It shows you how to start/stop and howto create a new service. Both codes are made for 9.3 but are easily to convert. You probably want to do some code optimization as well. The idea is to have an empty MXD, use python arcpy.mapping to add the necessary layers, expose the service using this code and then consume it in silverlight...
... View more
10-29-2010
09:06 AM
|
0
|
0
|
327
|
POST
|
So some further investigation shows that the SimpleLineSymbol doesn't have any DataContract and DataMember attributes set. This is why the serialization fails. When can we expect this to be implemented? I would expect this to be already available for converting JSON to objects. Now you have to do a lot of manual work.
... View more
10-27-2010
12:59 PM
|
0
|
0
|
192
|
POST
|
You can update your color and width conversion this way.
symbol.Color = Color.FromArgb(Convert.ToByte(result.color[3]), Convert.ToByte(result.color[0]), Convert.ToByte(result.color[1]), Convert.ToByte(result.color[2]));
symbol.Width = Convert.ToDouble(pts, CultureInfo.InvariantCulture) * 96 / 72; // to convert from points to pixel units
Hi Jennifer, thanks for your reply. I'm not exactly concerned in setting the values of the symbol object. I already got that working (as you can see in my code). I'm interested in converting the original JSON (REST) result into a Symbol were these values are already populated. It seems akward and strange to serialize my object and then have to set the color and width again, even when that data is already available in the JSON resultset. I want to convert {
"color":[156,156,156,255],
"style":"esriSLSSolid",
"type":"esriSLS",
"width":2,
} To a SimpleLineSymbol using a Serializer without doing some stuff on the fly to set the Color and Width. The information is already there so you would expect the serializer to do this for me. So the question is, how can this be achieved?! Is there some method/class available in the ESRI Toolkit that provides this? Thank you for your time
... View more
10-27-2010
12:26 PM
|
0
|
0
|
192
|
POST
|
Silverlight is also supported in 9.3 but doesn't support editing. In 10 it does (Silverlight ESRI API 2.0 for VS2010). In my opinion there isn't really a difference. I would choose Silverlight (if you are used to .NET programming).
... View more
10-27-2010
10:14 AM
|
0
|
0
|
260
|
POST
|
Namespace: System.Runtime.Serialization.Json Assembly: System.ServiceModel.Web (in System.ServiceModel.Web.dll) in VS2010, just select it and press F1 for help. this shows you the necessary assembly.
... View more
10-27-2010
10:00 AM
|
0
|
0
|
453
|
POST
|
What's the best way in the Silverlight API to convert a basic json Symbol string (in this case a SimpleLineSymbol) to an object, without me needing to set the color and width manual. "result" is a temporary object that i already created from the original json string. Original JSON string: Note that the SimpleLineSymbol only needs four properties: type, style, color and width. The other properties just need to be discarded; they are the cumulative collection of all the symbols properties. {
"angle":null,
"backgroundColor":null,
"borderLineColor":null,
"color":[156,156,156,255],
"contentType":null,
"font":null,
"height":null,
"horizontalAlignment":null,
"imageData":null,
"kerning":null,
"outline":null,
"rightToLeft":null,
"size":null,
"style":"esriSLSSolid",
"type":"esriSLS",
"url":null,
"verticalAlignment":null,
"width":2,
"xoffset":null,
"xscale":null,
"yoffset":null,
"yscale":null
} Current code to convert it: SimpleLineSymbol symbol = (SimpleLineSymbol)Json.ConvertToObject(json, typeof(SimpleLineSymbol));
if (result.color != null && result.color.Count == 4)
{
symbol.Color = new SolidColorBrush(Color.FromArgb(
(byte)(result.color[3] & 0xff), (byte)(result.color[0] & 0xff), (byte)(result.color[1] & 0xff), (byte)(result.color[2] & 0xff)));
symbol.Width = result.width;
} the current Json converter: public static object ConvertToObject(string json, Type type)
{
using (MemoryStream memoryStream = new MemoryStream())
{
byte[] bytes = Encoding.UTF8.GetBytes(json);
memoryStream.Write(bytes, 0, bytes.Length);
DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(type);
return dataContractJsonSerializer.ReadObject(memoryStream);
}
} Thanks for your feedback.
... View more
10-27-2010
07:07 AM
|
0
|
3
|
667
|
POST
|
the user needs to send the workspace data to actual access the SDE so that's not really the problem. Anyway, what would the best approach be? How can I expose layers stored in SDE in Silverlight without making a (REST/SOAP) service for each layer? I think this would be one way of doing it. The other way would be making an own WCF service and then return the Feature layer, but then the resulting feature class needs to be mapped to an object/data structure within silverlight. What is ESRI point of view on this? What would be best practise without creating a service for each layer. We are dealing with dynamic environment where we want to display the files that have been uploaded to the SDE database. I'm open for suggestions. Thanks for your time and effort in helping us.
... View more
10-25-2010
12:54 PM
|
0
|
0
|
327
|
POST
|
How about exposing a geoprocessor task that will return a featurelayer from SDE? Within SL4 i can call the gp-task and get the layer and then add it to the map. I examined the arcgis python (v10) library but couldn't find a proper method to just return a featurelayer based upon a workspace string and location. Did somebody did something similar like this and got it working? I would be interesting to hear some feedback on this. Thanks!
... View more
10-25-2010
09:15 AM
|
0
|
0
|
327
|
POST
|
registering the dll was succesful, installation still failed with same error. "Installation ended permaturely because of an error", after clicking the first "Next" button. Rex, i could give you my contact details so we can this discuss by phone (or e-mail) ? let me know what you prefer.
... View more
09-30-2010
10:41 AM
|
0
|
0
|
411
|
POST
|
same problem here with Windows 7 x64 running VS2010 and VS2008. attached is my windows installer log. btw: had/have the same problem with the old 1.2 package.
... View more
09-30-2010
09:42 AM
|
0
|
0
|
411
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|