Select to view content in your preferred language

building index.mxml sample flex viewer

3235
8
06-29-2010 12:56 PM
NatashaManzuiga
Regular Contributor
Hi all, I have build index.mxml  like I did with widgets I create...but it doesnt work( I dont see any map!!)...I have to replace original swf file from sample flex viewer and my website work again...I dont know what's wrong with it. Thanks to everybody.
<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
//  ESRI, Inc
//  Copyright 2008 ESRI, Inc
//  All Rights Reserved.
//
//  NOTICE: ESRI permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
-->
<mx:Application xmlns:mx   ="http://www.adobe.com/2006/mxml" 
             xmlns    ="com.esri.solutions.flexviewer.*" 
             layout    ="absolute" 
             applicationComplete ="registerGlobalKeyHandler()" 
             styleName   ="plain" 
             backgroundColor  ="#6E6E6E"
             xmlns:widgets="com.esri.solutions.flexviewer.widgets.*">

<!--
/**
 * The site container has six major components:
 *  - ConfigManager: loads configuration file (config.xml), parse it and submit to event bus.
 *  - Controller   : holds branding UI elements and application navigation items such as menus.
 *  - DataManager  : manages data generated during a user session.
 *  - WidgetManager: manages widgets during the user session.
 *  - MapManager   : manages map(s) such as base map and live maps used during the user session.
 */
-->

 <mx:Script>
  <![CDATA[
  
   import com.esri.solutions.flexviewer.AppEvent;  
   import mx.managers.IDragManager;
   import mx.managers.HistoryManager; 
   
   private var iDragManager:IDragManager;
   private var hist:HistoryManager; 
   
   private function registerGlobalKeyHandler() :void
   {
    stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
    
   }
   
  
   private function handleKeyDown(event:KeyboardEvent) :void
   {
    if ((event.shiftKey) && (event.keyCode == 27))
    {
     SiteContainer.dispatchEvent(new AppEvent(AppEvent.SET_MAP_NAVIGATION, false, false, null)); 
    }
   }

  ]]>
 </mx:Script>
 
 <SiteContainer id="container"> 
    <configManager> <ConfigManager/> </configManager>
       <uiManager>     <UIManager/>     </uiManager>
       <controller>    <Controller x="20" y="20"/>    </controller>
       <dataManager>   <DataManager/>   </dataManager>
       <widgetManager> <WidgetManagerDocked/> </widgetManager>
       <mapManager>  <MapManager/> </mapManager>
 </SiteContainer>
</mx:Application>
Tags (2)
0 Kudos
8 Replies
NatashaManzuiga
Regular Contributor
Hi all, I have build index.mxml  like I did with widgets I create...but it doesnt work( I dont see any map!!)...I have to replace original swf file from sample flex viewer and my website work again...I dont know what's wrong with it. Thanks to everybody.
<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
//  ESRI, Inc
//  Copyright 2008 ESRI, Inc
//  All Rights Reserved.
//
//  NOTICE: ESRI permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
-->
<mx:Application xmlns:mx   ="http://www.adobe.com/2006/mxml" 
             xmlns    ="com.esri.solutions.flexviewer.*" 
             layout    ="absolute" 
             applicationComplete ="registerGlobalKeyHandler()" 
             styleName   ="plain" 
             backgroundColor  ="#6E6E6E"
             xmlns:widgets="com.esri.solutions.flexviewer.widgets.*">

<!--
/**
 * The site container has six major components:
 *  - ConfigManager: loads configuration file (config.xml), parse it and submit to event bus.
 *  - Controller   : holds branding UI elements and application navigation items such as menus.
 *  - DataManager  : manages data generated during a user session.
 *  - WidgetManager: manages widgets during the user session.
 *  - MapManager   : manages map(s) such as base map and live maps used during the user session.
 */
-->

 <mx:Script>
  <![CDATA[
  
   import com.esri.solutions.flexviewer.AppEvent;  
   import mx.managers.IDragManager;
   import mx.managers.HistoryManager; 
   
   private var iDragManager:IDragManager;
   private var hist:HistoryManager; 
   
   private function registerGlobalKeyHandler() :void
   {
    stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
    
   }
   
  
   private function handleKeyDown(event:KeyboardEvent) :void
   {
    if ((event.shiftKey) && (event.keyCode == 27))
    {
     SiteContainer.dispatchEvent(new AppEvent(AppEvent.SET_MAP_NAVIGATION, false, false, null)); 
    }
   }

  ]]>
 </mx:Script>
 
 <SiteContainer id="container"> 
    <configManager> <ConfigManager/> </configManager>
       <uiManager>     <UIManager/>     </uiManager>
       <controller>    <Controller x="20" y="20"/>    </controller>
       <dataManager>   <DataManager/>   </dataManager>
       <widgetManager> <WidgetManagerDocked/> </widgetManager>
       <mapManager>  <MapManager/> </mapManager>
 </SiteContainer>
</mx:Application>


nobody can help me????? 😞
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Natasha,

   The problem is that there are just to many possibilities to your issue and not enough details provided.

When you make a change to any code in the SFV that is not added to Flex modules list for that project and not part of a widget, those changes are added to the compiled Index.swf. So there could be a thousand different things that could be causing your index.swf to not compile correctly.
0 Kudos
NatashaManzuiga
Regular Contributor
Natasha,

   The problem is that there are just to many possibilities to your issue and not enough details provided.

When you make a change to any code in the SFV that is not added to Flex modules list for that project and not part of a widget, those changes are added to the compiled Index.swf. So there could be a thousand different things that could be causing your index.swf to not compile correctly.


Robert, I dowloaded again flexviewer1.3 and I started from 0...
I compiled without any change and it's always the same: with my maps only compiled index.swf extracted from flex sample viewer works and display everything correctly...
I can say that the size of the extracted file is 441Kb, the index.swf I built is 375Kb.
It sucks so much..... :((
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Natasha,

   You should probably post your config.xml so we can look at it.
0 Kudos
NatashaManzuiga
Regular Contributor
Natasha,

   You should probably post your config.xml so we can look at it.


<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright �?© 2008 - 2009 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions.  See use restrictions in the file:
// <install location>/FlexViewer/License.txt
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
 <userinterface>
  <banner>visible</banner>
  <title>GIS-Locali2</title>
  <subtitle>Powered by Assets and Logistics Unit 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>
 <basemaps menu="menuMap">
      <mapservice label="Map" type="dynamic" visible="true" alpha="1">http://mapserver1/rest/services/test/Carta/MapServer/</mapservice>
  </basemaps>
 //uncomment lines below to view virtual earth maps;comment arcgisonline map configuration above (elements: map, basemaps, mapservice) 

 </map>
 <navtools>
  <navtool label="Zoom In" icon="com/esri/solutions/flexviewer/assets/images/icons/i_zoomin.png" menu="menuNav">zoomin</navtool>
  <navtool label="Zoom Out" icon="com/esri/solutions/flexviewer/assets/images/icons/i_zoomout.png" menu="menuNav">zoomout</navtool>
  <navtool label="Full Extent" icon="com/esri/solutions/flexviewer/assets/images/icons/i_zoomfull.png" menu="menuNav">zoomfull</navtool>
  <navtool label="Re-center Map" icon="com/esri/solutions/flexviewer/assets/images/icons/i_pan.png" menu="menuNav">pan</navtool>
 </navtools>
 <widgets>
  <widget label="Overview Map" preload="minimized" icon="com/esri/solutions/flexviewer/assets/images/icons/i_overview.png" menu="menuMap" config="com/esri/solutions/flexviewer/widgets/OverviewMapWidget.xml">com/esri/solutions/flexviewer/widgets/OverviewMapWidget.swf</widget> 
  <widget label="Print" icon="com/esri/solutions/flexviewer/assets/images/icons/i_print.png" menu="menuMap" config="com/esri/solutions/flexviewer/widgets/PrintWidget.xml">com/esri/solutions/flexviewer/widgets/PrintWidget.swf</widget>  
  <widget label="Identify" icon="com/esri/solutions/flexviewer/assets/images/icons/i_info.png" menu="menuWidgets" config="com/esri/solutions/esa/widgets/IdentifyWidget.xml">com/esri/solutions/esa/widgets/IdentifyWidget.swf</widget>
  <widget label="Search" icon="com/esri/solutions/flexviewer/assets/images/icons/i_search.png" menu="menuWidgets" config="com/esri/solutions/flexviewer/widgets/SearchWidget.xml">com/esri/solutions/flexviewer/widgets/SearchWidget.swf</widget> 
</widgets>


 <links>
  <link label="Help" icon="com/esri/solutions/flexviewer/assets/images/icons/i_help.png" menu="menuHelp">help.html</link>
  <link label="Home" icon="com/esri/solutions/flexviewer/assets/images/icons/i_home.png" menu="menuHelp">http://www.esri.com</link>
  <link label="Resources" icon="com/esri/solutions/flexviewer/assets/images/icons/i_resources.png" menu="menuHelp">http://resources.esri.com</link>
 </links>
 <proxytype>asp</proxytype> <!-- apache|jsp||php -->
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Natasha,


    1. Your map element in your config.xml is missing it's inital and full extent attributes
    2. You mapservice url should not have the / at the end.
0 Kudos
NatashaManzuiga
Regular Contributor
Natasha,


    1. Your map element in your config.xml is missing it's inital and full extent attributes
    2. You mapservice url should not have the / at the end.


Oh Robert how much I wish it could be because of this....
It works very well with original index.swf(built by ESRI)...but with the index.swf I built(without any change from the original source downloaded from esri website..) the sample flex viewer doesnt display my map...if I substitute it with the index.swf(built by ESRI) it perfectly works...one more strange thing: my index.swf correctly show the default mapservices in config.xml...
I'm getting crazy with this :((

Naty
0 Kudos
NatashaManzuiga
Regular Contributor
Oh Robert how much I wish it could be because of this....
It works very well with original index.swf(built by ESRI)...but with the index.swf I built(without any change from the original source downloaded from esri website..) the sample flex viewer doesnt display my map...if I substitute it with the index.swf(built by ESRI) it perfectly works...one more strange thing: my index.swf correctly show the default mapservices in config.xml...
I'm getting crazy with this :((

Naty


FIXED!!!
http://forums.arcgis.com/threads/2498-sample-flex-viewer-live-maps-other-services-won-t-display?p=22...
0 Kudos