Business GIS How to let other developers do not need to understand the GIS can engage in development? Four

Source: Internet
Author: User
Tags map class eventbus

Let's think about the business system with the long option is what, they want a lot of land location, business system to know where the plots, plots of the style, symbolization, layer display, as well as the properties of the parcel display, and business developers do not care about what you layer SDE, rest publishing address, So you don't have to tell them that the first layer management is very important, each business system (the specified config) may load the layer is not the same, we have to manage them, as for how to manage to see everyone's hobbies, I wrote a tool to manage, the slices of the graph and the dynamic diagram, The order of permissions is also placed here, managing URL publishing.

When the layer tool is done, how does the business developer locate the parcel, ArcGIS for flex or ArcGIS for JavaScript has querytask this thing, and business developers can't use this to invoke, first of all, The layer SDE name can not tell them, because often publish service time will have Definitioan operation, there will be a one-to-many situation, rest service address also can not, it is possible later system upgrade rest service address changed how to do. So that's the name of the layer on Flex, which refers to the layer module of the Flex widget that we wrote, to mount our own business layer. Then the business system and the layer about the associated key value pair passed to us, and we found the URL querytask in our own layer tool to find the parcel.

We define a map class that specializes in the functions registered with flex.

1 varMap =function () {2 3      This. Emap =NewObject ();4     5 }6 7Map.prototype = {8 Constructor:map,9     /**Ten * Map restored to full view One      */ A     -  -  the     /** There's a callback, this needs to be tuned . - * from the layer name and the primary key and the value to navigate to a specified parcel to bring (highlight) - * @param layername layer name tentative Chinese name - * @param key layer primary key + * @param value layer primary key - * @param callback callback function can not be passed by default +      */ AZoombykeyvalue:function(LayerName, key, value, callback) { at          This. Emap.zoombykeyvalue (LayerName, Key, value,callback); -     } -  -  -}

The callback service tells you if the location was successful and joins the map class in Mapcontrol

1 varMapcontrol =function () {2     /**3 * Map initialization parameter Specific reference parameter class4 * @type {Parameter}5      */6      This. parameter =NewParameter ();7     /**8 * Add event Body specific reference Eventbus class9 * @type {Eventbus}Ten      */ One      This. Eventbus =NewEventbus (); A     /** - * Map function Maps provides a function to refer to the map class to call the maps class must wait for the mapping to complete, it is recommended to listen to the initialized event - * @type {MAP} the      */ -      This. Map =NewMap (); -     /** - * Map Initialization +      */ -      This. inlitialize =function () { +  A  atswfobjhash[ This. parameter.div] = This; -         varSwfversionstr = "11.4.0"; -         varXiswfurlstr = ""; -         varFlashvars = {}; -  -         varparams = {}; inParams.wmode = "opaque"; -Params.quality = "High"; toParams.bgcolor = "#ffffff"; +Params.allowscriptaccess = "Always"; -Params.allowfullscreen = "true"; the         varattributes = {}; *Attributes.id = This. Parameter.div; $Attributes.name = This. Parameter.div;Panax NotoginsengAttributes.align = "Middle"; - swfobject.embedswf ( the"Http://localhost/mymap/index.swf" + +              This. Parameter.getswfid (), This. Parameter.div, A              This. Parameter.width, This. Parameter.height, the swfversionstr, Xiswfurlstr, + flashvars, params, attributes); -Swfobject.createcss ("#" + This. Parameter.div, "display:block;text-align:left;"); $     } $ } -  -  the  - varSwfobjhash =NewObject ();Wuyi  the  - //Flex Graphics Component Load Complete callback Swfid is the identifier that distinguishes the embedded SWF Wu functionEmapcomplete (swfid) { -Swfobjhash[swfid].map.emap =document.getElementById (SWFID); AboutSwfobjhash[swfid].eventbus.dispatchevent ({type: "Initialized"}); $}

In the HTML call

1<script type= "Text/javascript" >2 3         varA =NewMapcontrol ();4A.parameter.config = "Config-checkview.xml";5a.parameter.div= "Flashcontent";6A.parameter.width = "800";7A.parameter.height = "800";8 A.eventbus.addeventlistener (mapcontrolevent.initialized,inithandle);9 a.initialise ();Ten  One         functionInithandle () A         { -  -A.map.zoombykeyvalue ("Underground Pipeline", "P_no", "55555") the         } -  -</script>

Business GIS How to let other developers do not need to understand the GIS can engage in development? Four

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.