Select to view content in your preferred language

FlexViewer 2.0 - Problems loading multiple 'basemap services'

1113
7
09-05-2010 03:57 PM
BecaGIS
Deactivated User
Hi all,

Having some troubles getting multiple map services to work properly. In 'testing' phase at the moment so we're using some of the Eagle Demo Services (NewZealand).

I just load in the source sample flex viewer and build the project on our Virtual Machine WebServer (all works fine).

I configure the config.xml adjusting some of the base layers to the following:

http://demos.eaglegis.co.nz/ArcGIS/rest/services/Geographx/newzealandcached-pooled/MapServer

http://demos.eaglegis.co.nz/ArcGIS/rest/services/General/newzealandcached-pooled/MapServer

But I notice that whichever is the 'first' one to appear the other will not load. Both are in NZTM (2193) so I don't understand why they wouldn't load?

The background is just 'black' when I flick between the basemaps (using the mapswitcher widget).

Any thoughts? Am I defining enough information about my basemap services?
Tags (2)
0 Kudos
7 Replies
BecaGIS
Deactivated User
Thought I better include what I've got in my config.xml for basemap

<map initialextent="1592131 5823996 1930269 6059740">

        <basemaps>

            <mapservice
         label="Base: New Zealand (EAGLE)"  
         type="tiled"
         visible="true"
         alpha="1.00"
         url="http://demos.eaglegis.co.nz/ArcGIS/rest/services/General/newzealandcached-pooled/MapServer"/>
        
            <mapservice
            label="Base: Terrain (EAGLE)" 
            type="tiled"
            visible="false"
            alpha="1.00"
            url="http://demos.eaglegis.co.nz/ArcGIS/rest/services/Geographx/newzealandcached-pooled/MapServer"/>

        </basemaps>

</map>
0 Kudos
JasonNielsen
Regular Contributor
I think its because your tiles are not the same size. You have 512 for one and you have 384 for the other. I believe they all have to have the same tile size. Try turning one into a dynamic service instead and see if they both then show up. They both appear to have the same spatial reference. Remember to clear your Rest cache before you check it.
0 Kudos
BecaGIS
Deactivated User
Thanks! I thought it could have something to do with that...

Changing type to Dynamic works but the display is average (I'm guessing because the services weren't designed to be viewed as 'dynamic'?)
0 Kudos
BjornSvensson
Esri Regular Contributor
The tiles can be different image sizes, but the LOD (levels of details) need to match.  In your two map services, they were cached for different sets of LODs:
      {"level" : 0, "resolution" : 4096, "scale" : 15480944.8660992}, 
      {"level" : 1, "resolution" : 2048, "scale" : 7740472.4330496}, 
      {"level" : 2, "resolution" : 1024, "scale" : 3870236.2165248}, 
      {"level" : 3, "resolution" : 512, "scale" : 1935118.1082624},
etc 


      {"level" : 0, "resolution" : 2560, "scale" : 9675590.541312}, 
      {"level" : 1, "resolution" : 1280, "scale" : 4837795.270656}, 
      {"level" : 2, "resolution" : 640, "scale" : 2418897.635328}, 
etc

Tiled map services are only displayed at the scales they were created for.  If you re-create one of them to the match the other, things should work fine.
0 Kudos
DiegoMerino
New Contributor
I have the same problem with the maps:

http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer

http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer

I used http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer to loas shapefiles files.

I tried to change the scale when you change the map type in the funcion

tbb_changeHandler2 private function (event: IndexChangeEvent): void

in MapSwitcherWidget.mxl

To http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer load

map.lods = [
new LOD (0,156543.033928,591657528)
new LOD (1,78271.516964,295828764)
new LOD (2,39135.758482,147914382)
new LOD (3,19567.879241,73957191)
new LOD (4,9783.93962,36978595)
new LOD (5,4891.96981,18489298)
New LOD (6,2445.984905,9244649)
new LOD (7,1222.992453,4622324)
new LOD (8,611.496226,2311162)
new LOD (9,305.748113,1155581)
new LOD (10,152.874057,577791)
new LOD (11,76.437028,288895)
new LOD (12,38.218514,144448)
new LOD (13,19.109257,72224)
new LOD (14,9.554629,36112)
new LOD (15,4.777314,18056)
new LOD (16,2.388657,9028)
new LOD (17,1.194329,4514)
new LOD (18,0.597164,2257)
new LOD (19,0.298582,1128)
];

and if selected

http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer load

map.lods = [
new LOD (0,0.3515625,147748799.285417)
new LOD (1,0.17578125,73874399.6427087)
new LOD (2,0.087890625,36937199.8213544)
new LOD (3,0.0439453125,18468599.9106772)
new LOD (4,0.02197265625,9234299.95533859)
new LOD (5,0.010986328125,4617149.97766929)
new LOD (6,0.0054931640625,2308574.98883465)
new LOD (7,0.00274658203125,1154287.49441732)
new LOD (8,0.001373291015625,577143.747208662)
new LOD (9,0.0006866455078125,288571.873604331)
new LOD (10,0.00034332275390625,144285.936802165)
new LOD (11,0.000171661376953125,72142.9684010827)
new LOD (12,8.58306884765629 E-05, 36071.4842005414)
new LOD (13,4.29153442382814 E-05, 18035.7421002707)
new LOD (14,2.14576721191407 E-05 9017.87105013534)
new LOD (15,1.07288360595703 E-05 4508.93552506767)
];


Some help

Thank you very much
0 Kudos
BecaGIS
Deactivated User
Thanks Bjorn!
0 Kudos
DiegoMerino
New Contributor
Hello , How re-create one of them to the match the other??

Thanks
0 Kudos