Implementation of ArcGISDynamicMapServiceLayer Layer Control Based on arcgis for javascript.

Source: Internet
Author: User
Tags fiddler2

Implementation of ArcGISDynamicMapServiceLayer Layer Control Based on arcgis for javascript.

Layer Control is a required small function in many GIS systems. This article describes how to implement Layer Control in ArcGISDynamicMapServiceLayer under arcgis for javascript. First, see the figure:


Effect

There are two important points: 1. Obtain the layer of ArcGISDynamicMapServiceLayer; 2. Control the display of layers. Layers can be obtained through layerInfos, and layer display is implemented through setVisibleLayers. The source code is as follows:

<! DOCTYPE html> 




Solution ArcGIS api for javascript-Layer Control

Jquery-easyui is not a js framework. You just need to find the required js and image and copy the html directly. If it can run

Online Editing of arcgis api for javascript

It may be that the published service type is incorrect, and what type of data are used? If you want to edit the data, you 'd better use file geodatabase, personel geodatabase, or arcsde. We recommend that you use the fiddler2 software, the fiddler2 software allows you to view the data uploaded to the map SERVER (access the SERVER you set up) and the data returned by the map SERVER, and then use the demo (access the arcgis server online server) are there any differences between uploading and returning data? First, check whether your code is faulty, or the server is faulty, and there are more problems with the code, it may be that the data returned by your SERVER is different from the data returned by arcgis server online. (The data must be different in many cases. You need to adjust the code at this time ), your code needs to be adjusted. The code is okay. When you access the online data of arcgis server, it does not mean that the data in the accessed area is okay. It may also be a problem with your service. The service has not been released.
I often encounter failures or errors in using my own server in the official demo. Generally, I use fiddler2 and alert (JSON. stringify (arr), JSON. stringify () can convert many objects (not all) into strings, compare them with the data of the official demo and accessing arcgis server online, locate the error, and then troubleshoot, not only data, but also objects, edit objects, and featerset objects. Are there any problems with objects. You can also use alert ("0000") to check the code execution stops. If the same object is executed, check whether the data has any problems.
 

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.