Select to view content in your preferred language

LODs not working correctly for operationallayer

2214
8
08-11-2010 04:32 AM
Alexandervan_der_Schans
Emerging Contributor
I'm using the Flex Viewer 2.0 and am adding an operational layer on top of ESRI's topo map. The operational layer fits perfectly on top of the topo map when using the default settings. But as soon as I want to set the number of LODs used in the MapManager, the layer does not fit on top of the basemap anymore. I've tried making the service a tiled service with the same tiles as the World Topo Map but without any luck.

Can anybody tell me what's going on here?

Thanks!
Alex

ps: My goal is to remove the lowest zoom levels, because for my area the topo map does not have map data available in that detail.
Tags (2)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
Alexander,

   Why don't you just set the minScale property of the ArcGISTiledMapServiceLayer so that it does not display at scales where data does not exist?
0 Kudos
Alexandervan_der_Schans
Emerging Contributor
Robert,

where exactly would I add the minScale property? does it go below the :

var tiledlayer:ArcGISTiledMapServiceLayer = new ArcGISTiledMapServiceLayer?

and does the number have to be the exact number as specified by the LOD? (e.g with all the decimal numbers?)

thanks alot!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Alexander,

   yes try tiledlayer.minScale = somenumber; It would be best to have the exact number.
0 Kudos
Alexandervan_der_Schans
Emerging Contributor
Robert,

I've added the minScale property, but what happens is that the map now ONLY shows the map when I zoom in to the given scale (18056). When I zoom further in or out, the map can't render. Also, the zoomlevels below this scale are still available for zooming, which is not what I want. Any suggestions?

thanks,
Alex
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Alexander,


   OK, now I see that we have to go back to what you were originally trying to do and just remove the last couple of LODs from the map.

So there are a couple of things you can try one is this in the MapManager.mxml

//map load complete
            private function mapLoadComplete(event:MapEvent):void
            {
                // ViewerContainer.dispatchEvent(new AppEvent(AppEvent.LAYER_LOADED));
                map.lods.length = 18;
            }


This eliminates the last 2 LODS in the map.
0 Kudos
Alexandervan_der_Schans
Emerging Contributor
Thanks Robert, that works perfectly!

And in reverse, what would be the syntax to prevent the first x-number of LODs to be rendered?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Alexander,

   You would need to use some code like this

map.lods = map.lods.slice(9);//Remove first 9 lods


I would do this after you do the other though.
0 Kudos
Alexandervan_der_Schans
Emerging Contributor
Thanks! Works great.

And thank you for your fast replies!
Alex
0 Kudos