Select to view content in your preferred language

Clear Instructions to add map services to Flexviewer 2.0 Please

2791
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
RobertScheitlin__GISP
MVP Emeritus
Chaya,

  This worked fine for me.

<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"/>
        </basemaps>
        <operationallayers>
            <layer label="Tulsa" type="dynamic" visible="true" alpha="1"
    url="http://map.incog.org/ArcGIS/rest/services/cotweb/MapServer"/>
        </operationallayers>
    </map>
0 Kudos
ChayaBalsiger
Frequent Contributor
Did it show county boundaries?  I tried putting the layer under the operational layers, like you did and it still did not show anything in the map.  Do I have to save my config.xml file in the folder Inetpub/wwwroot?

Thanks,
Chaya
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chaya,


  Maybe you need to explain a little more on what you are actually doing. Sounds like you may be using the pre-compiled FlexViewer 2.1 if so and you already have it on the webserver and functioning than you only have to edit the config.xml and save your changes. If you are woking with the FlexViewer 2.1 source code than that is a little different.
0 Kudos
ChayaBalsiger
Frequent Contributor
Hi,
I probably should have explained everything in the beginning, sorry.  I am using the pre-compiled FlexViewer 2.1.  I can make other changes to the config.xml file (like change title, widgets, etc), save the file and then see my changes.  But, whenever I have tried to add a mapservice layer, the only thing that I can get to show up is the name of the layer (Tulsa) underneath the more button. The actual layer does not display anything like it should.  Yesterday I updated to the FlexViewer 2.1, but I was having the same problem with FlexViewer 2.0.  I tried the code you posted with both FlexViewer 2.0 and FlexViewer 2.1 (I have both FlexViewer 2.0 and FlexViewer 2.1 saved on my machine) and I still could not get anything else to show up.

Thanks,
Chaya
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chaya,

   That is strange because I took the code I posted and modified my config.xml for FlexViewer 2.1 (I am using Flash Builder and the source code of the Viewer but should not matter) and I saw your county boundaries and some pink outline of something. Is your webserver on the same machine as the ArcGIS Server is? I noticed that you do not have a crossdomain.xml file on your ArcGIS Server and that is likely the issue.

http://map.incog.org/crossdomain.xml

Look here for direction:

http://help.arcgis.com/en/webapi/flex/help/content/deploy_application.htm
0 Kudos
ChayaBalsiger
Frequent Contributor
Hi,
I am not sure if we have a crossdomain.xml file, but I will find out. Hopefully that will solve the problem.  Thanks for your help, I really appreciate it!

-Chaya
0 Kudos
StevenHeadley
Emerging Contributor
I too am having problems.  With Flexviewer 1.0, it was easy to add your own data, just change the path.  But when I do here, I can't see my data.  My data is in NAD83, so I deleted the ESRI urls, and added my own.  My service is cached.  I have pasted the code below. 

<map initialextent="-14083000 3139000 -10879000 5458000" top="40">
        <basemaps>

            <layer label="Basemap" type="tiled" visible="true"  alpha="1"
                        url="http://map/ArcGIS/rest/services/PlanningAndZoning/CountyBasemap/MapServer"/>
           
        </basemaps>

        <operationallayers>
           

        </operationallayers>
    </map>

I got rid of the operational layers also.  I didn't change the initial extent either.  Should I have?  I have pasted in my document information below from my rest services.

     Description:

Copyright Text:

Spatial Reference: 2248

Single Fused Map Cache: true

Tile Info:


Height: 512

Width: 512

DPI: 96

Levels of Detail: (# Levels: 10)

Level ID: 0 [Start Tile, End Tile]
Resolution: 208.333333333333
Scale: 240000
Level ID: 1 [Start Tile, End Tile]
Resolution: 104.166666666667
Scale: 120000
Level ID: 2 [Start Tile, End Tile]
Resolution: 52.0833333333333
Scale: 60000
Level ID: 3 [Start Tile, End Tile]
Resolution: 27.7777777777778
Scale: 32000
Level ID: 4 [Start Tile, End Tile]
Resolution: 13.8888888888889
Scale: 16000
Level ID: 5 [Start Tile, End Tile]
Resolution: 6.25
Scale: 7200
Level ID: 6 [Start Tile, End Tile]
Resolution: 4.16666666666667
Scale: 4800
Level ID: 7 [Start Tile, End Tile]
Resolution: 2.08333333333333
Scale: 2400
Level ID: 8 [Start Tile, End Tile]
Resolution: 1.04166666666667
Scale: 1200
Level ID: 9 [Start Tile, End Tile]
Resolution: 0.520833333333333
Scale: 600
Format: PNG8
Compression Quality: 0
Origin:
X: -120561100
Y: 148302500

Spatial Reference: 2248
Intial Extent:

XMin: 1368519.84395378
YMin: 582796.343062354
XMax: 1664088.24425541
YMax: 757519.38329201
Spatial Reference: 2248

Full Extent:

XMin: 1368519.84395378
YMin: 587798.959827192
XMax: 1664088.24425541
YMax: 752516.766527172
Spatial Reference: 2248

Units: esriFeet

Supported Image Format Types: PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI

  (This is not as easy as advertised for "non programmers".  You have to know a lot more, and better documentation is needed)
0 Kudos
DasaPaddock
Esri Regular Contributor
Yes, the initial extent should be in the same spatial reference as the first base layer.
0 Kudos
JoelShegrud
Deactivated User
Hello,

I feel like I have followed all the instructions on this thread but I still can't see my layers displayed.

My data, map services, and server are all on one machine so I didn't think I needed a crossdomain.xml file. If I do I have no idea how it works.

This is this is the map part of my config.xml: 

<map initialextent="-12517000 4980000 -12397000 5058300" top="40">
        <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"/>
        </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="Treatment areas" type="dynamic" visible="true" alpha="1"
     url="http://Ben/arcgis/services/SeverTry5/MapServer"/>
     <layer label="Web spots" type="dynamic" visible="true"
     url="http://Ben/arcgis/services/WebMap2/MapServer"/> 
        </operationallayers>
    </map>

This should work I have followed all the instructions faithfully. Any idea what is missing?

Ben
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ben,

You have everything but the rest portion of the url

url="http://Ben/arcgis/rest/services/SeverTry5/MapServer"
0 Kudos