|
POST
|
I still waiting for your help, if you want!!!! I am not sure I am clear on the issue. Calling a task you are giving it the Url of a service. This is done in C# code, you will always call the task from code. There is no reason that the service (url) that you call in code has to be defined in the map Xaml. In the sample applications you get a location based on a mouse click, once you have the MapPoint there is no longer anything that has to do with the map. If you remove the h ttp://romulus/ArcGIS/rest/.../Continents/MapServer service layer from the map you can still use that Url in your identify task. If you build a super service that has all you layers, when you create your identify task it is:
IdentifyTask task = new IdentifyTask("http://romulus/arcgis/rest/AllLayerService/MapServer");
//Your parameters define the sub layers used
task.ExecuteAsync(parameters);
It does not matter if http://romulus/arcgis/rest/AllLayerService/MapServer is in the map or not. Hope that helps, -Joe (and please feel free to give any posts you find helpful points by clicking the Up arrow)
... View more
06-13-2012
11:41 PM
|
0
|
0
|
1084
|
|
POST
|
Ok, are the spatial references different, that I gave above? or same? [PHP]1. Arcgis 9.3.1 Spatial Reference: PROJCS["Transverse Mercator",GEOGCS["GCS_D_ITRF_1996",DATUM[ 2. Arcgis 10 Spatial Reference: PROJCS["WGS_1984_UTM_Zone_35N",GEOGCS["GCS_WGS_1984",DATUM[ these looks like same. The names are different, therefore, they are different. Even though the other parameters may be the same -Joe
... View more
06-13-2012
10:11 PM
|
0
|
0
|
673
|
|
POST
|
If you have that error, you can place your Cursor over the class name that is in red that throws the error. Edit > Intellisense > Resolve and it will show you what using statement is missing and add it for you.
... View more
06-13-2012
09:25 AM
|
0
|
0
|
770
|
|
POST
|
I believe there is some oddity with when you can set the VisibleLayers array and have it work like you expect, like only during initialization. Other times you want to use the SetVisibility method. I think this will accomplish what you are trying to do public void updateLayerList(ObservableCollection<LayerModel> LayerList) { ESRI.ArcGIS.Client.LayerCollection layers = new ESRI.ArcGIS.Client.LayerCollection(); ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer baseLayer = (ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer)this._baseMapLayerService[0]; List<int> visibleLayerIDList = new List<int>(); ESRI.ArcGIS.Client.LayerInfo[] layerInfoArray = baseLayer.Layers; for ( int index = 0; index < layerInfoArray.Length; index++ ) { baseLayer.SetLayerVisibility(index, LayerList[index].DefaultVisibility); } //You should not not need these lines - I think :) this._baseMapLayerService[0] = baseLayer; OnPropertyChanged("BaseMapLayerService"); } Also, I think those last to lines are not really needed. the baseLayer variable is a reference to _baseMapLayerService[0] so by changing it you are effectively changing _baseMapLayerService[0]. ESRI takes care of firing off the necessary events on the Layer object so no need to fire your own. Also because the Map::LayerCollection itself is an ObservableCollection anytime you add or remove layers from your BaseMapLayerService those changes will be reflected in the map, no need to fire off an OnPropertyChanged. Hope that helps -Joe
... View more
06-13-2012
06:26 AM
|
0
|
0
|
968
|
|
POST
|
Meanwhile the resource center for ArcGIS 10.1 has replaced the previous one : http://resources.arcgis.com/en/home/ The silverlight samples are here : http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm If it moved off the beta url to the main Url does that mean it is released? 😉
... View more
06-13-2012
04:49 AM
|
0
|
0
|
558
|
|
POST
|
I will try to create a service that does not appear on my application, but only to operate the Identify tool and I will get back to you to inform you of the results. Thank you very much for your cooperation I made an error before, there is no reason why that service would need to be in your map and not visible. The service simply needs to exist on the server Good luck -Joe
... View more
06-13-2012
02:01 AM
|
0
|
0
|
1084
|
|
POST
|
Then,I must declare all my services separatly in C #: C # code: IdentifyTask identifyTask IdentifyTask = new ("http://romulus/ArcGIS/rest/.../Continents/MapServer"' IdentifyTask identifyTask IdentifyTask = new ("http://romulus/ArcGIS/rest/.../Pays/MapServer"); IdentifyTask identifyTask IdentifyTask = new ("http://romulus/ArcGIS/rest/.../Communes/MapServer"); .... You are not declaring your services separately, your services are your services. An IdentifyTask (as does any rest call) has a single rest endpoint. If you want to make calls into different services than you are making method calls on multiple rest endpoints. This is not something in the ESRI API causing a problem, this is how rest works. Tasks are simply convenient easy to use wrappers for rest method calls, An option if you only want one IdentifyTask call would be to create a 'super' service that is not visible in the map. The IdentifyTask could be run against this service instead of needing to run against multiple services. Hope that helps -Joe
... View more
06-13-2012
01:33 AM
|
0
|
0
|
1084
|
|
POST
|
I do not believe the Identify task works with FeatureLayers, Identify operation is supported only with MapServices. If you enter the Url you are using into a browser and go to the bottom of the page you will see operations that are supported by that Rest service Url. The general thinking behind the Identify task is to do a quick spatial search for features in multiple layers based on a location. It is along the lines of the Identify tool in ArcMap. If you have numerous FeatureLayers you could run an Identify on every service that the FeatureLayers are part of passing in the LayerIds of the Layers you use in that Service. You would not need to do an Identify for every FeatureLayer, but you would have to do one for each of the services that contain your FeatureLayers (e.g. one for each of these...)
http://romulus/ArcGIS/rest/services/Axeroute_Luxembourg/MapServer
http://romulus/ArcGIS/rest/services/CENTRALITE_Administration_Etat/MapServer
Passing in the appropriate LayerIds as in my earlier post. If your goal is to simplify the code in your Silverlight application you might want to look into creating a SOE or Geoprocessing task that does the work on the server with one call from your client.
... View more
06-13-2012
12:35 AM
|
0
|
0
|
1448
|
|
POST
|
Ok Joe let me try. Now the things is working fine in vb.net. I have a problem in one line of code If CInt(lod.Resolution) <= CInt(Math.Truncate(currentResolution)) Then This line i am getting error truncate is not a member of system.math 1.how can i write this line in another way for same result? Sorry don't know enough VB anymore and don't have a VB dev environment to test it. 2.i generated google API key ,in this project where i need to specify google API kety??? I don't know how you use Google API keys 3.Whether it is legal to use Google API key or not?We have licence of arcgis desktop10 and arcgis server. That you have to take up with Google. ArcGIS 10 and ArcGIS Server licensing have nothing to do with Google licensing. Good Luck -Joe
... View more
06-12-2012
10:03 PM
|
0
|
0
|
1219
|
|
POST
|
What is _map.MapLayerService and where does this enter into things? Seems you could just change the VisibleLayers array on that and it would achieve you goal. Hard to say without knowing more. Are there more details about the error being received? -Joe btw: PRISM has a Microsoft.Practices.Prism.ViewModel.NotificationObject which implements INotifyPropertyChanged and exposes a RaisePropertyChanged so you can inherit from that object instead of having to implement INotifyPropertyChanged in every ViewModel
... View more
06-12-2012
07:38 PM
|
0
|
0
|
968
|
|
POST
|
In your code you setup your IdentifyParameters as such:
private void QueryPoint_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e)
{
MapPoint clickPoint = e.MapPoint;
IdentifyParameters identifyParams = new IdentifyParameters()
{
Geometry = clickPoint,
MapExtent = MyMap.Extent,
Width = (int) MyMap.ActualWidth,
Height = (int) MyMap.ActualHeight,
LayerOption = LayerOption.visible,
SpatialReference = MyMap.SpatialReference,
};
IdentifyTask identifyTask = new IdentifyTask("http://romulus/ArcGIS/rest/services/...../Monde/MapServer")
identifyTask.ExecuteCompleted += IdentifyTask_ExecuteCompleted;
identifyTask.Failed += IdentifyTask_Failed;
identifyTask.ExecuteAsync(identifyParams);
}
In this code you set the Identify task to return values for all visible layers because LayerOption = LayerOption.visible. If instead you setup the parameters like this
private void QueryPoint_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e)
{
MapPoint clickPoint = e.MapPoint;
IdentifyParameters identifyParams = new IdentifyParameters()
{
Geometry = clickPoint,
MapExtent = MyMap.Extent,
Width = (int) MyMap.ActualWidth,
Height = (int) MyMap.ActualHeight,
SpatialReference = MyMap.SpatialReference,
};
identifyParams.LayerIds.Add(2);
IdentifyTask identifyTask = new IdentifyTask("http://romulus/ArcGIS/rest/services/...../Monde/MapServer")
identifyTask.ExecuteCompleted += IdentifyTask_ExecuteCompleted;
identifyTask.Failed += IdentifyTask_Failed;
identifyTask.ExecuteAsync(identifyParams);
}
Where instead of setting a value for LayerOptions like in the first example you add Ids to the LayerIds collection
identifyParams.LayerIds.Add(2);
Now when the Identify task runs it will only search fro result from LayerId = 2. This way you can use a service with many layers but only return identify results from one (or any subset), which seems to be what you want to do Hope that helps -Joe
... View more
06-12-2012
04:58 AM
|
0
|
0
|
1448
|
|
POST
|
Hello, I managed to make the sample "Identify" from API Silverlight in my application with a service that contains several layers: Code: IdentifyTask identifyTask = new IdentifyTask("http://romulus/ArcGIS/rest...../Monde/MapServer") But in my application, I would be obliged to work with multiple services and each service contains a single layer, for example, to display their attribute table, then when I wanted to test the tools with a service that contains a single layer, it does not work: Example of Feature Layer: Code: IdentifyTask identifyTask = new IdentifyTask("http://romulus/ArcGIS/rest/services/CENTRALITE_Administration_Etat/MapServer/2") So what to do in case I want the Identify fonction on all services that I declared in my Group Layer? Please help me if you have ideas. The IdentifyParameters object that you use with the IdentifyTask::ExecuteAsynch methods has a LayerIds property which is a List<int> and this defines which layers to use in the Identify task
parameters.LayerIds.Add(2);
identifyTask.ExecuteAsynch(parameters)
Would return only features from the layer with LayerId=2. Hope that helps, -Joe
... View more
06-12-2012
02:49 AM
|
0
|
0
|
1448
|
|
POST
|
Interesting post, thanks. In the mapUrl returned the maptype is defined
mapURL = string.Format
("http://maps.google.com/maps/api/staticmap?center={0},{1}&zoom={2}&size={3}x{4}&maptype=roadmap&sensor=false",
geogCenterPoint.Y, geogCenterPoint.X, currentLodIndex, requestWidth, requestHeight);
Seems you could make two other Google layer classes nearly identical to the one Rex provides but one would have maptype=satellite and one maptype=hybrid (https://developers.google.com/maps/documentation/staticmaps/#MapTypes). When the user clicks the button either add/remove layers or set the Visible property accordingly. I would test, but the environment I work in does not allow outside access from our development machines Good luck -Joe
... View more
06-12-2012
01:03 AM
|
0
|
0
|
1219
|
|
POST
|
Jennifer and Joe, Thanks. Both worked. Your welcome if you could mark as answered that would be great. Not sure how far along you are with developing in PRISM. What I have found is that a reference to the Map object itself within ViewModels is really necessary because there are a lot of properties and methods that the Map exposes that are pretty important throughout the application. I have my MainPage implement an Interface which exposes the Map and use Dependency Injection to pass that Interface object instance to ViewModels across an application The manipulation of the Layers would be pretty much the same as how you are doing it except it is with the Map::Layers collection not a LayerCollection object. Good luck, -Joe
... View more
06-11-2012
07:26 PM
|
0
|
0
|
733
|
|
POST
|
Your Layers binding needs to have Mode=TwoWay added to the Binding statement is one thing I notice. Also your ViewModel is your DataContext so I do not think you want the Binding to have ViewModel in there. I think this would do it Layers="{Binding BaseMapLayerService, Mode=TwoWay} Hope that helps -Joe
... View more
06-11-2012
09:13 AM
|
0
|
0
|
733
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-23-2025 12:16 PM | |
| 1 | 10-19-2022 01:08 PM | |
| 1 | 09-03-2025 09:25 AM | |
| 1 | 04-16-2025 12:37 PM | |
| 1 | 03-18-2025 12:17 PM |
| Online Status |
Offline
|
| Date Last Visited |
a month ago
|