Select to view content in your preferred language

Clear Instructions to add map services to Flexviewer 2.0 Please

2759
32
07-31-2010 04:06 AM
IanHamilton
Deactivated User
I have been trolling the web for a definitive answer to this problem. I have had like many other starting to use Flexviewer run into the rediculous problem of it not doing what I assume many people want it to do. i.e add you own tiled base map map service to the viewer. Like others I have been unable to do this. I have managed to get a dynamic service to overlay Queensland Australia but no amount of trying the many partial solutions I have found on the forum and web in general have worked. I have ebven meed anlt to get a dynamic service in as the only layer but it does not zoom pan etc. The grey screen of death appears without fail.

Is it the proxy or isn't it?
Do I really have to recompile the viewer to get it to work?
What proxy files could I set up to get it to work?
Where are the instructions to do this?

Please, there is someone out there who knows how to fix this, please let the rest of  in on the secret.
The power of Flexviewer is that you supposedly don't have to be a guru to get tit to work.
But even mortals need the instruction book.

Using the latest flex on XP and IIS


Thanks

Ian
Tags (2)
0 Kudos
32 Replies
jameshawks
Deactivated User
Okay I guessed config.xml and did that, can't see our data. Various questions:

So may type by default is dynamic correct? A tiled service would only be if you tiled all the layers in arccatalog before publishing the msd?

Also our Spatial Reference is :4326 (WGS 84) but really that's the only service I want to show to start.

Also here is the config.xml line:

<mapservice label="ENCDirect"    type="feature" visible="true" alpha="1"
                        url="http://ocs-s-appd1:8399/arcgis/rest/services/AH_flex_tester/MapServer"/>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
James,

   Change the type="feature" to type="dynamic" and make sure you have a crossdomain.xml file in the root of your ArcGISServer.
0 Kudos
jameshawks
Deactivated User
Hmm still can't see our data. Here is my config.xml file:

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 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
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
    <httpproxy enabled="false">proxy.php</httpproxy>
    <title>NOAA's ENCDirect to GIS</title>
    <subtitle></subtitle>
    <logo>assets/images/noaa.png</logo>
    <stylesheet>lighterside.swf</stylesheet>

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

    <map initialextent="-15083000 3139000 -4779000 4558000">
        <basemaps>
            <mapservice label="Streets" type="tiled" visible="true"  alpha="1"
                        url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
           <mapservice label="Aerial"  type="tiled" visible="false" alpha="1"
                        url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
           <mapservice label="Topo"    type="tiled" visible="false" alpha="1"
                        url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
       
      <mapservice label="ENCDirect"    type="dynamic" visible="true" alpha="1"
                        url="http://ocs-s-appd1:8399/arcgis/rest/services/AH_flex_tester/MapServer"/>
 
 
 
  </basemaps>
        <operationallayers>
            <layer label="Boundaries and Places" type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/..."/>
            <layer label="Fires" type="feature" visible="false" alpha="1"
                   info="widgets/InfoTemplates/SimpleInfoWinWidget.swf"
                   infoconfig="widgets/InfoTemplates/IWT_Fires.xml"
                   url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0"/>
        </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"          x="400" y="60" icon="assets/images/i_bookmark.png"
                config="widgets/Bookmark/BookmarkWidget.xml"
                url="widgets/Bookmark/BookmarkWidget.swf"/>-->
        <!--<widget label="Find an address"   x="70" y="94" preload="open" icon="assets/images/i_target.png"
                config="widgets/Locate/LocateWidget_US.xml"
                url="widgets/Locate/LocateWidget.swf"/>-->
        <!--<widget label="Louisville Police" x="590" y="300" icon="assets/images/i_police.png"
                config="widgets/Query/QueryWidget_PublicSafety_Louisville.xml"
                url="widgets/Query/QueryWidget.swf"/>-->
        <!--<widget label="Search"
                icon="assets/images/i_search.png"
                config="widgets/Search/SearchWidget_Louisville.xml"
                url="widgets/Search/SearchWidget.swf"/>-->
        <!--<widget label="Earthquakes (GeoRSS)"
                icon="assets/images/i_rss.png"
                config="widgets/GeoRSS/GeoRSSWidget.xml"
                url="widgets/GeoRSS/GeoRSSWidget.swf"/>-->
        <!--<widget label="Draw"
                icon="assets/images/i_draw2.png"
                config="widgets/Draw/DrawWidget.xml"
                url="widgets/Draw/DrawWidget.swf"/>-->
        <!--<widget label="Print"
                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>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
James,

   You are mixing web-mercator basemap services from esri and your that is WGS-84 too different projections that is why you can not see yours. You either need to use esri wgs-84 map services like http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer instead.
0 Kudos
jameshawks
Deactivated User
Got it! It was a combination of bad config.xml syntax and not having crossdomain.xml in the proper path. Thanks for the help! On to the giant TOC.
0 Kudos
StaceMaples
Frequent Contributor
OK, so now that ArcGIS 10 implements the Web Mercator (Auc Sphere) with a WKID of 3857, rather than the WKID of 102100, which is what the Basemap services in the default FlexViewer app use, how the F@#$ are we supposed to create tilecaches with the same G!@@#$%* WKID as the Basemaps? 

You'll have to excuse my lack of surprise at this whole confluence of crappy documentation, implementation changes at every version, and ESRIUC Presentations that are just out-and-out dishonest, but I've been an ESRI user for nearly 20 years and this is nothing but the same old thing.  I've said for years that anyone at an ESRIUC that utters the words "Out-of-the-box functionality" should be punched in the face, and this just puts the cherry on top of that cake.

I've been trying all day to figure out why this "New Exciting App that Doesn't require you to be a developer" won't accept my tilecached services and now that I've FINALLY found a GREAT post (kudos to Robert!) on the reason, I find that there doesn't seem to be a way to fix it! That's really awesome ESRI!  Do you have a special lab there in Redlands dedicated to F!@#ing with people?

So, does anyone have any thoughts on how to create a tilecache service with a WKID of 102100, short of uninstalling ArcGIS 10 and reinstalling 9.3?
0 Kudos
BjornSvensson
Esri Regular Contributor
Stacey, as for the specific concern on using 102100 and 3857 tiled services together - this should work fine in the Flex Viewer (and other applications written with the Flex API).

3857 is the official ID, while 102100 is the ID that Esri started using before 3857 came into existence.  Since it is the same projection, the viewer will treat them as equivalent.  Thus it is possible to overlay "3857" tiled services on top of "102100" tiled services.  I'll make sure we include that information in our documentation.

If this isn't working for you, does the Flex Viewer work for you if you set your map service as the base map?

Roberts response was in regards to mixing Web Mercator and WGS84, which is different from mixing Web Mercator and Web Mercator.
0 Kudos
ChayaBalsiger
Frequent Contributor
Hi,
I tried adding a map service to Flexviewer and I too could not get it to work.  I know I must be missing a step somewhere but I am not sure where.  Here is some of the code from the config.xml file:

<configuration>
    <title>ArcGIS Viewer for Flex</title>
    <subtitle>... using ArcGIS</subtitle>
    <logo>assets/images/transp.png</logo>
    <stylecolors>0xFFFFFF,0x333333,0x101010,0x000000,0xFFD700</stylecolors> <!-- Black Gold -->
    <stylealpha>0.8</stylealpha>

    <!-- 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"/>
    <widget left="20"  bottom="20" config="widgets/Coordinate/CoordinateWidget.xml" url="widgets/Coordinate/CoordinateWidget.swf"/>

    <map initialextent="-10786000 4272100 -10570000 4365100" top="40">   

        <basemaps>
            <layer label="Streets" type="tiled" visible="true"  alpha="1"
                        url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
            <layer label="Aerial"  type="tiled" visible="false" alpha="1"
                        url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
            <layer label="Topo"    type="tiled" visible="false" alpha="1"
                        url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
<!-- this is what I added, I know tiled map services need to be in the same WKID, so I tried removing the other basemaps too, but it still did not display any data -->
     <layer label="Tulsa" type="tiled" visible="true" alpha="1"
   url="http://map.incog.org/ArcGIS/rest/services/cotweb/MapServer"/>



Thanks,
Chaya
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chaya,

   Your map service is not cached you can tell if a map service is cached or not by looking at the REST Services directory and you will see Single Fused Map Cache: true and then a listing of Tile Info:

So what you need to do is change the type to dynamic.
0 Kudos
ChayaBalsiger
Frequent Contributor
Hi,
I changed it to "dynamic" and it shows a white background, but nothing else.

Thanks,
Chaya
0 Kudos