Arcgis for JavaScript map operation Addlayer Detailed

Source: Internet
Author: User

The content of this section is simple, say the Addlayer method of the Map object inside ArcGIS for JavaScript. In the For JS API, the Addlayer method has two types, such as:


Addlayer method

In the Addlayer method there are two parameters, one is a required parameter layer, the other is optional parameter index,layer do not say, can be supported by any kind of layer, focusing on index. The index parameter is used to control the hierarchical relationship of the map display, that is, which one is on, which is under, for example:

With no parameters:

Map.addlayer (base); Map.addlayer (IMG);
In this case, the Order of Map.addlayer () is the order of index, that is, base is on the bottom, IMG is on the upper level,

Normal situation

Map.addlayer (base,1); Map.addlayer (img,0);

After adding the Inde parameter, base is ON, IMG is below,:


What happens after adding a parameter

After adding the index parameter, the layer's display level is controlled.


Postscript:

Why would specifically put this thing specifically, the origin is this: in the early April when the new unit, the unit has a project is done with ArcGIS for JavaScript, the project has a lot of layers, in order to improve efficiency, all use Wmslayer, but the object type is not uniform, A bit, line, face, in the process of processing will involve layer of the display hierarchy relationship, because previously did not contact, listen to the previous technology said can not control, so I also believe, but then contacted Openlayers found in openlayers inside May, I think ESRI should also can, So there is the production of this article, in this record.


Arcgis for JavaScript map operation Addlayer Detailed

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.