ArcGIS JS queries All of a layer's information

Source: Internet
Author: User

<!DOCTYPE HTML><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head>    <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>    <title>Querytask</title>    <Linkrel= "stylesheet"type= "Text/css"href= "Http://10.0.0.92:8002/arcgis_js_api/library/3.17/3.17/dijit/themes/tundra/tundra.css"            />    <Linkrel= "stylesheet"type= "Text/css"href= "Http://10.0.0.92:8002/arcgis_js_api/library/3.17/3.17/esri/css/esri.css"/>    <Scripttype= "Text/javascript"src= "Http://10.0.0.92:8002/arcgis_js_api/library/3.17/3.17/init.js"></Script>    <styletype= "Text/css">        . Mapclass{width:100%;Height:600px;Border:1px solid #000;        }    </style>    <Scripttype= "Text/javascript">require (["Esri/map",                    "Esri/layers/arcgisdynamicmapservicelayer",                    "Dojo/dom",                    "dojo/on",                    "Esri/tasks/querytask",                    "Esri/tasks/query",                    "Esri/symbols/simplelinesymbol",                    "Esri/symbols/simplefillsymbol",                    "esri/graphic",                    "dojo/domready!"],                function(Map, Arcgisdynamicmapservicelayer, Dom, ON, Querytask, Query, Simp Lelinesymbol, Simplefillsymbol, Graphic) {//Create a map based on the DIV's id attribute                    varMap= NewMap ("Mapdiv"); //Define a dynamic map service                    varLayer= NewArcgisdynamicmapservicelayer ("Http://10.0.0.92:6080/arcgis/rest/services/xinyu/MapServer"); //add a layer to a mapmap.addlayer (layer)//Add a Click event to a Property query buttonOn (Dom.byid ("Btn"), "Click", function(e) {//Defining Query Objects                        varQuerytask= NewQuerytask ("HTTP://10.0.0.92:6080/ARCGIS/REST/SERVICES/XINYU/MAPSERVER/17"); //defining query Parameter Objects                        varQuery= NewQuery (); //query criteria, similar to the WHERE clause of the SQL statementQuery.where= "1 =1"; //field Information returned: * Represents return all fieldsQuery.outfields= ["*"]; //whether to return geometric shapesQuery.returngeometry= true; //Execute Property Queryquerytask.execute (query, Showqueryresult); })                    //after the property query is complete, use Showqueryresult to process the returned results                    functionShowqueryresult (QueryResult) {}}); </Script></Head><Body><DivID= "Mapdiv"class= "Mapclass"></Div><inputtype= "button"value= "attribute Query"ID= "Btn"/><DivID= "Divshowresult"></Div></Body></HTML>

Effect:

ArcGIS JS queries All of a layer's information

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.