Select to view content in your preferred language

Using flex viewer for RIA and widgets applications

625
2
06-30-2011 01:24 PM
hervéparmentier
Deactivated User
I'm new user, as i told in my first message.

Actually i try to test RIA publication including widgets with the flex viewer for arcgis serveur.
After taking the URL of my Rest service coming from the Arcgis directory (AGS install in localhost, Win XP SP3), and putting it instead of the operational sample URL in the config.xml, i try to see my french map with a french projection (LB 93). i try to with WGS 84.

But i couln't see it , instead i have put the Flex viewer folder in the right place :
==========================
ArcGIS Viewer for Flex 2.3
build date 2011-04-14
==========================

This file contains the compiled version of the ArcGIS Viewer for Flex 2.3.

===============
Getting Started
===============

See http://links.esri.com/flexviewer-gettingstarted

1. Unzip the download package file; it will create a new folder called "flexviewer".

2. Place the flexviewer folder into your machine's Web server folder (e.g., C:\inetpub\wwwroot).
   Note: you will need write permissions to this folder.  Depending on your operating system and
   user privileges, you might have to ask your systems administrator for help.

3. Open a Web browser and test the Viewer application by entering the matching URL, e.g.
   http://<machinename>/flexviewer/index.html

I try to put a new widget code in this config.xml file but without result.

Somebody could help me ... i can develop more since 7 days... and have a counted time.

Thank by advance,

HP
Tags (2)
0 Kudos
2 Replies
BjornSvensson
Esri Regular Contributor
If your map service is cached (i.e. the tiles already created), then it needs to be in the same projection as the basemaps.  If your map service is not cached (i.e. map images are created dynamically), then it doesn't matter which projection it is in, as ArcGIS Server will automatically project it on-the-fly to the same projection as the basemaps you are using in your application.

In the config.xml file, what's the syntax you were using for your service?

Is your map service cached or not?  If it's cached the type should be specified as "tiled", if it's not cached, then the type should be specified with "dynamic".

What's the URL you are specifying for your map service?
What's the URL of your application?

If your application is not on the same domain as the ArcGIS Server, did you add a crossdomain.xml file to your ArcGIS Server?

More help:
Getting Started (Flex Viewer) - http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Getting_started/01m300000021000000/
Crossdomain.xml - http://help.arcgis.com/en/webapi/flex/help/index.html#/Using_crossdomain_xml/017p0000001w000000/
0 Kudos
hervéparmentier
Deactivated User
Dear Bjorn,

thank you to your answer.

For Cross domain  i don't nedd to access data from a different server than the one hosting your Flex application, because my application of flex viewer is on my own computer and the AGS version to.
In the root directory i have the flexviwer but i can not publish with my old adress like :
http://L018301.intranet.ens-lsh.fr/flexviewer/index.html
http://localhost/flexviewer/index.html
I have an error message like.HTTP 404 - File not found Services Internet (IIS)

I can launch the flex viewer buy using the Flex builder now... is it a problem ?

For my test i join the config.xml code file :

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010-2011 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>/License.txt
//
// Read more about ArcGIS Viewer for Flex 2.3 - http://links.esri.com/flexviewer
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
    <title>ArcGIS Viewer for Flex</title>
    <subtitle>a configurable web mapping application</subtitle>
    <logo>assets/images/logo.png</logo>
    <style>
        <colors>0xFFFFFF,0x333333,0x101010,0x000000,0xFFD700</colors>
        <alpha>0.8</alpha>
    </style>
    <!-- replace the following url with your own geometryservice -->
    <geometryservice url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" />
    <!-- replace the following key with your own Bing key -->
    <bing key="Ahw1due6dkmZg98wUJJYLrVmYlDik4oleCg6hoNqx6l2jFYRToImQH1HfH-asjjH"/>

    <!-- UI elements -->
    <widget left="10"  top="50"    config="widgets/Navigation/NavigationWidget.xml" url="widgets/Navigation/NavigationWidget.swf"/>
    <widget right="-2" bottom="-2" config="widgets/OverviewMap/OverviewMapWidget.xml" url="widgets/OverviewMap/OverviewMapWidget.swf"/>
    <widget right="20" top="55"    config="widgets/MapSwitcher/MapSwitcherWidget.xml" url="widgets/MapSwitcher/MapSwitcherWidget.swf"/>
    <widget left="0"   top="0"     config="widgets/HeaderController/HeaderControllerWidget.xml" url="widgets/HeaderController/HeaderControllerWidget.swf"/>

    <map wraparound180="true" initialextent="-14083000 3139000 -10879000 5458000" fullextent="-20000000 -20000000 20000000 20000000" top="40">
        <basemaps>
            <layer label="Streets" type="tiled" visible="true"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
            <layer label="Aerial"  type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
            <layer label="Topo"    type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
        </basemaps>
        <operationallayers>
            <layer label="Bassin versant Drôme" type="dynamic" visible="false" alpha="0.5"
                   url="http://l018301:80/ArcGIS/rest/services/BassinVersantDrome/MapServer">

            <!--Prefecture et et sous-prefectures-->
            <layer label="Prefecture et et sous-prefectures" type="dynamic" visible="false" alpha="1.0"
                   url="http://l018301:80/ArcGIS/rest/services/BassinVersantDrome/FeatureServer/0"/>

       <!--Chefs Lieu-->
            <layer label="Chefs Lieu" type="feature" type="dynamic" alpha="1.0"
                   url="http://l018301:80/ArcGIS/rest/services/BassinVersantDrome/FeatureServer/1"/>
                   
   <layer label="Reseau hydrographique" type="dynamic" visible="false" alpha="1.0"
                   url="http://l018301:80/ArcGIS/rest/services/BassinVersantDrome/FeatureServer/2"/>
                  
  <layer label="Limites bassin versant Drôme" type="dynamic" visible="false" alpha="1.0"
                  url="http://l018301:80/ArcGIS/rest/services/BassinVersantDrome/FeatureServer/3"/> 
                   
   <layer label="Contours de la Drôme" type="dynamic" visible="false" alpha="1.0"
                   url="http://l018301:80/ArcGIS/rest/services/BassinVersantDrome/FeatureServer/4"/>
                  
   <layer label="Contour SAGE" type="dynamic" visible="false" alpha="1.0"
                   url="http://l018301:80/ArcGIS/rest/services/BassinVersantDrome/FeatureServer/5"/>
               </layer>                             
        </operationallayers>
    </map>

    <!-- widgets organized into widget containers that manage close/open etc -->
    <!-- supported layout property options: horizontal(default)|float|vertical|fix-->
    <widgetcontainer layout="float">
        <widget label="Bookmarks"         left="430" top="90"
                icon="assets/images/i_bookmark.png"
                config="widgets/Bookmark/BookmarkWidget.xml"
                url="widgets/Bookmark/BookmarkWidget.swf"/>
        <widget label="Find an address"   left="100" top="90" preload="open"
                icon="assets/images/i_target.png"
                config="widgets/Locate/LocateWidget_Bing.xml"
                url="widgets/Locate/LocateWidget.swf"/>
        <widget label="Louisville Police" left="590" top="280"
                icon="assets/images/i_police.png"
                config="widgets/Query/QueryWidget_Louisville_PoliceStations.xml"
                url="widgets/Query/QueryWidget.swf"/>
        <widget label="Search" left="80" top="280"
                icon="assets/images/i_search.png"
                config="widgets/Search/SearchWidget_Louisville.xml"
                url="widgets/Search/SearchWidget.swf"/>
        <widget label="Earthquakes (GeoRSS)" left="410" top="280"
                icon="assets/images/i_rss.png"
                config="widgets/GeoRSS/GeoRSSWidget.xml"
                url="widgets/GeoRSS/GeoRSSWidget.swf"/>
        <widget label="Draw and Measure" left="60" top="400"
                icon="assets/images/i_draw2.png"
                config="widgets/Draw/DrawWidget.xml"
                url="widgets/Draw/DrawWidget.swf"/>
        <widget label="Print" left="390" top="400"
                icon="assets/images/i_print.png"
                config="widgets/Print/PrintWidget.xml"
                url="widgets/Print/PrintWidget.swf"/>

        <!--
        <widget label="My first widget"
                icon="assets/images/i_widget.png"
                config="widgets/Samples/HelloWorld/HelloWorldWidget.xml"
                url="widgets/Samples/HelloWorld/HelloWorldWidget.swf"/>
        -->
    </widgetcontainer>

</configuration>

Thank you to your next answer.

HP
0 Kudos