Select to view content in your preferred language

Help!! ArcGis Api JS. Query()!!

3816
1
02-05-2015 01:04 PM
Heber_DanielRamos_Mendoza
Deactivated User

EXAMPLE:

I want to get the same result as the example.

I'm doing wrong.?

var queryTaskGeoCatmin = new QueryTask("http://geocatmin.ingemmet.gob.pe/arcgis/rest/services/SERV_CARTOGRAFIA_DEMARCACION_WGS84/MapServer/0");

        var queryGeocatmin = new Query();

        queryGeocatmin.outSpatialReference = [{wkid:4326}];

        queryGeocatmin.SpatialRelationship = "esriSpatialRelIntersects";

        queryGeocatmin.geometryType = "point";

        queryGeocatmin.geometry ={f: "json", x :-75.954001, y :-7.740334};

        queryGeocatmin.outFields = ["*"];

        queryTaskGeoCatmin.execute(queryAmbito, resultGeocatmin);

       

        function resultGeocatmin(queryAmbito){

            console.log(queryAmbito);

        }

Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Heber,

  You have some of your properties wrong:

        var queryGeocatmin = new Query();
        queryGeocatmin.outSpatialReference = new esri.SpatialReference({wkid:4326}); 
        queryGeocatmin.SpatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;
        queryGeocatmin.geometry = new esri.geometry.point(-75.954001,-7.740334, new esri.SpatialReference({ wkid: 4326 }));
        queryGeocatmin.outFields = ["*"];
        queryTaskGeoCatmin.execute(queryAmbito, resultGeocatmin);
0 Kudos