|
POST
|
Hi Morten, Thank you, chaning the path in the XAML fixed it.
<Grid.Resources>
<esri:PictureMarkerSymbol x:Name="DefaultPictureSymbol" OffsetX="12" OffsetY="24"
Source="../UserControls/Images/IdentifyMapIcon.png" />
<esri:SimpleMarkerSymbol x:Name="SMStest" Color="Red" Size="12" />
</Grid.Resources>
I'm still a little confused as to how path references work in the XAP. Why does it need the "../UserControls" in the source string - the ZoomToXY.xaml is in the UserControls folder but neither "/Images/IdentifyMapIcon.png" nor "./IdentifyMapIcon.png" work in the controls xaml but it did work in code -
Graphic graphic = new Graphic()
{ Geometry = ptMapPoint,
//Symbol = DefaultPictureSymbol
Symbol = new PictureMarkerSymbol()
{ Source = new BitmapImage(new Uri("Images/IdentifyMapIcon.png", UriKind.Relative)),
OffsetX=12, OffsetY=24 }
};
Thanks again, Terry
... View more
10-25-2010
08:44 AM
|
0
|
0
|
422
|
|
POST
|
I thought I'd seen a fix for this last week in the forums but can't find it today! I'm trying to add a graphic to a graphics layer using an image defined in Resources of my user control but if I use a PictureMarkerSymbol nothing draws whereas a SimpleMarkerSymbol does. The ESRI Identify sample uses a PictureMarkerSymbol so I know it's possible. I have a user control that a user can enter a Lat-Long and the map will zoom to it and (should) add a graphic at the local they entered. I'm wondering if it's a location issue - my control is /UserControls/ZoomToXY and references a PNG in /UserControls/Images as the source for the PictureMarkerSymbol. I've tried putting the PNG up a level in the /Images folder but that doesn't seem to solve the problem either. Anyone know what I'm missing? Thanks, Terry XAML for resources:
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.Resources>
<esri:PictureMarkerSymbol x:Name="DefaultPictureSymbol" OffsetX="13" OffsetY="22"
Source="/Images/IdentifyMapIcon.png" />
<esri:SimpleMarkerSymbol x:Name="SMStest" Color="Red" Size="12" />
</Grid.Resources>
Code behind:
//add graphic to map
GraphicsLayer graphicsLayer = (GraphicsLayer)_Map.Layers[_GraphicsLayer];
graphicsLayer.ClearGraphics();
//this does not work
Graphic graphic = new Graphic() { Geometry = ptMapPoint, Symbol = DefaultPictureSymbol };
graphicsLayer.Graphics.Add(graphic);
//using a SimpleMarkerSymbol works
Graphic graphic2 = new Graphic() { Geometry = ptMapPoint, Symbol = SMStest };
graphicsLayer.Graphics.Add(graphic2);
... View more
10-22-2010
01:53 PM
|
0
|
3
|
677
|
|
POST
|
Hi Jay, I started with one of the application templates from the resource center - http://help.arcgis.com/en/webapi/silverlight/gallery.html. Look for the 'unblended' template - it has a toolbar with an identify button on it that should help you get going. Also check out this forum post - http://forums.arcgis.com/threads/9124-Identify..?highlight=graphic+visible Terry
... View more
10-22-2010
01:44 PM
|
0
|
0
|
836
|
|
POST
|
Hi Jennifer, Thanks for confirming that the 401 followed by 200 is normal & I do also see this just using a browser to run an Identify against the secured service. Any thoughts on why I can see the results of the Identify in Fiddler's inspector but yet in my ExecuteCompleted function the args.IdentifyResults are Null? I tried adding a proxy page and using it for the IdentifyTask but I get the same result. Obviously I'm not doing something right, just not sure what or where to look. Thanks again, Terry
... View more
10-21-2010
11:25 AM
|
0
|
0
|
910
|
|
POST
|
I'm working on an Identify tool that works against all layers in the map. The code is pretty straight forward and very similar to the ESRI samples as shown below. It works great in most cases including dynamic services with projections different than the map. Where I'm having a problem is getting the results back for a service where security has been enabled in ArcGIS Server (using windows accounts as the store & I am in a group with access to the services). When the Identity executes against one of these services I see 2 Requests being sent in Fiddler - the 1st returns a 401 not authorized error and the 2nd contains the results of the identify. I believe this double request scenario is normal as it does this if I pan the map and it makes an export image request against the service - please correct me if I am wrong though. However I never get the valid results in the ExecuteCompleted routine but the layer draws fine in the map. What am I missing with these secured services? Thanks, Terry
public void Identify(MapPoint ptMapPoint)
{
//called from btnIdentify on the toolbar - runs an Identiy on all map layers
IdentifyTask IDTask;
IdentifyParameters idParams = new IdentifyParameters()
{
Geometry = ptMapPoint,
MapExtent = _Map.Extent,
Width = (int)_Map.ActualWidth,
Height = (int)_Map.ActualHeight,
LayerOption = LayerOption.all,
SpatialReference = _Map.SpatialReference
};
for (int i = 0; i < _Map.Layers.Count; i++)
{
if (!(_Map.Layers is GraphicsLayer))
{
IDTask = new IdentifyTask();
IDTask.ExecuteCompleted += IdentifyTask_ExecuteCompleted;
IDTask.Failed += IdentifyTask_Failed;
IDTask.Url = MapUtils.GetLayerURL(_Map.Layers);
IDTask.ExecuteAsync(idParams, i);
}
}
}
private void IdentifyTask_ExecuteCompleted(Object sender, IdentifyEventArgs args)
{
//simplified for debugging...
if ((args.IdentifyResults != null) && (args.IdentifyResults.Count > 0))
{
MessageBox.Show((sender as IdentifyTask).Url + " num results= " + args.IdentifyResults.Count);
}
else
{
MessageBox.Show((sender as IdentifyTask).Url + " has no ID results");
}
}
private void IdentifyTask_Failed(Object sender, TaskFailedEventArgs e)
{
MessageBox.Show("Identify failed. Error: " + e.Error.Message);
}
... View more
10-21-2010
07:06 AM
|
0
|
11
|
1727
|
|
POST
|
try testing to see if the layer is a GraphicsLayer first -
public void Button1_Click(object sender, RoutedEventArgs e)
{
GraphicsLayer Glayer;
for (int i = 0; i < MyMap.Layers.Count; i++)
{
if (MyMap.Layers is GraphicsLayer)
{
Glayer = MyMap.Layers as GraphicsLayer;
Glayer.ClearGraphics();
}
}
}
... View more
10-13-2010
06:04 AM
|
0
|
0
|
317
|
|
POST
|
Hi Christine, Sorry, I have not made any headway on this - got pulled off of the silverlight project to deal with some issues in our exising .Net ADF application. I'm hoping to get back to the SL project next week, but not sure how much time I'm going to put into this for now - it sounds like either in version 10 SP1 or a SL toolkit release shortly thereafter a TOC class will be available in the ESRI silverlight toolkit. My issue is that in a mapservice I have grouped layers - say layer 0 is a group and 1 & 2 are child layers in that group. When a user clicks a checkbox assoicated with layer 2, I need to climb back up the layer tree to see if layer 0 is currently in the visiblelayers property of the dynamic service. If it's not then 2 should not be added. Same concept going down the tree - if the user checks the checkbox associated with layer 0 and neither 1 nor 2 are in the VisibleLayers then 0 should not be added to the VisibleLayers .... basically I'm trying to have it work like it does in ArcMap. If memory serves me correct, the SL API will draw layers 1 & 2 if I add 0 to VisibleLayers even without adding 1 & 2.
... View more
10-04-2010
12:18 PM
|
0
|
0
|
379
|
|
POST
|
This thread got me motivated to get this done on my server. Here's what I did - We're using Windows users/roles for the security store in server Manager I have services that need to be available to everyone in our organization at the main root level of the server. For map services that need to be secured and accessible only by certain domain users I created sub folder (called project1) and created their services in there. On the server I created a local group and added the users (and myself) who need the secured data to it. I called it agserver_project1_security. Then in Server Manager, I set the root folder of the server to be accessible to all domain users (in our domain its a group called AllUsers) On the sub folder that contains the services I really want to limit access to, I added the local user group agserver_project1_security. I also removed the Domain Users group - assuming it was applied when I set it to the parent folder..there was some warning about child folders and services that I hit OK on before reading... Enabled security in Server Manager. Stopped and restarted the SOM and tried to view the services at the root and for the project1 folder - http://localhost/arcgis/rest/services - got an access denied error! http://localhost/arcgis/rest/services/project1 - got an acess denied error! Aw nuts. I went back and read some of the ESRI doc again and came across one little thing I missed - Turn off Anonymous Access on ArcGIS/rest and ArcGIS/Services in IIS (see step 7 in the Internet security checklist. Turned off anon access and turned on Integrated Windows Auth. Tried viewing the services folder again and it worked. Added a service from the project1 folder to silverlight map app and can view it. As a double check, took myself out of the ags_project1_security group and now cannot access the project1 folder or the map service in silverlight. Hope this helps, Terry
... View more
09-09-2010
10:39 AM
|
0
|
0
|
2118
|
|
POST
|
I think you're right - it's probably the security settings for ArcGIS Server. I can't help much with that - I'm just starting to implement it myself. At least in previous versions of AGServer once you enabled security you could not turn it off. Make sure you're a member of a security group in Server - see the Internet Security Overview topic in Server Help. Might also want to see this blog about working with secured services in Silverlight - http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/02/15/How-to-use-secure-ArcGIS-Server-services.aspx I'll be muddling through this myself in the next couple of weeks!
... View more
09-09-2010
06:14 AM
|
0
|
0
|
2118
|
|
POST
|
What's in your clientaccesspolicy.xml on the server?
... View more
09-08-2010
01:01 PM
|
0
|
0
|
2118
|
|
POST
|
Looks like you're not hitting the REST endpoint of the map service. Change <esri:ArcGISTiledMapServiceLayer ID="Parcel" Url="http://localhost/ArcGIS/services/Test1/MapServer"/> to <esri:ArcGISTiledMapServiceLayer ID="Parcel" Url="http://localhost/ArcGIS/rest/services/Test1/MapServer"/>
... View more
09-08-2010
11:49 AM
|
0
|
0
|
2118
|
|
POST
|
I'm trying to modify the sublayer list example but am having issues as my map service contains group layers. If the user clicks the checkbox for a sub layer it should only show if the parent (or in my case parent and grandparent) layers are also visible. While a dynamic layer has the ChildLayers property it has no built in concept of ParentLayer. I'm getting stuck on how to recurse up the sublayer tree and visibility of parent/grandparent layers - does anyone else have a code snippet on how to do this efficiently? Thanks, TG
... View more
09-08-2010
07:34 AM
|
0
|
4
|
2988
|
|
POST
|
In general here's one way to do it - When your silverlight app loads check the URL for paramters - see the thread @ http://forums.arcgis.com/threads/10445-Is-it-possible-to-pass-arguments-in-the-URL for one way to get the parameters. Take the value of the address parameter (e.g. '301 E CENTRAL ST') use it in a query task against the address layer in your map service. Take the geometry of the returned FeatureSet, add it as a graphic to your map & to zoom the map to that geometry.
... View more
09-07-2010
07:09 AM
|
0
|
0
|
360
|
|
POST
|
Thanks Lindsay. I can now also address your 3rd question - a coworker installed 1500 with no issues associated w/ ArcMap/Catalog. She has Winx XP, 32 bit, ArcGIS Desktop 9.3.1 SP1, PLTS, and JTX (no server packages installed). Is it perhaps a 64bit OS issue?
... View more
09-01-2010
06:20 AM
|
0
|
0
|
924
|
|
POST
|
Lindsay, If it helps, I installed build 1500 last week and have not been able to open ArcMap or ArcCatalog since. They both crash when the splash screen comes up. I've sent several of the crash logs in through the automated error reporting feature. I tried running the Repair on Desktop, deleting my normal.mxt, rebooting, etc... but nothing worked. I had to uninstall 1500 to fix the Map & Catalog. Switching between 2D and 3D worked just fine for me when I did have 1500 installed. I'm running Win XP 64bit SP2 I have ArcGIS Desktop 9.3.1 SP1 , running an ArcInfo license w/ all ESRI extensions installled (complete install). Also have PLTS, JTX installed. I also have ArcGIS Server for .Net 9.3.1 SP1 installed, as well as versions 1.2 and 2.0 of the ESRI Silverlight API. The Desktop SDKs for .Net and VBA are also installed. I don't think anyone else in our office has tried installing 1500 yet so I cannot comment on your 3rd question. Terry
... View more
08-30-2010
07:58 AM
|
0
|
0
|
924
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-15-2016 03:27 PM | |
| 1 | 01-14-2016 09:55 AM | |
| 2 | 12-14-2012 09:38 AM | |
| 2 | 10-23-2017 01:22 PM | |
| 3 | 01-15-2013 07:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-17-2024
08:14 PM
|