Select to view content in your preferred language

Setting Pop-up windows in the map

3928
32
Jump to solution
06-06-2012 01:46 AM
IkerBerasaluce
New Contributor III
Hello,
I'm not sure if this thread belongs in this forum, but since I can't find the correct one and I'm using the silverlight API in my development I will post it here. If this isn't the correct forum please tell me which is, thank you.
I am trying to use the code sample for Web Map Dynamic Service Popups (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#WebMapDynamicServicePopups). My problem is that the popup templates property in the dynamic layer is not enabled, so it shows the pop up window (with a little change in the code) but none of the information.
I tried enabling the pop up info using this help guide (http://help.arcgis.com/en/arcgisonline/help/index.html#/Configuring_pop_up_windows/010q0000004m00000...) and setting them is quite straitforward in the arcgis.com map (http://www.arcgis.com/home/webmap/viewer.html) but I can't save the chnages in my service.
I'm not sure if this is the right path or if I have to set the pop ups while creating the map, before I upload it to my server.

Thanks for your help.
0 Kudos
32 Replies
BarraLoubna
New Contributor
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");

....
0 Kudos
JoeHershman
MVP Regular Contributor
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
Thanks,
-Joe
0 Kudos
BarraLoubna
New Contributor
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






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
0 Kudos
JoeHershman
MVP Regular Contributor
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
Thanks,
-Joe
0 Kudos
BarraLoubna
New Contributor
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




Can you give me an example, please!? How I can call the service when operating the Identify tool without adding in the code and where place in the code??
0 Kudos
BarraLoubna
New Contributor
Can you give me an example, please!? How I can call the service when operating the Identify tool without adding in the code and where place in the code??


I still waiting for your help, if you want!!!!
0 Kudos
JoeHershman
MVP Regular Contributor
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)
Thanks,
-Joe
0 Kudos
BarraLoubna
New Contributor
I understand now, I just try it and it works, the service does not appear on the map, but the  Identify function remains functional.

Thank you very much for your help,
0 Kudos
BarraLoubna
New Contributor
Hello, I am back with another question.

I would like to join  Identify fonction to a button in my toolbar, I want when I click that button and I click on the map, the Identify window opens with the information of the attribute. Identify window now appears always "empty" when I launch the application.

I had already tried with the function ToggleVisibilityAction:


<esri1:ToolbarItem x:Name="Identify" Text="Identify">
<esri1:ToolbarItem.Content>
  <Button  >
   <Image Source="i_identify.png" Stretch="UniformToFill"/>
                     <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                              <local:ToggleVisibilityAction TargetName="IdentifyMap">
                               </local:ToggleVisibilityAction>
             </i:EventTrigger>
                      </i:Interaction.Triggers>
                 </Button>
</esri1:ToolbarItem.Content>
</esri1:ToolbarItem>




But when I specifies that the visivility = collapsed and I execute the program, the window does not appear to Identify initially, but when I click the button to open the window, the window of Identify will not open .. . the function of the button works when the visibility = visibile to close and pen the window when running the application.
0 Kudos
IkerBerasaluce
New Contributor III
For this particular aspect of your question, note that the arcgis.com viewer doesn't allow to save configuation (popoup, symbology...) at the service level. It is only possible at the map level.

To save at the service level, you can use ArcGIS Online Explorer.


Hello,
Sorry for the delay in the answer, I've been off work for a couple of weeks. Your answer was very usefull and now I have the PopUp setting enabled in all the sublayer of my ArcGISDynamicMapServiceLayer service layer. Still, I'm having some trouble with the PopupTemplatesProperty as everytime I check my layer in code it tells me it's set to nothing. Am I missing something or I have to check some other property of the sublayers instead of the whole service?

Here's the code:

For Each layer As Layer In MapaGIS.Layers
 If layer.GetValue(Document.PopupTemplatesProperty) IsNot Nothing Then
  amsCapasMapa = TryCast(layer, ArcGISDynamicMapServiceLayer)
  idcDIccionario = TryCast(layer.GetValue(Document.PopupTemplatesProperty), IDictionary(Of Integer, DataTemplate))
  For Each linInformacionCapa As LayerInfo In amsCapasMapa.Layers
   If ((dblEscalaMapa > linInformacionCapa.MaxScale AndAlso dblEscalaMapa < linInformacionCapa.MinScale) OrElse (linInformacionCapa.MaxScale = 0.0 AndAlso linInformacionCapa.MinScale = 0.0) OrElse (dblEscalaMapa > linInformacionCapa.MaxScale AndAlso linInformacionCapa.MinScale = 0.0)) AndAlso idcDIccionario.ContainsKey(linInformacionCapa.ID) Then ' id present in dictionary
    intLayerID = linInformacionCapa.ID
    dtmInformacionCapa = idcDIccionario(linInformacionCapa.ID)
    Exit For
   End If
  Next linInformacionCapa
 End If
Next


Thank you.
0 Kudos