ArcGIS API for javascript--map configuration-Customizing scaled animations

Source: Internet
Author: User
Tags time in milliseconds

Describe

This example shows how to define a map's animation when the user zooms in or out. Zoomduration and Zoomrate are Dojo animation properties that determine the animation's duration and frame refresh rate. These property units are milliseconds, and the default value of Zoomduration is 250,zoomrate the default value is 25.

In this case, you can get a better look at the data and the app by adjusting these properties. For example, if the map takes a long time to load, you can increase the zoomduration so that the user sees a short or distorted screen time while waiting for the zoom map to load. Conversely, if the map loads quickly, you can lower the zoomduration value to give the map a quicker feel.

This example shows how to change the default symbol for the Zoom box that is displayed when you hold down the SHIFT key while you click and drag the mouse. The ability to define arbitrary fill symbols as esriconfig inside the Zoomsymbol. As shown in this line of code:

EsriConfig.defaults.map.zoomSymbol = {"Color": [255,255,255,127], "outline": {"color": [255,0,0,255], "width": 1.5, " Style ":" Esrislsdash "}," style ":" Esrisfssolid "};


1 <!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD">2 <HTML>3   <Head>4     <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>5     <Metahttp-equiv= "X-ua-compatible"content= "Ie=7" />6     <title>customizing scaled animations</title>7     <Linkrel= "stylesheet"type= "Text/css"href= "Http://serverapi.arcgisonline.com/jsapi/arcgis/1.5/js/dojo/dijit/themes/tundra/tundra.css">8     <Scripttype= "Text/javascript"src= "http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.5"></Script>9     <Scripttype= "Text/javascript"> Ten     One Dojo.require ("Esri.map"); A         functioninit () { -              -             //Customizing scaled animations the            /*esriConfig.defaults.map.zoomDuration =//time in milliseconds; - esriConfig.defaults.map.zoomRate =//refresh rate of zoom animation;*/ -              -             //Customizing the Zoom box +             varZoomsymbol= NewEsri.symbol.SimpleFillSymbol (Esri.symbol.SimpleFillSymbol.STYLE_SOLID, -             NewEsri.symbol.SimpleLineSymbol (Esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, +             NewDojo. Color ([0,0,255]), 2), NewDojo. Color ([255,255,0,0.5])); A              at EsriConfig.defaults.map.zoomSymbol=Zoomsymbol.tojson (); -             varMap= NewESRI. Map ("Map", {nav:false});  -             varLayer= NewEsri.layers.ArcGISTiledMapServiceLayer ("Http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer");  - map.addlayer (layer);  -         } - dojo.addonload (init);  in          -     </Script> to   </Head> +    <Bodyclass= "Tundra"> -     <DivID= "Map"style= "width:1024px; height:512px; border:1px solid #000;"></Div> the   </Body> * </HTML> $  Panax Notoginseng  

ArcGIS API for javascript--map configuration-customizing scaled animations

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.