ArcGIS for Flex Learning mapping---switching basemaps

Source: Internet
Author: User

Start today with a systematic study of ArcGIS for Flex, first from ESRI's example

1<?xml version= "1.0" encoding= "Utf-8"?>2<s:application xmlns:fx= "http://ns.adobe.com/mxml/2009"3Xmlns:s= "Library://ns.adobe.com/flex/spark"4Xmlns:esri= "Http://www.esri.com/2008/ags"5Pagetitle= "Toggle between Map Services" >6<!--7 Description:8 This is the sample demonstrates how to allow users to change9 between different basemaps. There is different waysTenTo visually accomplish ThisBehavior ThisIs just one example. One  A It also ensures that the levels of detail (LOD) was updated based on which Basemap is selected. -If all base maps has the same lods, you wouldn ' t need the Layershowhandler function. -  the Documentation: - For more information, see the API documentation. -http//resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/mappoint.html -http//resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/tiledmapservicelayer.html +http//Resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/tiledmapservicelayer.html#tileinfo -http//resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/supportclasses/tileinfo.html +http//resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/supportclasses/lod.html A  athttp//resources.arcgis.com/en/help/flex-api/concepts/index.html#/types_of_layers/017p00000027000000/ -  - ArcGIS REST API Documentation: -http//resources.arcgis.com/en/help/rest/apiref/mapserver.html -http//resources.arcgis.com/en/help/rest/apiref/tile.html -  inArcGIS forServer Documentation: -http//resources.arcgis.com/en/help/main/10.1/#/what_is_a_map_service/0154000002m7000000/ tohttp//resources.arcgis.com/en/help/main/10.1/#/what_is_map_caching/01540000048q000000/ +- -  the<fx:Script> *<![cdata[ $             ImportCom.esri.ags.geometry.MapPoint;Panax Notoginseng             ImportCom.esri.ags.layers.TiledMapServiceLayer; -  the             Importmx.events.FlexEvent; +  A             Privatefunction Layershowhandler (event:flexevent):void the             { +                 //update the Lods/zoomslider to use/show the levels for the selected base map -var Tiledlayer:tiledmapservicelayer =Event.target as Tiledmapservicelayer; $Mymap.lods =TiledLayer.tileInfo.lods; $             } -]]> -</fx:Script> the  -<s:controlBarContent>Wuyi<s:richtext width= "100%" > the This is the sample demonstrates how to allow users to change - between different basemaps. There is different ways WuTo visually accomplish ThisBehavior ThisIs just one example. -Click the different buttons on the bar below toSwitchbasemaps. About</s:RichText> $</s:controlBarContent> -  -<esri:map id= "MyMap" -Level= "4" ALoad= "Mymap.centerat (New MapPoint ( -11713000, 4822000)) > +<esri:arcgistiledmapservicelayer show= "Layershowhandler (event)" theUrl= "Http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" -Visible= "{Bb.selectedindex = = 0}"/> $<esri:arcgistiledmapservicelayer show= "Layershowhandler (event)" theUrl= "Http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" theVisible= "{Bb.selectedindex = = 1}"/> the<esri:arcgistiledmapservicelayer show= "Layershowhandler (event)" theUrl= "Http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" -Visible= "{Bb.selectedindex = = 2}"/> in<esri:arcgistiledmapservicelayer show= "Layershowhandler (event)" theUrl= "Http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer" theVisible= "{Bb.selectedindex = = 3}"/> About<esri:arcgistiledmapservicelayer show= "Layershowhandler (event)" theUrl= "Http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer" theVisible= "{Bb.selectedindex = = 4}"/> the</esri:Map> +<s:buttonbar id= "BB" -right= "5" top= "5" theRequireselection= "true" >Bayi<s:dataProvider> the<s:ArrayList> the<fx:String>Streets</fx:String> -<fx:String>Topographic</fx:String> -<fx:String>Imagery</fx:String> the<fx:String>Oceans</fx:String> the<fx:string>national geographic</fx:string> the</s:ArrayList> the</s:dataProvider> -</s:ButtonBar> the</s:Application>

Reprint Address: https://developers.arcgis.com/flex/sample-code/switching-basemaps.htm

ArcGIS for Flex learning mapping---switching basemaps

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.