|
POST
|
Hey, saw your post over at StackExchange, too. 🙂 Are you accessing the REST endpoint of your map service, i.e. http://servername/ArcGIS/rest/services/foldername/MapServer ? That error looks like you might be trying to hit a SOAP endpoint.
... View more
03-08-2011
11:10 AM
|
0
|
0
|
521
|
|
POST
|
What is the difference in function between the maptip and the identify? And yes, if you want to use maptips, you have to use GraphicsLayer (i.e. FeatureLayer). FeatureLayer is easier to code against, but if your service returns a lot of features, the client will bog down significantly as Silverlight struggles to repaint the overgrown visual tree.
... View more
03-08-2011
10:56 AM
|
0
|
0
|
1837
|
|
POST
|
It's easy enough to calculate the lengths of any line segment using the pythagorean theorem. The trick will be to position the labels properly. You might want to create a custom symbol type to do this.
... View more
03-08-2011
04:14 AM
|
0
|
0
|
918
|
|
POST
|
A better approach would be to split each polygon with multiple rings into multiple graphics, each one having a single ring. void Graphics_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action != NotifyCollectionChangedAction.Add) return;
var gc = (GraphicCollection)sender;
foreach (var item in e.NewItems)
{
var g = (Graphic) item;
if (!(g.Geometry is Polygon) || ((Polygon) g.Geometry).Rings.Count <= 1) continue;
var p = (Polygon) g.Geometry;
Dispatcher.BeginInvoke(() =>
{
foreach (var ring in p.Rings)
{
var newg = new Graphic {Geometry = new Polygon {SpatialReference = p.SpatialReference}};
foreach (var a in g.Attributes) newg.Attributes.Add(a);
((Polygon)newg.Geometry).Rings.Add(ring);
gc.Add( newg );
}
gc.Remove(g);
});
}
}
... View more
03-08-2011
03:58 AM
|
0
|
0
|
717
|
|
POST
|
Below is some code to do this. The only gotcha is to somehow make sure that overlapping rings are parsed smallest->biggest, to ensure you get the most accurate result. void graphicsLayer_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs e)
{
var clicked = Map.ScreenToMap(e.GetPosition(Map));
var polygon = (Polygon)e.Graphic.Geometry;
foreach(var ring in polygon.Rings)
if (Intterra.Projection.Utilities.PointIsInGeometry(ring, clicked))
{
//you found the correct ring
}
}
static bool PointIsInGeometry(PointCollection points, MapPoint point)
{
int i;
int j = points.Count - 1;
bool output = false;
for (i = 0; i < points.Count; i++)
{
if (points.X < point.X && points .X >= point.X || points .X < point.X && points.X >= point.X)
{
if (points.Y + (point.X - points.X) / (points .X - points.X) * (points .Y - points.Y) < point.Y)
{
output = !output;
}
}
j = i;
}
return output;
}
... View more
03-08-2011
03:42 AM
|
0
|
0
|
717
|
|
POST
|
Don, see my post in the other Maptip thread. MapTips won't work on ArcGisDynamicMapServiceLayer. You need to use a FeatureLayer in some capacity. Or, if you really don't want to use a FeatureService, you have a couple of options: 1) try using a modified Toolkit MapTip widget to display the results of an identifytask. If you're interested in that route I can share some code with you. 2) create an empty graphicslayer and copy graphics into it from the results of an identify task
... View more
03-08-2011
03:31 AM
|
0
|
0
|
804
|
|
POST
|
You're on the right track. You've created a view in Oracle, now the next step is to 'register' that view with SDE, so SDE can serve the data out to ArcGIS as though it were a normal registered SDE table. (By default SDE will ignore your newly created view.) Run sdetable -o create_view with all the parameters just as the documentation says (warning: the command is very picky about every parameter, be ready to tinker) and SDE should recognize your oracle view and you will be able to see it in ArcCatalog, etc. PS - in the future you should post server related questions in the server forum. 🙂
... View more
03-08-2011
03:12 AM
|
0
|
0
|
409
|
|
POST
|
Your main problem is that you've set up a maptip on a Dynamic map service layer. Maptips only work for layers that inherit from GraphicsLayer. My guess is that you want to pop up a maptip on a point where the user clicks, but don't want the expensive and sluggish FeatureLayer. No problem, just set up a FeatureLayer to buddy up with the DynamicMapServiceLayer (replace "/MapServer" with "FeatureServer/n" where n is the sublayer you want), and set the Mode=QueryMode.OnDemand and use the Where attribute to select one feature at a time. Your maptip XAML will belong in this new layer (since FeatureLayer inherits from GraphicsLayer). You can set the Where attribute after running an identify task on the MapServiceLayer. Some dummy code to illustrate: void Map_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
var it = new IdentifyTask(_mapServiceLayer.Url);
it.ExecuteCompleted += it_ExecuteCompleted;
var ip = new IdentifyParameters
{
LayerOption = LayerOption.all,
Height = (int)Map.RenderSize.Height,
Width = (int)Map.RenderSize.Width,
DPI = (int)Map.Resolution,
Tolerance = 1,
Geometry = Map.ScreenToMap(e.GetPosition(Map)),
MapExtent = Map.Extent,
SpatialReference = Map.SpatialReference
};
it.ExecuteAsync(ip, null);
IsBusy = true;
}
void it_ExecuteCompleted(object sender, IdentifyEventArgs e)
{
if (e.IdentifyResults.Count < 1)
{
IsBusy = false;
ErrorMsg("No feature was found at that location");
return;
}
foreach (var res in e.IdentifyResults)
{
if (res.Feature == null || !res.Feature.Attributes.ContainsKey("OBJECTID"))
continue;
var objectid = (string) res.Feature.Attributes["OBJECTID"];
_featureLayer.Where = "OBJECTID = " + objectid;
_featureLayer.Update();
return;
}
}
... View more
03-08-2011
03:01 AM
|
0
|
0
|
1930
|
|
POST
|
Just animate the color. That would be kinda stroby. 🙂
... View more
03-02-2011
04:34 AM
|
0
|
0
|
516
|
|
POST
|
You can leverage the ESRI classes in that case (no need to build your own WCF service). Follow these steps: Using ArcCatalog, import or create your feature classes into an SDE database. Register the feature classes as versioned (right-click->register as versioned) In ArcMap, drag and drop the feature classes to an MXD, and setup any symbology you want there. Save the MXD and publish to ArcGIS server with Feature Access and Editing options checked. Add a feature layer to your silverlight map with the url property set to your new feature service (http://[servername]/ArcGIS/rest/services/[foldername]/[servicename]/FeatureService/[0,1,2,3, etc]) Add an editor widget to your silverlight app (from the ESRI Silverlight Toolkit) You're done.
... View more
02-28-2011
06:23 AM
|
0
|
0
|
1090
|
|
POST
|
The answer will depend on what you have available on the server side. Do you have ArcGis Server 10 and ArcSDE?
... View more
02-28-2011
05:50 AM
|
0
|
0
|
1090
|
|
POST
|
I have a 'piggyback' question. I would like to use Dynamic Map layers to visualize parcels, but I need to perform web editing on them. Is it possible to use IdentifyTask on the map service and hook up the results to an Editor? Or is there a better way to do it?
... View more
02-25-2011
07:12 AM
|
0
|
0
|
528
|
|
POST
|
Actually adapting the WmsLayer class would probably be easier than some other (more elegant) solutions. I doubt that republishing via MXD will work, since that would effectively disable the security on the WMS (I'm not sure about this, though). There are a number of ways to accomplish what you're asking for, but I think the best way would be to use a single authorization and authentication method to access both the WMS and ArcGis data. One possible way to to this is to create a proxy handler for the WMS which would handle the security requirements, and secure access to this proxy with your normal method. We (the forum users) could help with some suggestions if you could post some information about how the WMS is secured (simple password sent in each request, token-based, etc.) and how your Silverlight viewer and ArcGis data are secured.
... View more
02-24-2011
03:36 AM
|
0
|
0
|
2251
|
|
POST
|
Have you tried expanding the constraint extents out some to see if it goes away? Or shrinking them down a bit to contain all the service layers extents? I think the problem lies in you having defined so many different extents (on the map, the service, and the sublayers). Just a guess though.
... View more
02-23-2011
05:36 AM
|
0
|
0
|
1083
|
|
POST
|
You'll probably have to download the source code for the WmsLayer from CodePlex and add the security features yourself.
... View more
02-22-2011
05:25 AM
|
0
|
0
|
2251
|
| 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
|