|
POST
|
Oh cool, I feel so dumb, thats an easy fix. Thank you much!!! For whatever reason: FindParameters.SpatialReference = Map.SpatialReference; The find task will fail, no error message but if you dig in the object it gives a 400 status and says the sr is invalid. FindParameters.SpatialReferenceWKID = Map.SpatialReference.WKID; This works though, but warns that it is obsolete. *EDIT* FYI, this does NOT work either: FindParameters.SpatialReference = new SpatialReference(Map.SpatialReference.WKID); Kinda odd... IdentifyTask does not have this problem though, SpatialReference = Map.SpatialReference works!
... View more
06-18-2010
06:01 PM
|
0
|
0
|
601
|
|
POST
|
Ok, thanks for the advice... I was thinking the exact opposite, zoomed out I wanted the cluster because otherwise it is just a mess of points (our current maps have a scale dependency to not even show them too far out) and then when zoomed in i was thinking to drop the graphics and use a dynamic layer to be able to see the detailed symbology of the points that represent their status. Might just stick with not using clustering at all, will have to think/try some different things. Thanks a lot!
... View more
06-18-2010
05:58 PM
|
0
|
0
|
971
|
|
POST
|
Oh, and also, if you mean by "where did the data come from" it came from either a FindTask or an IdentifyTask, and now I am trying to do a ZoomTo on one of the returned features...
... View more
06-18-2010
06:14 AM
|
0
|
0
|
601
|
|
POST
|
It is our own data and ESRIs. Our company uses two coordinate systems depending on the situation, either GCS_North_American_1983 or NAD_1927_StatePlane_California_X_FIPS_040X... and the ESRI imagery layers are all WGS_84 I believe... so any one of our maps might have a mixture of these three. I know its not ideal, but its how our data was setup years ago :(. Thanks Morten!
... View more
06-18-2010
06:12 AM
|
0
|
0
|
601
|
|
POST
|
Great, thanks Morten! I will see about implementing it this way and see how performance is... The reason for this is that one of our web maps is called "Well Browser"... its purpose is for our users to be able to locate any well in the company either by zooming/paning around for it, or by using a find tool. The current version just controls the well layer by a scale dependency... but our thought was, when zoomed out, even though there is 20,000 well points, they would all be clustered into one and they could zoom in on the clusters. A neat way to see how many wells are in their aera of interest too! Thanks again!
... View more
06-18-2010
06:06 AM
|
0
|
0
|
971
|
|
POST
|
So I realize the ArcGIS Server has a limit of 500 features it can return (1,000 in v10)... We have multiple field locations and one field might have 20,000 points. I was hopeing clustering would still show this large count in one bubble when zoomed further out... but it only shows bubbles till they add up to 500. Is there no way to use clustering to show them all? Thanks a lot!
... View more
06-17-2010
09:17 PM
|
0
|
12
|
1804
|
|
POST
|
So at first I was using Map.ZoomTo() to zoom to a feature... but I found that depending on the feature, i would get the error "Invalid spatial reference. Spatial reference must match map's spatial reference"... So I figured the Map.ZoomTo() did not project the geometry on the fly. So I programatically invoked a ZoomToAction and it was then working... i thought... so it now works on the feature that didnt work before, but other features are throwing the error "Invalid spatial reference. Spatial reference must match map's spatial reference". The map I am attaching to should be the same as I am using for Map.ZoomTo()... Any ideas? Do I need to use a Geometry service to project the feature first? Hate to make a trip to the server for that! Thanks a lot!
... View more
06-17-2010
07:09 PM
|
0
|
5
|
1147
|
|
POST
|
I have a class derived from MeasureAction so I can programmatically invoke it:
public class DataToolbarMeasureAction : MeasureAction
{
//Constructor
public void Execute()
{
Invoke(null);
}
}
So how can I programmatically cancel/stop a MeasureAction that is in progress (ie. user hasnt double clicked)? Thanks a lot!
... View more
06-12-2010
11:31 AM
|
0
|
4
|
853
|
|
POST
|
Thanks a lot for all the help Morten! If it helps anyone else, here are a few classes I made that work with the three different SimpleXXXSymbol types:
public class SerializableSymbol
{
//Properties
public Color ColorFill { get; set; }
public Color BorderBrush { get; set; }
public Double SizeThickness { get; set; }
public Int32 Style { get; set; }
public SymbolType Type { get; set; }
public enum SymbolType
{
SimpleMarkerSymbol = 0,
SimpleLineSymbol = 1,
SimpleFillSymbol = 2
}
//Constructors
public SerializableSymbol()
{
}
public SerializableSymbol(Symbol symbol)
{
if (symbol is SimpleMarkerSymbol)
{
SimpleMarkerSymbol simpleMarkerSymbol = ((SimpleMarkerSymbol)symbol);
ColorFill = ((SolidColorBrush)simpleMarkerSymbol.Color).Color;
SizeThickness = simpleMarkerSymbol.Size;
Style = (Int32)simpleMarkerSymbol.Style;
Type = SymbolType.SimpleMarkerSymbol;
}
else if (symbol is SimpleLineSymbol)
{
SimpleLineSymbol simpleLineSymbol = ((SimpleLineSymbol)symbol);
ColorFill = ((SolidColorBrush)simpleLineSymbol.Color).Color;
SizeThickness = simpleLineSymbol.Width;
Style = (Int32)simpleLineSymbol.Style;
Type = SymbolType.SimpleLineSymbol;
}
else if (symbol is SimpleFillSymbol)
{
SimpleFillSymbol simpleFillSymbol = ((SimpleFillSymbol)symbol);
ColorFill = ((SolidColorBrush)simpleFillSymbol.Fill).Color;
BorderBrush = ((SolidColorBrush)simpleFillSymbol.Fill).Color;
SizeThickness = simpleFillSymbol.BorderThickness;
Type = SymbolType.SimpleFillSymbol;
}
}
//Operators
public static explicit operator SerializableSymbol(Symbol symbol)
{
SerializableSymbol serializableSymbol = new SerializableSymbol(symbol);
return serializableSymbol;
}
public static implicit operator Symbol(SerializableSymbol serializableSymbol)
{
if (serializableSymbol.Type == SymbolType.SimpleMarkerSymbol)
{
SimpleMarkerSymbol symbol = new SimpleMarkerSymbol();
symbol.Color = new SolidColorBrush(serializableSymbol.ColorFill);
symbol.Size = serializableSymbol.SizeThickness;
symbol.Style = (SimpleMarkerSymbol.SimpleMarkerStyle)serializableSymbol.Style;
return symbol;
}
else if (serializableSymbol.Type == SymbolType.SimpleLineSymbol)
{
SimpleLineSymbol symbol = new SimpleLineSymbol();
symbol.Color = new SolidColorBrush(serializableSymbol.ColorFill);
symbol.Width = serializableSymbol.SizeThickness;
symbol.Style = (SimpleLineSymbol.LineStyle)serializableSymbol.Style;
return symbol;
}
else if (serializableSymbol.Type == SymbolType.SimpleFillSymbol)
{
SimpleFillSymbol symbol = new SimpleFillSymbol();
symbol.Fill = new SolidColorBrush(serializableSymbol.ColorFill);
symbol.BorderBrush = new SolidColorBrush(serializableSymbol.BorderBrush);
symbol.BorderThickness = serializableSymbol.SizeThickness;
return symbol;
}
else
return null;
}
}
public class SerializableGraphic
{
//Properties
public ESRI.ArcGIS.Client.Geometry.Geometry Geometry { get; set; }
public SerializableSymbol Symbol { get; set; }
public IDictionary<String, object> Attributes { get; set; }
//Constructor
public SerializableGraphic()
{
}
public SerializableGraphic(Graphic graphic)
{
Geometry = graphic.Geometry;
Attributes = graphic.Attributes;
Symbol = new SerializableSymbol(graphic.Symbol);
}
//Operators
public static explicit operator SerializableGraphic(Graphic graphic)
{
SerializableGraphic serializableGraphic = new SerializableGraphic(graphic);
return serializableGraphic;
}
public static implicit operator Graphic(SerializableGraphic serializableGraphic)
{
Graphic graphic = new Graphic
{
Geometry = serializableGraphic.Geometry,
Symbol = serializableGraphic.Symbol,
};
foreach (String key in serializableGraphic.Attributes.Keys)
graphic.Attributes.Add(key, serializableGraphic.Attributes[key]);
return graphic;
}
}
... View more
06-09-2010
04:15 PM
|
0
|
0
|
1425
|
|
POST
|
Great, thanks Morten... Trying to get this going, but a couple things: 1) Graphic.Attributes: I dont think i need this even, but one it wont serialize and two it is read only so I can't set it after it is saved. but as i said, I dont think I need this anyway... 2) Geometry wont serialize either, throws: System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type ESRI.ArcGIS.Client.Geometry.Polyline was not expected. Use the XmlInclude attribute to specify types that are not known statically. Didn't try with a DataContractSerializer, should I? I prefer the Xml if possible... *EDIT* DataContractSerializer DOES work!!! hmmm... breaks a few other things I am serializing with the Xml though, have to see how to fix those. Also, the Attributes work too, still not sure how to set them back though
... View more
06-09-2010
09:24 AM
|
0
|
0
|
1425
|
|
POST
|
So I have tried to serialize a GraphicsLayer, a GraphicCollection and just a Graphic itself. I have tried using XmlSerializer, DataContractSerializer and DataContractJsonSerializer... all of which give some sort of error. I want the users to be able to save any graphic markup they have made on the map, so I want to serialize them... is there no way to do this? Thanks a lot! *EDIT* Also, I read the article: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/03/11/Sending-geometry-between-Silverlight-and-the-server-using-WCF.aspx, but don't want/need it sent to the server... it just needs to be saved for that one user
... View more
06-09-2010
07:24 AM
|
1
|
10
|
4289
|
|
POST
|
Is there any way to determine the geometry type of a layer if the SHAPE attribute field is turned off (ie. Graphic.Attributes["SHAPE"] does not exist)? The REST service doesn???t set the geometryType for the layer either, so a JSON request to get it won't help either... There has to be some way to get the type, doesn't there... or the graphics couldn't draw themselves even? As a last resort I will have to make sure all layers have the SHAPE field visible before publishing the service, but would be nice if I didn't have to worry about it and could handle it programmatically. Thanks for any ideas!
... View more
06-04-2010
08:09 PM
|
0
|
1
|
493
|
|
POST
|
Great! Thanks Morten! I missunderstood the lib refrence when I read it earlier... was thinking if i didn't set the sr it was using the same as the maps, but i set it to that of the map and lo and behold, it works. Bradberry, thanks for the other good tips. This makes my life much easier, thanks guys!
... View more
06-04-2010
04:47 PM
|
0
|
0
|
461
|
|
POST
|
So I have a map with multiple services each with different SpatialReferences... the Map takes on one of these when initializing. I want to run an IdentifyTask on a service layer with a different SpatialReference than the map... Setting the IdentifyParameters (just like in the samples):
identifyParameters = new IdentifyParameters()
{
Geometry = e.MapPoint,
MapExtent = Map.Extent,
Width = (int)Map.ActualWidth,
Height = (int)Map.ActualHeight,
LayerOption = LayerOption.visible,
};
So Geometry and MapExtent should always be in the same SpatialReference (as the Map), but the service is in another... Setting identifyParameters.SpatialReference to that of the layer doesn't work, because it is just defining it incorrectly for Geometry and MapExtent. What should I do? Do I have to use a GeometryService and project something? If so, that is done asynchronously so I guess I would have to wait and then launch the IdentifyTask from there... This seems a bit hokey, any better ideas? Thanks a lot for any ideas!!!
... View more
06-04-2010
01:59 PM
|
0
|
3
|
665
|
| 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
|