Select to view content in your preferred language

Need Help with Displaying Default Mapservice on Identify Widget

3647
11
02-24-2011 05:52 AM
sivavelappan
Emerging Contributor
I am a newbie trying to figure out Arcgis viewer for Flex. I have a Identify Widget displaying 3 mapservice. Two of them as base map(titled) and 1 as Livemap which is an internal service(dynamic). I want the Identify widget drop down to default to Dynamic Service without affecting the website. As i tried to move around the mapservice, Identify widget displayed the dynamic one but there was no map displayed.

code goes like this
<basemaps menu="menuMap">

   <mapservice label="Street Map" type="tiled" visible="true" alpha="1" icon="com/esri/solutions/flexviewer/assets/images/icons/i_highway.png">http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer</mapservice>
   <mapservice label="Satellite Map" type="tiled" visible="false" alpha="1" icon="com/esri/solutions/flexviewer/assets/images/icons/i_shuttle.png">http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer</mapservice>
           
</basemaps>


<basemaps menu="menuMap">
                   
      <mapservice label="Road" type="virtualearth" visible="true" style="road" alpha="1" icon="com/esri/solutions/flexviewer/assets/images/icons/i_globe.png">http://[machine]/vetoken.ashx</mapservice>
      <mapservice label="Aerial" type="virtualearth" visible="false" style="aerial" alpha="1" icon="com/esri/solutions/flexviewer/assets/images/icons/i_globe.png">http://[machine]/vetoken.ashx</mapservice>
</basemaps>
      
<livemaps>
 
 
  <mapservice label="Utilities" type="dynamic" visible="true" alpha="1">http://......../ArcGIS/rest/services/Internet_MAIN/MapServer</mapservice>
</livemaps>
Tags (2)
0 Kudos
11 Replies
JonFisher
Emerging Contributor
There are several things unclear to me here, but to start you're using Sample Flex Viewer 1.3, right?

First of all, you shouldn't have two basemap sections. If you want 4 basemaps to choose from (one at a time), put all 4 basemap mapservice entries in one <basemaps menu="menuMap"> ... </basemaps> section. That error could be why you don't see the map displaying properly.

If you want to overlay some of the basemaps on top of other basemaps (this would ONLY make sense if using partial transparency, which you don't have set currently) you would put those map service entries in the <livemaps> section and set alpha to less than 1.

Since you mention a dropdown, I assume you're using the Search widget and not Identify, but I also don't think you can identify any of the base maps and get something useful returned, so that doesn't make sense to me either.

So if you just have four base maps to choose from and one livemap, either identify or search should work very easily.
0 Kudos
sivavelappan
Emerging Contributor
There are several things unclear to me here, but to start you're using Sample Flex Viewer 1.3, right?

First of all, you shouldn't have two basemap sections. If you want 4 basemaps to choose from (one at a time), put all 4 basemap mapservice entries in one <basemaps menu="menuMap"> ... </basemaps> section. That error could be why you don't see the map displaying properly.

If you want to overlay some of the basemaps on top of other basemaps (this would ONLY make sense if using partial transparency, which you don't have set currently) you would put those map service entries in the <livemaps> section and set alpha to less than 1.

Since you mention a dropdown, I assume you're using the Search widget and not Identify, but I also don't think you can identify any of the base maps and get something useful returned, so that doesn't make sense to me either.

So if you just have four base maps to choose from and one livemap, either identify or search should work very easily.



Jon,
   Thanks for your reply. Yes i am on Flex Viewer 1.3 . We do have an Identify widget picking up the Mapservice in the order of street,satellite and then Utilities(livemap). I would want to select Utilities as Default for the selection, but inorder that to happen i moved the Livemap above the Basemap and got what i want. But the maps wont display. Thats my problem. Let me know if you can thing of anything else i could do.
0 Kudos
JonFisher
Emerging Contributor
Please post your config.xml file, and a link to your web map if you have one available. Without at least the config file it's hard to figure out what could be wrong.
0 Kudos
sivavelappan
Emerging Contributor
web map is http://hrsdgis.hrsdnet.com/hrsdgissiva/

Please find the config file attached...

Thanks
0 Kudos
JonFisher
Emerging Contributor
The xml looks good to me, I couldn't find any syntax errors, and the projection of your map service matches the base. The only think I can think to try is change the proxytype if appropriate (e.g. from ASP to PHP). Other than that I'm not sure why your layer isn't displaying. If you've been working with the compiled version of the map viewer, you might try re-downloading and configuring it in case you modified another file that is causing a problem.

The link to your map service: http://hrsdgis.hrsdnet.com/ArcGIS/rest/services/Internet_MAIN/MapServer is valid and I can get it to display in the javascript viewer on the REST page. I added it to one of my maps and it showed up fine as well. I did notice that it won't open in ArcMap b/c the source is set using the machine name rather than the domain (in ArcMap you get the following as the source, which won't work), but that shouldn't affect your web map:
Data Type: ArcGIS Map Service
Connection:   Internet
Server:   http://GISPUBAPP1/ArcGIS/services
Name:   Internet_MAIN
0 Kudos
sivavelappan
Emerging Contributor
The xml looks good to me, I couldn't find any syntax errors, and the projection of your map service matches the base. The only think I can think to try is change the proxytype if appropriate (e.g. from ASP to PHP). Other than that I'm not sure why your layer isn't displaying. If you've been working with the compiled version of the map viewer, you might try re-downloading and configuring it in case you modified another file that is causing a problem.

The link to your map service: http://hrsdgis.hrsdnet.com/ArcGIS/rest/services/Internet_MAIN/MapServer is valid and I can get it to display in the javascript viewer on the REST page. I added it to one of my maps and it showed up fine as well. I did notice that it won't open in ArcMap b/c the source is set using the machine name rather than the domain (in ArcMap you get the following as the source, which won't work), but that shouldn't affect your web map:
Data Type: ArcGIS Map Service
Connection:   Internet
Server:   http://GISPUBAPP1/ArcGIS/services
Name:   Internet_MAIN



Thanks for Troubleshooting it... Did u look at the Identify widget? if yes, I wanted the HRSD Utilities
drop down as default instead of Street Map . Let me know if i make sense.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Siva,

If you are working with the Sample Flex Viewer source code than the fix is simple.

In the src/com/esri/solutions/esa/widgets/IdentifyWidget.mxml change the init function to this:

  private function init():void
  {        
   mMapServices = new ArrayCollection(this.configData.configMap.reverse());
   theMap = this.map;
   clickGraphicsLayer.spatialReference = theMap.spatialReference;
      theMap.addLayer(clickGraphicsLayer);            
  }
0 Kudos
sivavelappan
Emerging Contributor
Siva, 

If you are working with the Sample Flex Viewer source code than the fix is simple. 

In the src/com/esri/solutions/esa/widgets/IdentifyWidget.mxml change the init function to this: 

  private function init():void
  {        
   mMapServices = new ArrayCollection(this.configData.configMap.reverse());
   theMap = this.map;
   clickGraphicsLayer.spatialReference = theMap.spatialReference;
      theMap.addLayer(clickGraphicsLayer);            
  }




Robert,
Thanks for looking at this... and providing me the code.. but no i am not working with source code. I downloaded the Viewer for Flex and did modifications. If you can guide me how to get this fix applied that will be great.

Thanks
Siva
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Siva,

   I am not sure how you would fix the issue without modifying the code.
0 Kudos