Select to view content in your preferred language

Map service will not display in sample viewer

702
1
04-08-2010 05:30 AM
codypike
Deactivated User
Hi everyone,
I am having an issue making my dynamic map server visible in the flex sample viewer.
I loaded the src folder into flex builder and have changed the map service to our server
All the tools load but not my base map. if any one can take a look at the code and give
me some suggestions it would be greatly appreciated!

from config.xml
<configuration>
 <userinterface>
  <banner>visible</banner>
  <title>Sample Flex Viewer</title>
  <subtitle>Powered by ArcGIS Server</subtitle>
  <logo>com/esri/solutions/flexviewer/assets/images/logo.png</logo>
  <stylesheet>com/esri/solutions/flexviewer/themes/darkangel/style.swf</stylesheet>
  <menus>
   <menu id="menuMap" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_globe.png">Map</menu>
   <menu id="menuNav" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_nav.png">Navigation</menu>
   <menu id="menuWidgets" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_widget.png">Tools</menu>
   <menu id="menuFeeds" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_servicearea.png">Feeds</menu>
   <menu id="menuHelp" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_help.png">Help</menu>
  </menus>
 </userinterface>

 <map initialExtent="-9076242.08174035 5093048.82413728 -9013753.96653318 5142334.52580584 102113" fullExtent="-9076242.08174035 5093048.82413728 -9013753.96653318 5142334.52580584 102113">
 <basemaps menu="menuMap">      
   <mapservice label="Street Map" type="dynamic" visible="true" alpha="1" icon="com/esri/solutions/flexviewer/assets/images/icons/i_highway.png">htttp://gismachine/arcgis/rest/services/flextest/mapserver</mapservice>
 </basemaps>


from Map Manager.mxml
   for (i = 0; i < configData.configExtents.length; i++)
          {
           var id:String = configData.configExtents.id;
           var ext:String = configData.configExtents.extent;
           var extArray:Array = ext.split(" ");
           var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]), new SpatialReference((extArray[4])));
           if (id == "full")
           {
            fullExtent = extent;
           }
           if (id == "initial")
           {
            map.extent = extent;
 

Thanks again to anyone that can help, I have no problem building a flex site from scratch with this mapserver
so I am a little stumped as to why the same server won't display in the sample.


Cody M. Pike
GIS Mapping Technician
Lake County GIS Department
Tags (2)
0 Kudos
1 Reply
codypike
Deactivated User
I found the issue my map was in a different Spatial Reference, I needed set it by entering the following in to Mapmanager.mxml.

          for (i = 0; i < configData.configExtents.length; i++)
          {
           var id:String = configData.configExtents.id;
           var ext:String = configData.configExtents.extent;
           var extArray:Array = ext.split(" ");
           var newSR:SpatialReference = new SpatialReference(102113);
                  var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]), newSR);
           if (id == "full")
           {
            fullExtent = extent;
           }
           if (id == "initial")
           {
            map.extent = new Extent(-9076242.08174035, 5093048.82413728, -9013753.96653318, 5142334.52580584, newSR);
0 Kudos